Search in sources :

Example 6 with AttributeFactory

use of org.molgenis.data.meta.model.AttributeFactory in project molgenis by molgenis.

the class ExacAnnotator method init.

@Override
public void init() {
    List<Attribute> attributes = createExacOutputAttributes();
    List<Attribute> resourceMetaData = new ArrayList<>(asList(attributeFactory.create().setName(EXAC_AF_ResourceAttributeName).setDataType(STRING), attributeFactory.create().setName(EXAC_AC_HOM_ResourceAttributeName).setDataType(STRING), attributeFactory.create().setName(EXAC_AC_HET_ResourceAttributeName).setDataType(STRING)));
    AnnotatorInfo exacInfo = AnnotatorInfo.create(READY, POPULATION_REFERENCE, "exac", " The Exome Aggregation Consortium (ExAC) is a coalition of investigators seeking to aggregate" + " and harmonize exome sequencing data from a wide variety of large-scale sequencing projects" + ", and to make summary data available for the wider scientific community.The data set provided" + " on this website spans 60,706 unrelated individuals sequenced as part of various " + "disease-specific and population genetic studies. ", attributes);
    // TODO: properly test multiAllelicFresultFilter
    LocusQueryCreator locusQueryCreator = new LocusQueryCreator(vcfAttributes);
    MultiAllelicResultFilter multiAllelicResultFilter = new MultiAllelicResultFilter(resourceMetaData, vcfAttributes);
    EntityAnnotator entityAnnotator = new AbstractAnnotator(EXAC_TABIX_RESOURCE, exacInfo, locusQueryCreator, multiAllelicResultFilter, dataService, resources, new SingleFileLocationCmdLineAnnotatorSettingsConfigurer(EXAC_LOCATION, exacAnnotatorSettings)) {

        @Override
        public List<Attribute> createAnnotatorAttributes(AttributeFactory attributeFactory) {
            return createExacOutputAttributes();
        }

        @Override
        protected Object getResourceAttributeValue(Attribute attr, Entity sourceEntity) {
            String attrName = EXAC_AF.equals(attr.getName()) ? EXAC_AF_ResourceAttributeName : EXAC_AC_HOM.equals(attr.getName()) ? EXAC_AC_HOM_ResourceAttributeName : EXAC_AC_HET.equals(attr.getName()) ? EXAC_AC_HET_ResourceAttributeName : attr.getName();
            return sourceEntity.get(attrName);
        }
    };
    annotator.init(entityAnnotator);
}
Also used : LocusQueryCreator(org.molgenis.data.annotation.core.query.LocusQueryCreator) Entity(org.molgenis.data.Entity) Attribute(org.molgenis.data.meta.model.Attribute) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) EntityAnnotator(org.molgenis.data.annotation.core.entity.EntityAnnotator) ArrayList(java.util.ArrayList) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) AbstractAnnotator(org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator) AnnotatorInfo(org.molgenis.data.annotation.core.entity.AnnotatorInfo) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory) SingleFileLocationCmdLineAnnotatorSettingsConfigurer(org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)

Example 7 with AttributeFactory

use of org.molgenis.data.meta.model.AttributeFactory in project molgenis by molgenis.

the class ClinvarAnnotator method init.

@Override
public void init() {
    List<Attribute> attributes = createClinvarOutputAttributes();
    AnnotatorInfo clinvarInfo = AnnotatorInfo.create(Status.READY, AnnotatorInfo.Type.PATHOGENICITY_ESTIMATE, NAME, " ClinVar is a freely accessible, public archive of reports of the relationships" + " among human variations and phenotypes, with supporting evidence. ClinVar thus facilitates" + " access to and communication about the relationships asserted between human variation and " + "observed health status, and the history of that interpretation. ClinVar collects reports " + "of variants found in patient samples, assertions made regarding their clinical significance, " + "information about the submitter, and other supporting data. The alleles described in submissions " + "are mapped to reference sequences, and reported according to the HGVS standard. ClinVar then " + "presents the data for interactive users as well as those wishing to use ClinVar in daily " + "workflows and other local applications. ClinVar works in collaboration with interested " + "organizations to meet the needs of the medical genetics community as efficiently and effectively " + "as possible. Information about using ClinVar is available at: http://www.ncbi.nlm.nih.gov/clinvar/docs/help/.", attributes);
    LocusQueryCreator locusQueryCreator = new LocusQueryCreator(vcfAttributes);
    ClinvarMultiAllelicResultFilter clinvarMultiAllelicResultFilter = new ClinvarMultiAllelicResultFilter(vcfAttributes);
    EntityAnnotator entityAnnotator = new AbstractAnnotator(CLINVAR_TABIX_RESOURCE, clinvarInfo, locusQueryCreator, clinvarMultiAllelicResultFilter, dataService, resources, new SingleFileLocationCmdLineAnnotatorSettingsConfigurer(CLINVAR_LOCATION, clinvarAnnotatorSettings)) {

        @Override
        public List<Attribute> createAnnotatorAttributes(AttributeFactory attributeFactory) {
            return createClinvarOutputAttributes();
        }

        @Override
        protected Object getResourceAttributeValue(Attribute attr, Entity sourceEntity) {
            String attrName;
            if (CLINVAR_CLNSIG.equals(attr.getName())) {
                attrName = CLINVAR_CLNSIG_ResourceAttributeName;
            } else if (CLINVAR_CLNALLE.equals(attr.getName())) {
                attrName = CLINVAR_CLINALL_ResourceAttributeName;
            } else {
                attrName = attr.getName();
            }
            return sourceEntity.get(attrName);
        }
    };
    annotator.init(entityAnnotator);
}
Also used : LocusQueryCreator(org.molgenis.data.annotation.core.query.LocusQueryCreator) Entity(org.molgenis.data.Entity) Attribute(org.molgenis.data.meta.model.Attribute) EntityAnnotator(org.molgenis.data.annotation.core.entity.EntityAnnotator) ClinvarMultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.ClinvarMultiAllelicResultFilter) AbstractAnnotator(org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator) AnnotatorInfo(org.molgenis.data.annotation.core.entity.AnnotatorInfo) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory) SingleFileLocationCmdLineAnnotatorSettingsConfigurer(org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)

Example 8 with AttributeFactory

use of org.molgenis.data.meta.model.AttributeFactory in project molgenis by molgenis.

the class OmimAnnotator method init.

@Override
public void init() {
    List<Attribute> attributes = createOmimOutputAttributes();
    AnnotatorInfo omimInfo = AnnotatorInfo.create(AnnotatorInfo.Status.READY, AnnotatorInfo.Type.PHENOTYPE_ASSOCIATION, NAME, "OMIM is a comprehensive, authoritative compendium of human genes and genetic phenotypes that is " + "freely available and updated daily. The full-text, referenced overviews in OMIM contain information on all " + "known mendelian disorders and over 15,000 genes. OMIM focuses on the relationship between phenotype and genotype.", attributes);
    EntityAnnotator entityAnnotator = new AbstractAnnotator(OMIM_RESOURCE, omimInfo, geneNameQueryCreator, new OmimResultFilter(entityTypeFactory, this), dataService, resources, new SingleFileLocationCmdLineAnnotatorSettingsConfigurer(OMIM_LOCATION, omimAnnotatorSettings)) {

        @Override
        public List<Attribute> createAnnotatorAttributes(AttributeFactory attributeFactory) {
            return createOmimOutputAttributes();
        }
    };
    annotator.init(entityAnnotator);
}
Also used : Attribute(org.molgenis.data.meta.model.Attribute) EntityAnnotator(org.molgenis.data.annotation.core.entity.EntityAnnotator) AbstractAnnotator(org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator) AnnotatorInfo(org.molgenis.data.annotation.core.entity.AnnotatorInfo) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory) SingleFileLocationCmdLineAnnotatorSettingsConfigurer(org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)

Example 9 with AttributeFactory

use of org.molgenis.data.meta.model.AttributeFactory in project molgenis by molgenis.

the class GoNLAnnotator method init.

@Override
public void init() {
    List<Attribute> attributes = createGoNlOutputAttributes();
    AnnotatorInfo thousandGenomeInfo = AnnotatorInfo.create(AnnotatorInfo.Status.READY, AnnotatorInfo.Type.POPULATION_REFERENCE, NAME, "What genetic variation is to be found in the Dutch indigenous population? " + "Detailed knowledge about this is not only interesting in itself, " + "it also helps to extract useful biomedical information from Dutch biobanks. " + "The Dutch biobank collaboration BBMRI-NL has initiated the extensive Rainbow Project “Genome of the Netherlands” (GoNL) " + "because it offers unique opportunities for science and for the development of new treatments and diagnostic techniques. " + "A close-up look at the DNA of 750 Dutch people-250 trio’s of two parents and an adult child-plus a " + "global genetic profile of large numbers of Dutch will disclose a wealth of new information, new insights, " + "and possible applications.", attributes);
    LocusQueryCreator locusQueryCreator = new LocusQueryCreator(vcfAttributes);
    EntityAnnotator entityAnnotator = new QueryAnnotatorImpl(GONL_MULTI_FILE_RESOURCE, thousandGenomeInfo, locusQueryCreator, dataService, resources, (annotationSourceFileName) -> {
        goNLAnnotatorSettings.set(ROOT_DIRECTORY, annotationSourceFileName);
        goNLAnnotatorSettings.set(FILEPATTERN, "gonl.chr%s.snps_indels.r5.vcf.gz");
        goNLAnnotatorSettings.set(OVERRIDE_CHROMOSOME_FILES, "X:gonl.chrX.release4.gtc.vcf.gz");
        goNLAnnotatorSettings.set(CHROMOSOMES, "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X");
    }) {

        @Override
        public List<Attribute> createAnnotatorAttributes(AttributeFactory attributeFactory) {
            return createGoNlOutputAttributes();
        }

        @Override
        protected void processQueryResults(Entity entity, Iterable<Entity> annotationSourceEntities, boolean updateMode) {
            if (updateMode) {
                throw new MolgenisDataException("This annotator/filter does not support updating of values");
            }
            List<Entity> refMatches = determineRefMatches(entity, annotationSourceEntities);
            setGoNLFrequencies(entity, refMatches);
        }
    };
    annotator.init(entityAnnotator);
}
Also used : LocusQueryCreator(org.molgenis.data.annotation.core.query.LocusQueryCreator) Entity(org.molgenis.data.Entity) MolgenisDataException(org.molgenis.data.MolgenisDataException) Attribute(org.molgenis.data.meta.model.Attribute) EntityAnnotator(org.molgenis.data.annotation.core.entity.EntityAnnotator) QueryAnnotatorImpl(org.molgenis.data.annotation.core.entity.impl.framework.QueryAnnotatorImpl) AnnotatorInfo(org.molgenis.data.annotation.core.entity.AnnotatorInfo) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory)

