PyPHLAWD icon indicating copy to clipboard operation
PyPHLAWD copied to clipboard

index of `change_id_to_name_fasta.py` out of range

Open Cactusolo opened this issue 5 years ago • 2 comments

Hi I think the line 14 in change_id_to_name_fasta.py has to be: idn[spls[0]] = spls[1] rather than: idn[spls[3]] = spls[4]

Since the tutorial said:

change_id_to_name_fasta.py This will allow you to change names in a user input fasta file with a list of given names. The input is a tab delimited file containing the current names in the first column and the names to be replaced with in the second. python change_id_to_name_fasta.py Table.tsv InputFasta.fa OutputFile

That means the table should only has two columns: old name spls[0] and new name to replace spls[1]

Pardon me if I misinterpret it :0

Miao

Cactusolo avatar May 02 '19 20:05 Cactusolo

Hm, that may be the case but do you have an example that I can check?.

blackrim avatar Feb 12 '20 18:02 blackrim

I think this is fine. The (tsv) table in question is that produced by setup_clade.py (with a name like TAXON_NCBIID.table), and has 7 columns. The columns spls[3] and spls[4] represent the sequence ID and species common name, respectively.

The related file, change_ncbi_to_name_fasta.py, uses different columns from the same table; it converts from the NCBI species ID (spls[1]) to the common name.

josephwb avatar Mar 11 '20 19:03 josephwb