sigven / vcf2tsvpy

Genomic VCF to tab-separated values
MIT License
46 stars 13 forks source link

The script returns '-2147483648' in the TSV file if any value is a period ('.') in the Sample ID column of the VCF file. #2

Closed razshaikh closed 2 years ago

razshaikh commented 2 years ago

Input VCF File values

Screenshot from 2022-01-11 12-43-49

Output TSV File values

Screenshot from 2022-01-11 12-46-12

sigven commented 2 years ago

Thanks @razshaikh for letting me know about this error! Could you share your VCF with me, so I can test and make sure that it can be fixed? It might be related to the underlying library (cyvcf), but I will check and see if I can fix it.

best, Sigve

razshaikh commented 2 years ago

Hi @sigven, thank you for your response, Really appreciated. Please find the sample VCF below: test_sample_run.zip

razshaikh commented 2 years ago

Hi @sigven, any suggestions on how to solve this issue.

Thanks and Regards, Razin

sigven commented 2 years ago

Hi @razshaikh, I am working on it, sorry for the delayed response.

razshaikh commented 2 years ago

Hi @sigven, I understand you must be having other tasks on your hand. I really appreciated you looking into it. Thank you. Best Wishes, Razin

sigven commented 2 years ago

Hi again @razshaikh,

Been digging a bit, and it seems this matter is related to how cyvcf2 works. See this related issue, for instance.

Either way, I have now added a simple check for this in vcf2tsv (v0.3.6), which should fix the error you encountered. On another note, your test VCF was full of other strange formatting errors, so I had to change it quite a bit for a test run.

kind regards, Sigve

razshaikh commented 2 years ago

Hi @sigven, Hope you are doing well.

Thank you for the update. I checked it, and it works for the 'GQ' values, but other values still has the same issue.

For example: the values in AD column, if any value is missing and has a period('.') instead, the latest script still replaces it with '-2147483648'.

Let me know if you have any suggestions for it.

Thanks and regards, Razin

razshaikh commented 2 years ago

Hi @sigven

I have added a pull request, let me know if that makes sense.

Best wishes, Razin