Example 10 with AttributeFactory

use of org.molgenis.data.meta.model.AttributeFactory in project molgenis by molgenis.

the class DannAnnotator method init.

@Override
public void init() {
    List<Attribute> attributes = createDannOutputAttributes();
    AnnotatorInfo dannInfo = AnnotatorInfo.create(AnnotatorInfo.Status.READY, AnnotatorInfo.Type.PATHOGENICITY_ESTIMATE, NAME, "Annotating genetic variants, especially non-coding variants, " + "for the purpose of identifying pathogenic variants remains a challenge." + " Combined annotation-dependent depletion (CADD) is an al- gorithm designed " + "to annotate both coding and non-coding variants, and has been shown to outper- form " + "other annotation algorithms. CADD trains a linear kernel support vector machine (SVM) " + "to dif- ferentiate evolutionarily derived, likely benign, alleles from simulated, " + "likely deleterious, variants. However, SVMs cannot capture non-linear relationships" + " among the features, which can limit performance. To address this issue, we have" + " developed DANN. DANN uses the same feature set and training data as CADD to train" + " a deep neural network (DNN). DNNs can capture non-linear relation- ships among " + "features and are better suited than SVMs for problems with a large number of samples " + "and features. We exploit Compute Unified Device Architecture-compatible " + "graphics processing units and deep learning techniques such as dropout and momentum " + "training to accelerate the DNN training. DANN achieves about a 19%relative reduction " + "in the error rate and about a 14%relative increase in the area under the curve (AUC) metric " + "over CADD’s SVM methodology. " + "All data and source code are available at https://cbcl.ics.uci.edu/ public_data/DANN/.", attributes);
    EntityAnnotator entityAnnotator = new AbstractAnnotator(DANN_TABIX_RESOURCE, dannInfo, new LocusQueryCreator(vcfAttributes), new MultiAllelicResultFilter(attributes, vcfAttributes), dataService, resources, new SingleFileLocationCmdLineAnnotatorSettingsConfigurer(DANN_LOCATION, dannAnnotatorSettings)) {

        @Override
        public List<Attribute> createAnnotatorAttributes(AttributeFactory attributeFactory) {
            return createDannOutputAttributes();
        }
    };
    annotator.init(entityAnnotator);
}
Also used : LocusQueryCreator(org.molgenis.data.annotation.core.query.LocusQueryCreator) Attribute(org.molgenis.data.meta.model.Attribute) EntityAnnotator(org.molgenis.data.annotation.core.entity.EntityAnnotator) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) AbstractAnnotator(org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator) AnnotatorInfo(org.molgenis.data.annotation.core.entity.AnnotatorInfo) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory) SingleFileLocationCmdLineAnnotatorSettingsConfigurer(org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)

Aggregations

AttributeFactory (org.molgenis.data.meta.model.AttributeFactory)12 Attribute (org.molgenis.data.meta.model.Attribute)11 AnnotatorInfo (org.molgenis.data.annotation.core.entity.AnnotatorInfo)9 EntityAnnotator (org.molgenis.data.annotation.core.entity.EntityAnnotator)9 AbstractAnnotator (org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator)8 LocusQueryCreator (org.molgenis.data.annotation.core.query.LocusQueryCreator)7 SingleFileLocationCmdLineAnnotatorSettingsConfigurer (org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)7 MultiAllelicResultFilter (org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter)5 Entity (org.molgenis.data.Entity)4 MolgenisDataException (org.molgenis.data.MolgenisDataException)2 VcfAttributes (org.molgenis.data.vcf.model.VcfAttributes)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Collectors.toList (java.util.stream.Collectors.toList)1 StringUtils (org.apache.commons.lang3.StringUtils)1