Skip to content

Commit 53a2ece

Browse files
committed
fix: avoiding shared circos scratch filenames
1 parent 24e349b commit 53a2ece

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

workflow/scripts/visualization/plot_circos_scores.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,15 @@ def load_score_file(score_file, score_column):
8484

8585
temp_dir = os.path.dirname(snakemake.output.plot)
8686
os.makedirs(temp_dir, exist_ok=True)
87-
filtered_chr_bed = os.path.join(temp_dir, f"{population}_chr.bed")
87+
#filtered_chr_bed = os.path.join(temp_dir, f"{population}_chr.bed")
88+
out_stem = os.path.splitext(os.path.basename(snakemake.output.plot))[0]
89+
filtered_chr_bed = os.path.join(temp_dir, f"{out_stem}_chr.bed")
8890
chr_bed_df.to_csv(filtered_chr_bed, sep="\t", header=False, index=False)
8991

9092
# Decompress cytoband if gzipped
9193
if cytoband_file.endswith(".gz"):
92-
cytoband_unzipped = os.path.join(temp_dir, f"{population}_cytoband.txt")
94+
# cytoband_unzipped = os.path.join(temp_dir, f"{population}_cytoband.txt")
95+
cytoband_unzipped = os.path.join(temp_dir, f"{out_stem}_cytoband.txt")
9396
with gzip.open(cytoband_file, "rb") as f_in, open(cytoband_unzipped, "wb") as f_out:
9497
shutil.copyfileobj(f_in, f_out)
9598
cytoband_file = cytoband_unzipped

0 commit comments

Comments
 (0)