INNER CODE UNIT · Python
write_output
cbg-ethz/V-pipe · workflow/scripts/alignmentIntervals.py:271
def write_output(output_file, intervals_dir):
with open(output_file, "w") as outfile:
for key, value in intervals_dir.items():
if value[0] and value[1]:
str_ = []
for idx, ref in enumerate(value[0]):
region = value[1][idx]
str_.append(f"{ref}:{region[0]}-{region[1]}")
str_ = ",".join(str_)
outfile.write(f"{key}\t{str_}\n")
else:
outfile.write(f"{key}\t\n")
def main():
args = parse_args()
union_dir_shorah = {}