Skip to content

Commit

Permalink
Merge pull request #29 from bacpop/issue_27
Browse files Browse the repository at this point in the history
Update generate_network.py
  • Loading branch information
samhorsfield96 authored May 21, 2024
2 parents a59b553 + fafcc78 commit ab252d6
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 ab252d6

Please sign in to comment.