edgardomortiz / vcf2phylip

Convert SNPs in VCF format to PHYLIP, NEXUS, binary NEXUS, or FASTA alignments for phylogenetic analysis
GNU General Public License v3.0
295 stars 86 forks source link

error in binary nexus #1

Closed PRASADLIFE closed 6 years ago

PRASADLIFE commented 6 years ago

To convert the vcf into binary nexus it throw the error:-

Traceback (most recent call last): File "vcf2phylip.py", line 384, in main() File "vcf2phylip.py", line 224, in main binsite_tmp = ''.join([(gen_bin[broken[i][0:3]]) for i in range(9, index_last_sample)]) KeyError: '1|1'

edgardomortiz commented 6 years ago

I will need more info, what was your command? how did you generate your vcf? could you send the first. 5000 lines of your vcf to replicate the error?

PRASADLIFE commented 6 years ago

This is my command to get the binary nexus format.

python vcf2phylip.py -i 9983.vcf --phylip-disable -n --nexus-binary

I successfully converted the vcf to nexus but to convert into binary nexus it through the error. I attached the sample file. first_5000.vcf.gz

edgardomortiz commented 6 years ago

Thanks for reporting the bug, please test and if it works I will mark it as solved.

PRASADLIFE commented 6 years ago

Yes, now it's running. Thank You very much for the quick response.

edgardomortiz commented 6 years ago

Cool, no problem.