arpcard / rgi

Resistance Gene Identifier (RGI). Software to predict resistomes from protein or nucleotide data, including metagenomics data, based on homology and SNP models.
Other
314 stars 75 forks source link

Error when running rgi main #269

Open gabridinosauro opened 4 months ago

gabridinosauro commented 4 months ago

Describe the bug When I try running rgi main I get the following error

Input rgi main -i bin.218.strict.fa -o reesistance/try_rgi.txt

Error log Traceback (most recent call last): File "", line 1, in File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 125, in _main prepare(preparation_data) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/gabri/mambaforge/envs/rg-new1/bin/rgi", line 4, in MainBase() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 83, in init getattr(self, args.command)() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 88, in main self.main_run(args) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 128, in main_run rgi_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 255, in run self.filter_process() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 387, in filter_process filter_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 174, in run self.process_xml_file() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 102, in process_xml_file model_thread.start() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init super().init(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init self._launch(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Traceback (most recent call last): File "", line 1, in File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 125, in _main prepare(preparation_data) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/gabri/mambaforge/envs/rg-new1/bin/rgi", line 4, in MainBase() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 83, in init getattr(self, args.command)() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 88, in main self.main_run(args) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 128, in main_run rgi_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 255, in run self.filter_process() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 387, in filter_process filter_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 174, in run self.process_xml_file() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 102, in process_xml_file model_thread.start() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init super().init(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init self._launch(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Traceback (most recent call last): File "", line 1, in File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 125, in _main prepare(preparation_data) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/gabri/mambaforge/envs/rg-new1/bin/rgi", line 4, in MainBase() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 83, in init getattr(self, args.command)() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 88, in main self.main_run(args) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/MainBase.py", line 128, in main_run rgi_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 255, in run self.filter_process() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/RGI.py", line 387, in filter_process filter_obj.run() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 174, in run self.process_xml_file() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/site-packages/app/Filter.py", line 102, in process_xml_file model_thread.start() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init super().init(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init self._launch(process_obj) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/Users/gabri/mambaforge/envs/rg-new1/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

CARD Version I just installed it with the automatic

RGI version 6.0.2 but I get the same error with 6.0.3

Desktop (please complete the following information):

Additional context I just installed it following the instructions here on github

raphaelobinna commented 2 months ago

Running the command prints the above error and it outputs an xml file in my root directory, not in the specified output path. So I always just check there.

jpeasari commented 1 month ago

Error when running rgi heatmap Command: rgi heatmap --input CM20_S1_L001/ --output CM20_S1_L001 -cat gene_family -clus samples Error: Traceback (most recent call last): File "/home/jpeasar/Anaconda03/envs/rgi/bin/rgi", line 4, in MainBase() File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/app/MainBase.py", line 83, in init getattr(self, args.command)() File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/app/MainBase.py", line 346, in heatmap self.heatmap_run(args) File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/app/MainBase.py", line 365, in heatmap_run obj.run() File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/app/Heatmap.py", line 442, in run df = self.create_categories(gene_family, df) File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/app/Heatmap.py", line 97, in create_categories df = df.append([df.loc[model]]*(len(class_dict[model])-1)) File "/home/jpeasar/Anaconda03/envs/rgi/lib/python3.8/site-packages/pandas/core/generic.py", line 5989, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'append'

bifidoman commented 2 weeks ago

Hi

RGI depends on Python 3.6, so check your python version. Easiest way is to create an environment with python 3.6 ( mamba create -n rgi python=3.6). Then it should work best

marc