Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple allele separated by semicolon in ALT field #33

Open
marbeno opened this issue Nov 17, 2021 · 0 comments
Open

multiple allele separated by semicolon in ALT field #33

marbeno opened this issue Nov 17, 2021 · 0 comments

Comments

@marbeno
Copy link

marbeno commented Nov 17, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant