CoBiG2 / RAD_Tools

A collection of usefull tools for RAD or GBS data analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vcf2treemix.py issue

DanielRamos12 opened this issue · comments

Dear Computational Biology & Population Genomics Group;

I'm working with RAD-seq data and I would like to transform my vcf files into treemix. I saw your python script vcf2treemix.py worked to other people pretty well and I would like to give it a try.
I look at the command line and I used it:

./vcf2treemix.py -vcf c_nem_rename_definitive.vcf.gz -pop c_nem_rename_definitive_a.txt

But, I've got the following errors:

Traceback (most recent call last):
File "./vcf2treemix.py", line 100, in
main()
File "./vcf2treemix.py", line 96, in main
pop_obj = get_pops(pop_file)
File "./vcf2treemix.py", line 35, in get_pops
pops[fields[0]] = fields[1].split()
IndexError: list index out of range

I guessed the issue is about the population file. May I ask which one is the format of it?

I tried:

  • Just a list of the groups
    -a column with its cluster for each individual
    -a file that consists in three columns including I: Family ID 2: ID; 3. cluster

Also the files format that I tried are .clust and .txt

I look in your github page to see if there are any specification of which format the files have to be.

I hope you can help me with it,

Best wishes,

Daniel

Hi @DanielRamos12
I did not develop vcf2treemix.py, but according to the docs in the file:

"""
Returns a dictionary with pop identifier as key and taxa as a list of
strings. In the pop file, each populations should be in one line, starting
withe pop name, a colon and the corresponding taxa separated by whitespace.
E.g.:
pop1: taxon1 taxon2 taxon3
"""

Your population file should look like this:

pop1: individual_A individual_B individual_C
pop2: individual_D individual_E individual_F

Can you please try that and let me know how it went?

Hi Francisco;

Thank you very much! It did work!!!

Have a lovely day!

Daniel

You're welcome!