Skip to content

multiple allele separated by semicolon in ALT field #33

@matbreno

Description

@matbreno

Multiple alleles are separated by a ";" insted of "," when VCF.Record is used

The vcf looks like this:

$ tail -2 test_single.vcf
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	SAMPLE
20	259054	.	CTG	CTC,C	2862	.	.	GT	0/1

If I do not use VCF.Record, the result is correct:

reader=VCF.Reader(open("test_single.vcf","r"));
fl=read(reader);
writer = open(VCF.Writer, "out1.vcf",VCF.header(reader));
write(writer,fl)
close(writer)

Gives:

tail -2 out1.vcf
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	SAMPLE
20	259054	.	CTG	CTC,C	2862	.	.	GT	0/1

If I use VCF.Record:

writer = open(VCF.Writer, "out2.vcf",VCF.header(reader));
write(writer,VCF.Record(fl))
close(writer)

Results in:

#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	SAMPLE
20	259054	.	CTG	CTC;C	2862	.	.	GT	0/1

Notice that CTC and C in ALT are separated by a ";".

I think the problem might be this:

for (i, x) in enumerate(alt)
if i != 1
print(buf, ';')
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions