Skip to content

Commit

Permalink
extend header
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMoelder committed Oct 26, 2023
1 parent 5c68058 commit 7d18645
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workflow/scripts/coverage_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

0 comments on commit 7d18645

Please sign in to comment.