Search in sources :

Example 1 with VcfMeta

use of org.molgenis.vcf.meta.VcfMeta in project molgenis by molgenis.

the class VcfToEntityTest method testToEntityMissingValues.

// https://github.com/molgenis/molgenis/issues/5329
@Test
public void testToEntityMissingValues() throws IOException {
    String vcfHeaders = "##fileformat=VCFv4.1\n" + "##INFO=<ID=GoNL_AF,Number=.,Type=Float,Description=\"The allele frequency for variants seen in the population used for the GoNL project\">\n" + "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n";
    VcfMeta vcfMeta = parseHeaders(vcfHeaders);
    VcfToEntity vcfToEntity = new VcfToEntity("entityTypeName", vcfMeta, vcfAttrs, entityTypeFactory, attrMetaFactory);
    VcfRecord record = new VcfRecord(vcfMeta, new String[] { "1", "54728", ".", "G", "T,C", ".", ".", "GoNL_AF=0.01,." });
    Entity entity = vcfToEntity.toEntity(record);
    assertEquals(entity.getString("GoNL_AF"), "0.01,.");
}
Also used : DynamicEntity(org.molgenis.data.support.DynamicEntity) Entity(org.molgenis.data.Entity) VcfRecord(org.molgenis.vcf.VcfRecord) VcfMeta(org.molgenis.vcf.meta.VcfMeta) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Aggregations

AbstractMolgenisSpringTest (org.molgenis.data.AbstractMolgenisSpringTest)1 Entity (org.molgenis.data.Entity)1 DynamicEntity (org.molgenis.data.support.DynamicEntity)1 VcfRecord (org.molgenis.vcf.VcfRecord)1 VcfMeta (org.molgenis.vcf.meta.VcfMeta)1 Test (org.testng.annotations.Test)1