use of org.molgenis.genotype.Allele in project molgenis by molgenis.
the class VcfToEntity method toEntity.
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;
}
Aggregations