Search in sources :

Example 1 with MultiAllelicResultFilter

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

the class MultiAllelicResultFilterTest method filterResultsTest9.

@Test
public void filterResultsTest9() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result = filter.filterResults(Collections.singletonList(resultEntity7), entity7, false);
    assertEquals(Lists.newArrayList(result.asSet()).get(0).getString("annotation"), "13");
}
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 2 with MultiAllelicResultFilter

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

the class MultiAllelicResultFilterTest method filterResultsTest10.

@Test
public void filterResultsTest10() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result = filter.filterResults(Collections.singletonList(resultEntity8), entity8, false);
    assertEquals(Lists.newArrayList(result.asSet()).get(0).getString("annotation"), "15");
}
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 3 with MultiAllelicResultFilter

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

the class MultiAllelicResultFilterTest method filterResultsTest6.

@Test
public void filterResultsTest6() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result6 = filter.filterResults(Collections.singletonList(resultEntity2), entity2, false);
    assertEquals(Lists.newArrayList(result6.asSet()).get(0).getString("annotation"), ".,2");
}
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 4 with MultiAllelicResultFilter

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

the class MultiAllelicResultFilterTest method filterResultsMergeMultilineMismatchPos.

@Test
public void filterResultsMergeMultilineMismatchPos() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), true, vcfAttributes);
    try {
        filter.filterResults(Arrays.asList(entityMismatchPos, resultEntity10), entity10, false);
        Assert.fail("Should throw exception for mismatching positions");
    } catch (MolgenisDataException actual) {
        assertEquals(actual.getMessage(), "Mismatch in location! Location{chrom=1, pos=101} vs Location{chrom=1, 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 5 with MultiAllelicResultFilter

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

the class MultiAllelicResultFilterTest method filterResultsTest5.

@Test
public void filterResultsTest5() {
    MultiAllelicResultFilter filter = new MultiAllelicResultFilter(Collections.singletonList(attributeFactory.create().setName("annotation").setDataType(STRING)), vcfAttributes);
    Optional<Entity> result5 = filter.filterResults(Collections.singletonList(resultEntity5), entity3, false);
    assertEquals(Lists.newArrayList(result5.asSet()).get(0).getString("annotation"), "8,9,7");
}
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)

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