JeanMainguy / MeTAfisher

Program to retrieve toxin antitoxin (TA) systems in metagenomes
MIT License
4 stars 1 forks source link

typeError: string indices must be integers, not 'str' #1

Closed MariaBalbuena closed 1 year ago

MariaBalbuena commented 1 year ago

Hi:

I have tried to run some sequences downloaded from NCBI RefSeq, but it produces the following prompt without giving me any result.

Reported 584 pairwise alignments, 584 HSPs. 76 queries aligned. Traceback (most recent call last): File "/home/ubuntu24/MeTAfisher/./metafisher/metafisher.py", line 309, in main() File "/home/ubuntu24/MeTAfisher/./metafisher/metafisher.py", line 260, in main for contig, genes in contig_to_genes: File "/home/ubuntu24/MeTAfisher/metafisher/Function_MetaF.py", line 501, in get_genes_by_contigs gene.add_domain_info(gene_to_domains[gene_id]) File "/home/ubuntu24/MeTAfisher/metafisher/Object_MetaF.py", line 138, in add_domain_info toxin_count = [d.domain_info['type_prct']['T'] for d in domains] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu24/MeTAfisher/metafisher/Object_MetaF.py", line 138, in toxin_count = [d.domain_info['type_prct']['T'] for d in domains]


TypeError: string indices must be integers, not 'str'

Best
Maria
JeanMainguy commented 1 year ago

Hello Maria,

Thanks for your interest in MeTAfisher.

The error seems to be caused by some slight change in some of the names of TADB sequences. I have updated the TADB stat file and improved the code to prevent the error. Can you retry with the updated version of the code and tell me if it works on your side? To update the code you can just do a git pull in your MeTAfisher code directory.

Best