Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import sys
import os
from functions import write_gfa, bfs
from Graph import Graph
if len(sys.argv) < 5:
print("You need to give 4 arguments, [input_gfa] [size_of_neighborhood] "
"[output_file] [one or several starting points]")
sys.exit(0)
if os.path.isfile(sys.argv[1]):
print("reading file...\n")
new_graph = Graph()
new_graph.read_gfa(sys.argv[1])
starting_points = []
output_g = []
for arg in sys.argv[4:]:
starting_points.append(int(arg))
for start in starting_points:
path = bfs(new_graph.nodes, start, int(sys.argv[2]))
output_g += path
write_gfa(nodes=new_graph.nodes, list_of_nodes=output_g, output_file=sys.argv[3])
else:
print("The file doesn't exist")
sys.exit()