Search in sources :

Example 16 with MultiAllelicResultFilter

use of org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter in project molgenis by molgenis.

the class MultiAllelicResultFilterTest method filterResultsMergeMultilineMismatchChrom.

@Test
public void filterResultsMergeMultilineMismatchChrom() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), true, vcfAttributes);
    try {
        filter.filterResults(Arrays.asList(resultEntity10, entityMismatchChrom), entity10, false);
        Assert.fail("Should throw exception for mismatching chromosomes");
    } catch (MolgenisDataException actual) {
        assertEquals(actual.getMessage(), "Mismatch in location! Location{chrom=1, pos=100} vs Location{chrom=2, pos=100}");
    }
}
Also used : MolgenisDataException(org.molgenis.data.MolgenisDataException) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Example 17 with MultiAllelicResultFilter

use of org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter in project molgenis by molgenis.

the class MultiAllelicResultFilterTest method filterResultsTest2.

@Test
public void filterResultsTest2() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result2 = filter.filterResults(Collections.singletonList(resultEntity2), entity1, false);
    Assert.assertTrue(Lists.newArrayList(result2.asSet()).size() == 0);
}
Also used : DynamicEntity(org.molgenis.data.support.DynamicEntity) Entity(org.molgenis.data.Entity) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Example 18 with MultiAllelicResultFilter

use of org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter in project molgenis by molgenis.

the class MultiAllelicResultFilterTest method filterResultsTest4.

@Test
public void filterResultsTest4() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result4 = filter.filterResults(Collections.singletonList(resultEntity4), entity2, false);
    assertEquals(Lists.newArrayList(result4.asSet()).get(0).getString("annotation"), "6,5");
}
Also used : DynamicEntity(org.molgenis.data.support.DynamicEntity) Entity(org.molgenis.data.Entity) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Example 19 with MultiAllelicResultFilter

use of org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter in project molgenis by molgenis.

the class MultiAllelicResultFilterTest method filterResultsTest3.

@Test
public void filterResultsTest3() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result3 = filter.filterResults(Collections.singletonList(resultEntity3), entity2, false);
    assertEquals(Lists.newArrayList(result3.asSet()).get(0).getString("annotation"), "3,4");
}
Also used : DynamicEntity(org.molgenis.data.support.DynamicEntity) Entity(org.molgenis.data.Entity) MultiAllelicResultFilter(org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Example 20 with MultiAllelicResultFilter

use of org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter 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

MultiAllelicResultFilter (org.molgenis.data.annotation.core.filter.MultiAllelicResultFilter)21 AbstractMolgenisSpringTest (org.molgenis.data.AbstractMolgenisSpringTest)16 Entity (org.molgenis.data.Entity)16 Test (org.testng.annotations.Test)16 DynamicEntity (org.molgenis.data.support.DynamicEntity)14 AnnotatorInfo (org.molgenis.data.annotation.core.entity.AnnotatorInfo)5 EntityAnnotator (org.molgenis.data.annotation.core.entity.EntityAnnotator)5 AbstractAnnotator (org.molgenis.data.annotation.core.entity.impl.framework.AbstractAnnotator)5 LocusQueryCreator (org.molgenis.data.annotation.core.query.LocusQueryCreator)5 Attribute (org.molgenis.data.meta.model.Attribute)5 AttributeFactory (org.molgenis.data.meta.model.AttributeFactory)5 SingleFileLocationCmdLineAnnotatorSettingsConfigurer (org.molgenis.data.annotation.web.settings.SingleFileLocationCmdLineAnnotatorSettingsConfigurer)4 MolgenisDataException (org.molgenis.data.MolgenisDataException)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 ArrayList (java.util.ArrayList)1 EntityType (org.molgenis.data.meta.model.EntityType)1