use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GoNLAnnotatorTest method testAnnotate14.
@Test
public void testAnnotate14() {
Entity entity14 = new DynamicEntity(emd);
entity14.set(VcfAttributes.CHROM, "21");
entity14.set(VcfAttributes.POS, 45650009);
entity14.set(VcfAttributes.REF, "T");
entity14.set(VcfAttributes.ALT, "TG, A, G");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity14));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertEquals(resultEntity.get(GONL_GENOME_AF), "0.22188755020080322,.,.");
assertEquals(resultEntity.get(GONL_GENOME_GTC), "306|163|29,.,.");
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GoNLAnnotatorTest method testAnnotate10.
@Test
public void testAnnotate10() {
Entity entity10 = new DynamicEntity(emd);
entity10.set(VcfAttributes.CHROM, "2");
entity10.set(VcfAttributes.POS, 191904021);
entity10.set(VcfAttributes.REF, "G");
entity10.set(VcfAttributes.ALT, "T");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity10));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertEquals(resultEntity.get(GONL_GENOME_AF), "0.0030120481927710845");
assertEquals(resultEntity.get(GONL_GENOME_GTC), "495|3|0");
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GoNLAnnotatorTest method testAnnotate5.
@Test
public void testAnnotate5() {
Entity entity5 = new DynamicEntity(emd);
entity5.set(VcfAttributes.CHROM, "2");
entity5.set(VcfAttributes.POS, 171570151);
entity5.set(VcfAttributes.REF, "C");
entity5.set(VcfAttributes.ALT, "T");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity5));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertEquals(resultEntity.get(GONL_GENOME_AF), "0.30823293172690763");
assertEquals(resultEntity.get(GONL_GENOME_GTC), "241|207|50");
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GoNLAnnotatorTest method testAnnotate4.
@Test
public void testAnnotate4() {
Entity entity4 = new DynamicEntity(emd);
entity4.set(VcfAttributes.CHROM, "1");
entity4.set(VcfAttributes.POS, 231094050);
entity4.set(VcfAttributes.REF, "GAA");
entity4.set(VcfAttributes.ALT, "G,GAAA,GA");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity4));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertNull(resultEntity.get(GONL_GENOME_AF));
assertNull(resultEntity.get(GONL_GENOME_GTC));
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class ThousandGenomesAnnotatorTest method testAnnotate.
@Test
public void testAnnotate() {
EntityType emdIn = entityTypeFactory.create("test");
emdIn.addAttribute(vcfAttributes.getChromAttribute(), ROLE_ID);
emdIn.addAttribute(vcfAttributes.getPosAttribute());
emdIn.addAttribute(vcfAttributes.getRefAttribute());
emdIn.addAttribute(vcfAttributes.getAltAttribute());
emdIn.addAttribute(attributeFactory.create().setName(THOUSAND_GENOME_AF).setDataType(STRING).setDescription("The allele frequency for variants seen in the population used for the thousand genomes project").setLabel(THOUSAND_GENOME_AF_LABEL));
Entity inputEntity = new DynamicEntity(emdIn);
inputEntity.set(VcfAttributes.CHROM, "1");
inputEntity.set(VcfAttributes.POS, 249240543);
inputEntity.set(VcfAttributes.REF, "AGG");
inputEntity.set(VcfAttributes.ALT, "A");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(inputEntity));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertEquals(resultEntity.get(VcfAttributes.CHROM), "1");
assertEquals(resultEntity.get(VcfAttributes.POS), 249240543);
assertEquals(resultEntity.get(VcfAttributes.REF), "AGG");
assertEquals(resultEntity.get(VcfAttributes.ALT), "A");
assertEquals(resultEntity.get(THOUSAND_GENOME_AF), "0.61861");
}
Aggregations