From 7d18645aa5d780571f07e9c01a073e482a0b2b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Thu, 26 Oct 2023 14:56:50 +0200 Subject: [PATCH] extend header --- workflow/scripts/coverage_table.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/workflow/scripts/coverage_table.py b/workflow/scripts/coverage_table.py index a5e7183dc..11fe0f432 100644 --- a/workflow/scripts/coverage_table.py +++ b/workflow/scripts/coverage_table.py @@ -3,9 +3,10 @@ sys.stderr = open(snakemake.log[0], "w") group_regions = dict() - +samples = [] for bed in [snakemake.input[0]]: sample = bed.split("/")[-1].split(".")[0] + samples.append(sample) with open(bed, "r") as covered_regions: for line in covered_regions: line = line.strip().split("\t") @@ -23,7 +24,7 @@ df.index.names = ("chromosome", "gene") df.reset_index(inplace=True) else: - df = pd.DataFrame(columns=["chromosome", "gene"]) + df = pd.DataFrame(columns=["chromosome", "gene"] + samples) with open(snakemake.output[0], "w") as csv_file: df.to_csv(csv_file, index=False, sep="\t")