-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run_genes.py global_args not defined. #144
Comments
From the error message, it seems like the global variable global_args is not shared by Pool object. I think this might be a python version issue. MIDAS has only been tested up to python 3.9. Can you try downgrade your python version? Thank you. |
Thanks for your fast reply. I am currently running python version 3.9.6 are you suggesting 3.9.0 or 3.8.19? |
3.9.6 should be okay. From the error message, there might be two versions of python in your environment: |
Okay so I have uninstalled and reinstalled and ensured that the correct python env 3.9.6 is working and used to execute midas, but am still getting the same issue with the "multiprocessing_map" step. Please see below: The above exception was the direct cause of the following exception: Traceback (most recent call last): Thanks again for helping resolve this! |
Hi, Thanks for testing out the python version. I am also new to this bug, and I am share some of my ideas to debug this error. Under the hood, I used a global variable for a read-only variable global_args, to avoid pickling global_args when using multiprocess, which in our experiences can be time consuming. From the error message, it seems like this mechanism doesn't work in your case. To test out this idea, can you add print(global_args) after Line 300. Then Secondly, MIDAS has only been tested in Linux system. Have you tried the unit test Thanks, |
Still no luck. Attached is the same error. I think I might try the docker. I did use the run_species and that did work so not sure why this error is only seen in the run_genes.py? 1725373643.4: MIDAS2::multiprocessing_map::start The above exception was the direct cause of the following exception: Traceback (most recent call last): |
Hmm have you tried the unit test and does it pass? => |
If the unit test pass, then it might be related to either the reads or the database. I would also |
Yes. It seems to work. (Midas3) kris_mega_beast@KristopacStudio MIDAS-3 % bash tests/test_analysis.sh 8
|
There seems to be a xargs error message ? Did you see |
Oh no I did not get the Success command. |
One more question: are you testing MIDAS on a linux machine? I don't think it would work on a OS-system, I never tested it. |
I am on an OS system with Apple Silicon M2 Chip. |
That makes sense. I just updated the MIDAS version in the Dockerfile due to a recent fix and you might need to build it. |
Hi I am testing Metagenomic Intra-Species Diversity Analysis System (MIDAS), Version 3.0.1.
I am following the run_genes step but keep running into an error during the MIDAS2::multiprocessing_map::start step which gives the error: "NameError: name 'global_args' is not defined"
I don't see the option or flag to define the global_args?
Thanks in advance!
1724583425.9: MIDAS2::multiprocessing_map::start
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/opt/homebrew/anaconda3/lib/python3.12/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/subcommands/run_genes.py", line 306, in compute_pileup_per_chunk
if global_args.debug and os.path.exists(headerless_sliced_path):
^^^^^^^^^^^
NameError: name 'global_args' is not defined
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/homebrew/anaconda3/bin/midas", line 8, in
sys.exit(main())
^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/main.py", line 25, in main
return subcommand_main(subcommand_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/subcommands/run_genes.py", line 563, in main
run_genes(args)
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/subcommands/run_genes.py", line 557, in run_genes
raise error
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/subcommands/run_genes.py", line 530, in run_genes
list_of_chunks_depth = multiprocessing_map(compute_pileup_per_chunk, args_list, number_of_chunks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/common/utils.py", line 532, in multiprocessing_map
return _multi_map(func, items, num_procs, multiprocessing.Pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/site-packages/midas/common/utils.py", line 520, in _multi_map
return p.map(func, items, chunksize=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/lib/python3.12/multiprocessing/pool.py", line 774, in get
raise self._value
NameError: name 'global_args' is not defined
Full Command and Error attatched.
MIDAS3_run_gene_error.txt
The text was updated successfully, but these errors were encountered: