diff --git a/unitig_caller/bifrost.py b/unitig_caller/bifrost.py index 7264c49..7d48445 100644 --- a/unitig_caller/bifrost.py +++ b/unitig_caller/bifrost.py @@ -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. @@ -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")