Comments (15)
Could you share the input bins with me here in a zip file?
from superpang.
I'm sorry, but I can't share them. Is there any other information I can provide?
I tried running it with another set of bins (5 bins medium- to high-quality >95% ANI) and I have the same error.
from superpang.
Hm, I wonder what the problem may be. Does test-SuperPang.py
work for you?
Are these "standard" bacterial/archaeal genomes? something "strange" about them?
I have an idea of a couple of things that might be throwing that error, but it's hard to know what's really happening without being able to reproduce it myself (of course it is understandable if you can't share your data).
from superpang.
Let's test a thing
Edit the
/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py
In line 292 change
assert len(nvs_) == 2
for
if len(nvs_) != 2: print(nvs_); assert False
This will still die but will print some info about what's going wrong. You can share the output (a horrible bunch of numbers) with me.
EDIT: Fixed a typo in the code
from superpang.
I only obtained this output after the "Extracting forward component"
[0, 1, 2, 3]
I changed the order of the bins and SuperPang run until comp 246/718 and then it fails also after:
Extracting forward component
[0, 1, 2, 3]
Traceback (most recent call last):
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 291, in
main(parse_args())
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 144, in main
contigs = Assembler(input_minimap2, args.ksize, args.threads).run(args.minlen, args.mincov, args.bubble_identity_threshold, args.genome_assignment_threshold, args.threads)
File "/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py", line 322, in run
psets = get_psets(comp2nvs[nc1] | comp2nvs[nc2])
File "/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py", line 292, in get_psets
if len(nvs_) != 2: print(nvs_); assert False
AssertionError
This is how it look lines 291-293
for nvs_ in psets.values():
if len(nvs_) != 2: print(nvs_); assert False
return psets
from superpang.
Thanks for trying this. It seems like a different case of a bug I'd fixed before, but I would need more info
Can you now try changing the whole get_psets function to this one?
### Extract forward component
def get_psets(nvs):
"""Get a dict with a frozenset of vertices as keys, and the two complementary non-branching paths sharing those vertices as values"""
psets = defaultdict(list)
for nv in nvs:
pset = frozenset(vertex2NBP[nv])
psets[pset].append(nv)
for fs, nvs_ in psets.items():
if len(nvs_) != 2:
print('\nERROR!', len(nvs_), fs)
print()
for nv_ in nvs_:
print(nv_, vertex2NBP[nv_])
print('\nDONE\n')
assert len(nvs_) == 2
return psets
from superpang.
This is the output after modifiying Assembler.py
SuperPang_error_cifuj_20220407.txt
from superpang.
Thanks! This gives me something to work with... I'll come back to you if I need some extra stuff
from superpang.
Ok, try replacing the function with this
### Extract forward component
def get_psets(nvs):
"""Get a dict with a frozenset of vertices as keys, and the two complementary non-branching paths sharing those vertices as values"""
psets = defaultdict(list)
for nv in nvs:
pset = frozenset(vertex2NBP[nv])
psets[pset].append(nv)
for ps, nvs_ in psets.items():
if len(nvs_) > 2: # If more than two NBPs share the same pset, select the first two that are RC of each other
for nv1, nv2 in combinations(nvs_): # this is a temporary patch, I should look into why this happens when I get a proper example
NBP1, NBP2 = vertex2NBP[nv1], vertex2NBP[nv2]
if NBP1 == NBP2[::-1]:
psets[ps] = [nv1, nv2]
break
else:
assert False # if there is no RC pair, die anyways
for nvs_ in psets.values():
assert len(nvs_) == 2
return psets
Hopefully this'll work
from superpang.
I obtained the following error.
Traceback (most recent call last):
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 291, in
main(parse_args())
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 144, in main
contigs = Assembler(input_minimap2, args.ksize, args.threads).run(args.minlen, args.mincov, args.bubble_identity_threshold, args.genome_assignment_threshold, args.threads)
File "/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py", line 331, in run
psets = get_psets(comp2nvs[nc1] | comp2nvs[nc2])
File "/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py", line 293, in get_psets
for nv1, nv2 in combinations(nvs_): # this is a temporary patch, I should look into why this happens when I get a proper example
TypeError: combinations() missing required argument 'r' (pos 2)
I tried with 2 different set of bins from 2 different species and I obtained the same error after a different number of "Working on comp XX/YY"
from superpang.
My fault, was missing an argument
### Extract forward component
def get_psets(nvs):
"""Get a dict with a frozenset of vertices as keys, and the two complementary non-branching paths sharing those vertices as values"""
psets = defaultdict(list)
for nv in nvs:
pset = frozenset(vertex2NBP[nv])
psets[pset].append(nv)
for ps, nvs_ in psets.items():
if len(nvs_) > 2: # If more than two NBPs share the same pset, select the first two that are RC of each other
for nv1, nv2 in combinations(nvs_, 2): # this is a temporary patch, I should look into why this happens when I get a proper example
NBP1, NBP2 = vertex2NBP[nv1], vertex2NBP[nv2]
if NBP1 == NBP2[::-1]:
psets[ps] = [nv1, nv2]
break
else:
assert False # if there is no RC pair, die anyways
for nvs_ in psets.values():
assert len(nvs_) == 2
return psets
from superpang.
Now I have a different error in the function #Find reverse complement Non-Branching Paths
Traceback (most recent call last):
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 291, in
main(parse_args())
File "/home/jcifuentes/miniconda3/envs/SuperPang/bin/SuperPang.py", line 144, in main
contigs = Assembler(input_minimap2, args.ksize, args.threads).run(args.minlen, args.mincov, args.bubble_identity_threshold, args.genome_assignment_threshold, args.threads)
File "/home/jcifuentes/miniconda3/envs/SuperPang/lib/python3.8/site-packages/SuperPang/lib/Assembler.py", line 332, in run
assert len(psets) == len(comp2nvs[nc1]) == len(comp2nvs[nc1]) # each sequence path should have a reverse complement equivalent (same vertices in the kmer graph, reverse order)
AssertionError
from superpang.
Hi again!
I managed to reproduce the issue with data from another user. Version 0.9.4beta1 (available in conda) has a temptative fix for this problem. Let me know if it works for you!
from superpang.
Thank you very much!
It works with the 2 datasets I had problems before.
from superpang.
Glad to hear. Thanks for testing it!
from superpang.
Related Issues (15)
- IndexError: list index out of range HOT 2
- There was an error running homogenize.py HOT 12
- There was an error running homogenize.py HOT 13
- ValueError: invalid vertex: 3; condense-edges.py error. HOT 3
- assert len(kmers) == 2 AssertionError HOT 5
- input genome position information HOT 2
- NBP2origins.tsv and graph.NBP2origins.csv contain corrupted SourceContig names HOT 2
- Read checkm file at the begining even if not yet needed
- multiple file paths for `--fasta` HOT 1
- IndexError: list index out of range HOT 8
- the pangeome size is larger than all size of input genomes HOT 7
- How to improve the mOTUpan core-genome estimation for viruses species? HOT 4
- mOTUpan HOT 4
- errors when running the test-SuperPang.py HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superpang.