Open is01 opened 1 week ago
It appears that the error can be avoided by simply commenting out the Exception and the graph construction completed.
src/breakpoint_graph.py
def add_discordant_edge(self, chr1, pos1, o1, chr2, pos2, o2, sr_count = -1, sr_flag = 'd', \
sr_cn = 0.0, lr_count = -1, reads = set([]), cn = 0.0):
"""
Add a discordant edge to the graph.
"""
if (chr1, pos1, o1) not in self.nodes or (chr2, pos2, o2) not in self.nodes:
logging.debug("#TIME " + '%.4f\t' %(time.time() - global_names.TSTART) + "### Exception Breakpoint node must be added first. Continue::" + str(chr1) + ":" + str(pos1) + " " + str(o1) + " " + str(chr2) + ":" + str(pos2) + " " + str(o2) )
#raise Exception("Breakpoint node must be added first.")
else:
ld = len(self.discordant_edges)
self.nodes[(chr1, pos1, o1)][2].append(ld)
self.nodes[(chr2, pos2, o2)][2].append(ld)
if (chr1, pos1, o1) in self.endnodes:
self.endnodes[(chr1, pos1, o1)].append(ld)
if (chr2, pos2, o2) in self.endnodes:
self.endnodes[(chr2, pos2, o2)].append(ld)
self.discordant_edges.append([chr1, pos1, o1, chr2, pos2, o2, sr_count, sr_flag, sr_cn, lr_count, reads, cn])
Hello, I am running reconstruct using Nanopore long read data and getting the following error: It works fine for most data, but I got the error with certain data.
Below is the script:
I noticed that in the
build_graph
function, there was a case where 2nd bp inself.new_bp_list
was included insplit_int
and the 1st bp was not included, and this seemed to be the cause of the error.It seems that the error can be avoided by changing the script as follows. However, I am worried that this may affect the analysis results. Is anyone else dealing with this kind of issue?
Here is edited code:
src/infer_breakpoint_graph.py.
Thanks