Skip to content
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

error in breadth_and_depth_output function from metapop_filter.py #26

Open
beacamara opened this issue Jun 1, 2023 · 1 comment
Open

Comments

@beacamara
Copy link

Hi everyone,

I have run metapop y I obtained this error:

#######################################################
Getting breadth and depth of coverage for: TS_sept_cat.fa starting at: 01/06/2023 10:02:16
Filtering by genome for: TS_sept_cat.fa starting at: 01/06/2023 10:02:16
Completed preprocessing for: TS_sept_cat.fa at: 01/06/2023 10:02:16
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/site-packages/metapop/metapop_filter.py", line 292, in parse_reads
breadth_and_depth_output(current_depths, contig_length_dict[contig], contig, truncation, breadth_and_depth_fh)
UnboundLocalError: local variable 'contig' referenced before assignment
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/emm4/anaconda3/envs/metapop/bin/metapop", line 8, in
sys.exit(main())
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/site-packages/metapop/metapop_main.py", line 297, in main
metapop.metapop_filter.filt(original_bams, filter_command_base, bdb, threads, mag_contig_dict, mag_length_dict, joined_fastas)
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/site-packages/metapop/metapop_filter.py", line 167, in filt
p.map(parse_reads, commands)
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/emm4/anaconda3/envs/metapop/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
UnboundLocalError: local variable 'contig' referenced before assignment

#############################################

I have realized that the function breadth_and_depth_output in metapop_filter.py script (line 292) is calling for the "contig" argument outside the for loop where this parameter is defined. Enclosed you will find a screenshot
Captura de pantalla de 2023-06-01 11-45-41

Maybe removing line 292

@bayknight
Copy link

HI @beacamara , Im getting the same issue with the test data. Were you able to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants