@Test void testToEntity() throws IOException { VcfRecord record = new VcfRecord( vcfMetaSmall, new String[] {"10", "12345", "id3", "A", "C", "7.9123", "pass", "DF;;CHAR=-"}); Entity entity = vcfToEntitySmall.toEntity(record); Entity expected = new DynamicEntity(vcfToEntitySmall.getEntityType()); expected.set("#CHROM", "10"); expected.set("ALT", "C"); expected.set("POS", 12345); expected.set("REF", "A"); expected.set("FILTER", "pass"); expected.set("QUAL", "7.9123"); expected.set("ID", "id3"); expected.set("INTERNAL_ID", entity.get("INTERNAL_ID")); expected.set("DF", true); expected.set("DF2", false); expected.set("CHAR", "-"); assertTrue(EntityUtils.equals(entity, expected)); }
public Entity toEntity(VcfRecord vcfRecord) { Entity entity = new DynamicEntity(entityType); entity.set(CHROM, vcfRecord.getChromosome()); entity.set( ALT, StringUtils.join(Lists.transform(vcfRecord.getAlternateAlleles(), Allele::toString), ',')); entity.set(POS, vcfRecord.getPosition()); entity.set(REF, vcfRecord.getReferenceAllele().toString()); entity.set(FILTER, vcfRecord.getFilterStatus()); entity.set(QUAL, vcfRecord.getQuality()); entity.set(ID, StringUtils.join(vcfRecord.getIdentifiers(), ',')); String id = VcfUtils.createId(entity); entity.set(INTERNAL_ID, id); writeInfoFieldsToEntity(vcfRecord, entity); if (sampleEntityType != null) { List<Entity> samples = createSampleEntities(vcfRecord, entity.get(POS) + "_" + entity.get(ALT), id); entity.set(SAMPLES, samples); } return entity; }
VcfToEntity { public Entity toEntity(VcfRecord vcfRecord) { Entity entity = new DynamicEntity(entityType); entity.set(CHROM, vcfRecord.getChromosome()); entity.set( ALT, StringUtils.join(Lists.transform(vcfRecord.getAlternateAlleles(), Allele::toString), ',')); entity.set(POS, vcfRecord.getPosition()); entity.set(REF, vcfRecord.getReferenceAllele().toString()); entity.set(FILTER, vcfRecord.getFilterStatus()); entity.set(QUAL, vcfRecord.getQuality()); entity.set(ID, StringUtils.join(vcfRecord.getIdentifiers(), ',')); String id = VcfUtils.createId(entity); entity.set(INTERNAL_ID, id); writeInfoFieldsToEntity(vcfRecord, entity); if (sampleEntityType != null) { List<Entity> samples = createSampleEntities(vcfRecord, entity.get(POS) + "_" + entity.get(ALT), id); entity.set(SAMPLES, samples); } return entity; } }
VcfToEntity { public Entity toEntity(VcfRecord vcfRecord) { Entity entity = new DynamicEntity(entityType); entity.set(CHROM, vcfRecord.getChromosome()); entity.set( ALT, StringUtils.join(Lists.transform(vcfRecord.getAlternateAlleles(), Allele::toString), ',')); entity.set(POS, vcfRecord.getPosition()); entity.set(REF, vcfRecord.getReferenceAllele().toString()); entity.set(FILTER, vcfRecord.getFilterStatus()); entity.set(QUAL, vcfRecord.getQuality()); entity.set(ID, StringUtils.join(vcfRecord.getIdentifiers(), ',')); String id = VcfUtils.createId(entity); entity.set(INTERNAL_ID, id); writeInfoFieldsToEntity(vcfRecord, entity); if (sampleEntityType != null) { List<Entity> samples = createSampleEntities(vcfRecord, entity.get(POS) + "_" + entity.get(ALT), id); entity.set(SAMPLES, samples); } return entity; } VcfToEntity(
      String entityTypeId,
      VcfMeta vcfMeta,
      VcfAttributes vcfAttributes,
      EntityTypeFactory entityTypeFactory,
      AttributeFactory attrMetaFactory); }
VcfToEntity { public Entity toEntity(VcfRecord vcfRecord) { Entity entity = new DynamicEntity(entityType); entity.set(CHROM, vcfRecord.getChromosome()); entity.set( ALT, StringUtils.join(Lists.transform(vcfRecord.getAlternateAlleles(), Allele::toString), ',')); entity.set(POS, vcfRecord.getPosition()); entity.set(REF, vcfRecord.getReferenceAllele().toString()); entity.set(FILTER, vcfRecord.getFilterStatus()); entity.set(QUAL, vcfRecord.getQuality()); entity.set(ID, StringUtils.join(vcfRecord.getIdentifiers(), ',')); String id = VcfUtils.createId(entity); entity.set(INTERNAL_ID, id); writeInfoFieldsToEntity(vcfRecord, entity); if (sampleEntityType != null) { List<Entity> samples = createSampleEntities(vcfRecord, entity.get(POS) + "_" + entity.get(ALT), id); entity.set(SAMPLES, samples); } return entity; } VcfToEntity(
      String entityTypeId,
      VcfMeta vcfMeta,
      VcfAttributes vcfAttributes,
      EntityTypeFactory entityTypeFactory,
      AttributeFactory attrMetaFactory); Entity toEntity(VcfRecord vcfRecord); EntityType getEntityType(); }
VcfToEntity { public Entity toEntity(VcfRecord vcfRecord) { Entity entity = new DynamicEntity(entityType); entity.set(CHROM, vcfRecord.getChromosome()); entity.set( ALT, StringUtils.join(Lists.transform(vcfRecord.getAlternateAlleles(), Allele::toString), ',')); entity.set(POS, vcfRecord.getPosition()); entity.set(REF, vcfRecord.getReferenceAllele().toString()); entity.set(FILTER, vcfRecord.getFilterStatus()); entity.set(QUAL, vcfRecord.getQuality()); entity.set(ID, StringUtils.join(vcfRecord.getIdentifiers(), ',')); String id = VcfUtils.createId(entity); entity.set(INTERNAL_ID, id); writeInfoFieldsToEntity(vcfRecord, entity); if (sampleEntityType != null) { List<Entity> samples = createSampleEntities(vcfRecord, entity.get(POS) + "_" + entity.get(ALT), id); entity.set(SAMPLES, samples); } return entity; } VcfToEntity(
      String entityTypeId,
      VcfMeta vcfMeta,
      VcfAttributes vcfAttributes,
      EntityTypeFactory entityTypeFactory,
      AttributeFactory attrMetaFactory); Entity toEntity(VcfRecord vcfRecord); EntityType getEntityType();  }