Skip to content

Commit

Permalink
Update generate_network.py
Browse files Browse the repository at this point in the history
Corrects issue where non-high scoring ORF is attempted to be added to gene graph.
  • Loading branch information
samhorsfield96 authored Apr 24, 2024
1 parent a59b553 commit fafcc78
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions panaroo_runner/generate_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ def generate_network(DBG, overlap, high_scoring_ORFs, high_scoring_ORF_edges, cl
for neighbour in edge_set:
pan_neigbour_id = str(genome_id) + "_0_" + str(neighbour)

neighbour_cluster = seq_to_cluster[pan_neigbour_id]
# ensure neighbour is high scoring ORF, otherwise ignore
if pan_neigbour_id in seq_to_cluster:
neighbour_cluster = seq_to_cluster[pan_neigbour_id]
else:
continue

# add edge between current ORF and neighbour
if G.has_edge(node, neighbour_cluster):
Expand All @@ -216,4 +220,4 @@ def generate_network(DBG, overlap, high_scoring_ORFs, high_scoring_ORF_edges, cl
G.nodes[node]['hasEnd'] = True
break

return G, centroid_context
return G, centroid_context

0 comments on commit fafcc78

Please sign in to comment.