Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrects printing issue when unitig generated with no colours #29

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions unitig_caller/bifrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ def rtab_format(unitig_map, input_colour_pref, outfile):
"""
with open(outfile, "w") as o:
o.write("Unitig_sequence")
for index, colour_name in enumerate(input_colour_pref):
for colour_name in input_colour_pref:
o.write("\t" + colour_name)
if index == len(input_colour_pref) - 1:
o.write("\n")
o.write("\n")
for unitig, colours_vector in unitig_map.items():
o.write(unitig)
for index, colour in enumerate(colours_vector):
for colour in colours_vector:
colour = int(colour == True)
o.write("\t" + str(colour))
if index == len(colours_vector) - 1:
o.write("\n")
o.write("\n")

def pyseer_format(unitig_map, input_colour_pref, outfile):
"""Creates pyseer file.
Expand All @@ -50,5 +48,4 @@ def pyseer_format(unitig_map, input_colour_pref, outfile):
for index, colour in enumerate(colours_vector):
if colour:
o.write(" " + input_colour_pref[index] + ":1")
if index == len(colours_vector) - 1:
o.write("\n")
o.write("\n")