faircloth-lab / phyluce

software for UCE (and general) phylogenomics
http://phyluce.readthedocs.org/
Other
80 stars 49 forks source link

phyluce_snp_convert_vcf_to_structure invalid literal #223

Open heather340 opened 3 years ago

heather340 commented 3 years ago

I'm running into an issue with:

(phyluce) bash-4.2$ phyluce_snp_convert_vcf_to_structure --input filtered_unlinked.recode.vcf --output filtered_unlinked_structure.str Working.Traceback (most recent call last): File "/users/PAS1390/osu10232/miniconda3/envs/phyluce/bin/phyluce_snp_convert_vcf_to_structure", line 138, in main() File "/users/PAS1390/osu10232/miniconda3/envs/phyluce/bin/phyluce_snp_convert_vcf_to_structure", line 100, in main coded_gt = [int(i) for i in sample.data.GT.split("/")] ValueError: invalid literal for int() with base 10: '.'

Input was build with vcftools after running through the Erickson et al. SNP calling pipeline.

We think the issue is within my .vcf file, but I can't quite figure out the right combo of things to change within the FORMAT block:

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

FORMAT=

Any thoughts or a file to compare with would be very welcomed!!

brantfaircloth commented 3 years ago

Have you tried to make the conversion from vcf to structure using PLINK? Something like:

plink --vcf [vcf filename] --recode structure
heather340 commented 3 years ago

I had not, but I can keep testing it out to see if I can get it going. PGDSpider is always my fall back but a single line of code is always easier :)

I just heard back from someone who got phyluce_snp_convert_vcf_to_structure working by changing line 94 to:

if sample.data.GT == None or sample.data.GT == “./.“

I was able to reproduce it successfully, so we are good to go! Thanks for the quick response.

brantfaircloth commented 3 years ago

Nice - i'll integrate that fix to the code.

brantfaircloth commented 3 years ago

Leaving open for now as a reminder to fix.