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

The equal sign is not escaped in output #171

Open
ericblanc20 opened this issue Feb 22, 2024 · 0 comments · May be fixed by #172
Open

The equal sign is not escaped in output #171

ericblanc20 opened this issue Feb 22, 2024 · 0 comments · May be fixed by #172

Comments

@ericblanc20
Copy link

  • vcfpy version: 0.13.6
  • Python version: 3.10.13
  • Operating System: Rocky Linux 8.7 (Green Obsidian), Linux 4.18.0-348.2.1.el8_5.x86_64

Description

Escaping the equal sign = in INFO fields is lost on writing.

What I Did

$ grep 86112567 input.vcf
chr1	86112567	.	C	T	.	PASS	AS_FilterStatus=SITE;AS_SB_TABLE=167,122|3,3;DP=297;ECNT=1;GERMQ=93;MBQ=20,20;MFRL=163,180;MMQ=60,60;MPOS=17;NALOD=1.71;NLOD=15.05;POPAF=6;ROQ=33;TLOD=6.38;CSQ=T|splice_region_variant&synonymous_variant|LOW|COL24A1|ENSG00000171502|Transcript|ENST00000370571|protein_coding|5/60||ENST00000370571.7:c.1599G>A|ENSP00000359603.2:p.Lys533%3D|1975|1599|533|K|aaG/aaA|||-1||SNV|HGNC|HGNC:20821|YES|NM_152890.7|1|P1|CCDS41353.1|ENSP00000359603|Q17RW2.126||UPI000013E81F|Q17RW2-1||Ensembl||C|C|||||Low_complexity_(Seg):seg&PANTHER:PTHR24023&PANTHER:PTHR24023:SF977&Pfam:PF01391||||||||||||||||||||||||||||||;ACGTNacgtnPLUS=0,67,0,3,0,0,5,0,1,0;ACGTNacgtnMINUS=0,56,0,0,0,0,8,0,0,0	GT:AD:AF:DP:F1R2:F2R1:FAD:SB	0/0:88,0:0.019:88:22,0:27,0:50,0:47,41,0,0	0/1:201,6:0.035:207:68,4:63,0:135,4:120,81,3,3
$ python
>>> import vcfpy
>>> reader = vcfpy.Reader.from_path("input.vcf")
>>> writer = vcfpy.Writer.from_path("output.vcf", reader.header)
>>> for record in reader:
...     writer.write_record(record)
... 
>>> 
$ grep 86112567 output.vcf
chr1	86112567	.	C	T	.	PASS	AS_FilterStatus=SITE;AS_SB_TABLE=167%2C122|3%2C3;DP=297;ECNT=1;GERMQ=93;MBQ=20,20;MFRL=163,180;MMQ=60,60;MPOS=17;NALOD=1.71;NLOD=15.05;POPAF=6.0;ROQ=33.0;TLOD=6.38;CSQ=T|splice_region_variant&synonymous_variant|LOW|COL24A1|ENSG00000171502|Transcript|ENST00000370571|protein_coding|5/60||ENST00000370571.7:c.1599G>A|ENSP00000359603.2:p.Lys533=|1975|1599|533|K|aaG/aaA|||-1||SNV|HGNC|HGNC:20821|YES|NM_152890.7|1|P1|CCDS41353.1|ENSP00000359603|Q17RW2.126||UPI000013E81F|Q17RW2-1||Ensembl||C|C|||||Low_complexity_(Seg):seg&PANTHER:PTHR24023&PANTHER:PTHR24023:SF977&Pfam:PF01391||||||||||||||||||||||||||||||;ACGTNacgtnPLUS=0,67,0,3,0,0,5,0,1,0;ACGTNacgtnMINUS=0,56,0,0,0,0,8,0,0,0	GT:AD:AF:DP:F1R2:F2R1:FAD:SB	0/0:88,0:0.019:88:22,0:27,0:50,0:47,41,0,0	0/1:201,6:0.035:207:68,4:63,0:135,4:120,81,3,3

The escaped equal sign in the input file (...p.Lys%3D|...) is lost in the output file (...p.Lys533=|...).

(The commas , that are present in the input file are correctly escaped on output)

@ericblanc20 ericblanc20 linked a pull request Feb 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant