use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class ExacAnnotatorTest method testAnnotate.
@Test
public void testAnnotate() {
EntityType emdIn = entityTypeFactory.create("exac");
emdIn.addAttribute(vcfAttributes.getChromAttribute(), ROLE_ID);
emdIn.addAttribute(vcfAttributes.getPosAttribute());
emdIn.addAttribute(vcfAttributes.getRefAttribute());
emdIn.addAttribute(vcfAttributes.getAltAttribute());
emdIn.addAttribute(exacAnnotator.getExacAFAttr(attributeFactory));
emdIn.addAttribute(exacAnnotator.getExacAcHomAttr(attributeFactory));
emdIn.addAttribute(exacAnnotator.getExacAcHetAttr(attributeFactory));
Entity inputEntity = new DynamicEntity(emdIn);
inputEntity.set(VcfAttributes.CHROM, "1");
inputEntity.set(VcfAttributes.POS, 13372);
inputEntity.set(VcfAttributes.REF, "G");
inputEntity.set(VcfAttributes.ALT, "C");
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), 13372);
assertEquals(resultEntity.get(VcfAttributes.REF), "G");
assertEquals(resultEntity.get(VcfAttributes.ALT), "C");
assertEquals(resultEntity.get(ExacAnnotator.EXAC_AF), "6.998E-5");
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GavinAnnotatorTest method getVariantEntity.
private Entity getVariantEntity(String alt, String caddScaled, String exacAF) {
Entity variantEntity = new DynamicEntity(entityType);
variantEntity.set(VcfAttributes.ALT, alt);
variantEntity.set(CaddAnnotator.CADD_SCALED, caddScaled);
variantEntity.set(ExacAnnotator.EXAC_AF, exacAF);
return variantEntity;
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class HPOResultFilterTest method filterResults.
@Test
public void filterResults() {
HpoResultFilter filter = new HpoResultFilter(entityTypeFactory, hpoAnnotator);
EntityType resultEntityType = entityTypeFactory.create("result");
resultEntityType.addAttribute(hpoAnnotator.getIdsAttr());
resultEntityType.addAttribute(hpoAnnotator.getTermsAttr());
EntityType entityType = entityTypeFactory.create("HPO");
entityType.addAttribute(attributeFactory.create().setName(HPO_DISEASE_ID_COL_NAME));
entityType.addAttribute(attributeFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME));
entityType.addAttribute(attributeFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID);
entityType.addAttribute(attributeFactory.create().setName(HPO_TERM_COL_NAME));
Entity e1 = new DynamicEntity(entityType);
e1.set(HPO_ID_COL_NAME, "id1");
e1.set(HPO_TERM_COL_NAME, "term1");
Entity e2 = new DynamicEntity(entityType);
e2.set(HPO_ID_COL_NAME, "id2");
e2.set(HPO_TERM_COL_NAME, "term2");
Optional<Entity> result = filter.filterResults(Arrays.asList(e1, e2), new DynamicEntity(resultEntityType), false);
assertTrue(result.isPresent());
assertEquals(result.get().getString(HPOAnnotator.HPO_IDS), "id1/id2");
assertEquals(result.get().getString(HPOAnnotator.HPO_TERMS), "term1/term2");
}
use of org.molgenis.data.support.DynamicEntity in project molgenis by molgenis.
the class GoNLAnnotatorTest method testAnnotate11.
@Test
public void testAnnotate11() {
Entity entity11 = new DynamicEntity(emd);
entity11.set(VcfAttributes.CHROM, "3");
entity11.set(VcfAttributes.POS, 53219680);
entity11.set(VcfAttributes.REF, "G");
entity11.set(VcfAttributes.ALT, "C");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity11));
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 GoNLAnnotatorTest method testAnnotate8.
@Test
public void testAnnotate8() {
Entity entity8 = new DynamicEntity(emd);
entity8.set(VcfAttributes.CHROM, "21");
entity8.set(VcfAttributes.POS, 46924425);
entity8.set(VcfAttributes.REF, "CGGCCCCCCA");
entity8.set(VcfAttributes.ALT, "C");
Iterator<Entity> results = annotator.annotate(Collections.singletonList(entity8));
assertTrue(results.hasNext());
Entity resultEntity = results.next();
assertFalse(results.hasNext());
assertNull(resultEntity.get(GONL_GENOME_AF));
assertNull(resultEntity.get(GONL_GENOME_GTC));
}
Aggregations