phac-nml / mob-suite

MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
Apache License 2.0
125 stars 33 forks source link

ERROR: Mob_typer return code 1 #59

Closed eam12 closed 4 years ago

eam12 commented 4 years ago

Hello!

I'm running mob_recon on a Salmonella incomplete assembly:

mob_recon --infile ~/suganda_data/assemblies/contigs/SRR1556083_contigs_renamed.fasta --outdir ~/suganda_data/mob_suite/test -d /home/johnsont/public/mob_suite_dbs --run_typer

Without the --run_typer flag, everything seems to run perfectly. With the --run_typer flag, I receive the following error:

Traceback (most recent call last):

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4410, in get_value

return libindex.get_value_at(s, key)

File "pandas/_libs/index.pyx", line 44, in pandas._libs.index.get_value_at

File "pandas/_libs/index.pyx", line 45, in pandas._libs.index.get_value_at

File "pandas/_libs/util.pxd", line 98, in pandas._libs.util.get_value_at

File "pandas/_libs/util.pxd", line 83, in pandas._libs.util.validate_indexer

TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/panfs/roc/groups/1/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_typer.py", line 513, in

main()

File "/panfs/roc/groups/1/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_typer.py", line 373, in main

input_seq = args.infile )

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_host_range.py", line 89, in getLiteratureBasedHostRange

repliconsearchdict = findHitsInLiteratureDBbyReplicon(replicon_names,plasmid_lit_db)

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_host_range.py", line 59, in findHitsInLiteratureDBbyReplicon

db_hit_indices=[i for i in range(0, plasmid_lit_db.shape[0]) if plasmid_lit_db.iloc[i, :]["Replicon"] == replicon_name]

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_host_range.py", line 59, in

db_hit_indices=[i for i in range(0, plasmid_lit_db.shape[0]) if plasmid_lit_db.iloc[i, :]["Replicon"] == replicon_name]

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/pandas/core/series.py", line 871, in getitem

result = self.index.get_value(self, key)

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4418, in get_value

raise e1

File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4404, in get_value

return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None))

File "pandas/_libs/index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value

File "pandas/_libs/index.pyx", line 90, in pandas._libs.index.IndexEngine.get_value

File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc

File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item

File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item

KeyError: 'Replicon'

2020-05-28 13:37:13,910 ERROR: Mob_typer return code 1 [in /home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_recon.py:193] Traceback (most recent call last): File "/home/johnsont/millere/.conda/envs/mob_suit/bin/mob_recon", line 10, in sys.exit(main()) File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_recon.py", line 835, in main database_dir=database_dir)) File "/home/johnsont/millere/.conda/envs/mob_suit/lib/python3.7/site-packages/mob_suite/mob_recon.py", line 194, in run_mob_typer raise Exception("MOB_typer could not type {}".format(plasmid_file_abs_path)) Exception: MOB_typer could not type /home/johnsont/millere/suganda_data/mob_suite/test/plasmid_653.fasta

I'm not sure what the issue is, but I'm wondering if it has something to do with my version of python? The anaconda version that I originally tried to use could not solve the MOB-suite conda environment (python3/3.7.1_anaconda) so I installed python version 3.7.6 in my MOB-suite env first and then the conda package:

# load python3/3.7.1_anaconda
module load python3 

# create MOB-suite env
conda create --name mob_suit
source activate mob_suit
conda install python==3.7.6
conda install -c bioconda mob_suite

Any suggestions would be very much appreciated!

Many thanks! Liz

jrober84 commented 4 years ago

Hello,

I recommend updating to MOB-suite v. 3.0.0. That issue isn't reproducible with me in a test environment on my computer using some test data. So it could be specific to your input data or environment. MOB-suite v. 3 is a major rewrite of the software and part of that is better error propagation. So I highly recommend switching and trying again. Could you let me know if the error persists in the new version? If so, it would be great to have the input file that you are using.

Cheers,

James

eam12 commented 4 years ago

My apologies. I totally missed that the default conda package wasn't version 3.0.0. I've now updated MOB-suite to v.3.0.0 and it's working perfectly!

Thank you so much for your help and prompt reply! Liz