Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove NA string replacement, fixed upstream #2940

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bio/deeptools/plotfingerprint/test/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ rule plot_fingerprint:
input:
bam_files=expand("samples/{sample}.bam", sample=["a", "b"]),
bam_idx=expand("samples/{sample}.bam.bai", sample=["a", "b"]),
jsd_sample="samples/b.bam" # optional, requires qc_metrics output
jsd_sample="samples/b.bam", # optional, requires qc_metrics output
output:
# Please note that --plotFile and --outRawCounts are exclusively defined via output files.
# Usable output variables, their extensions and which option they implicitly call are listed here:
# https://snakemake-wrappers.readthedocs.io/en/stable/wrappers/deeptools/plotfingerprint.html.
fingerprint="plot_fingerprint/plot_fingerprint.png", # required
# optional output
counts="plot_fingerprint/raw_counts.tab",
qc_metrics="plot_fingerprint/qc_metrics.txt"
qc_metrics="plot_fingerprint/qc_metrics.txt",
log:
"logs/deeptools/plot_fingerprint.log"
"logs/deeptools/plot_fingerprint.log",
params:
# optional parameters
"--numberOfSamples 200 "
threads:
8
"--numberOfSamples 200 ",
fgvieira marked this conversation as resolved.
Show resolved Hide resolved
threads: 8
wrapper:
"master/bio/deeptools/plotfingerprint"
16 changes: 3 additions & 13 deletions bio/deeptools/plotfingerprint/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
__author__ = "Antonie Vietor"
__copyright__ = "Copyright 2020, Antonie Vietor"
__copyright__ = "Copyright 2024, Antonie Vietor, Lance Parsons"
__email__ = "[email protected]"
__license__ = "MIT"

from snakemake.shell import shell
import re

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

jsd_sample = snakemake.input.get("jsd_sample")
Expand All @@ -32,14 +33,3 @@
"{jsd} "
"{snakemake.params}) {log}"
)
# ToDo: remove the 'NA' string replacement when fixed in deepTools, see:
# https://github.com/deeptools/deepTools/pull/999
regex_passes = 2

with open(out_metrics, "rt") as f:
metrics = f.read()
for i in range(regex_passes):
metrics = re.sub("\tNA(\t|\n)", "\tnan\\1", metrics)

with open(out_metrics, "wt") as f:
f.write(metrics)
Loading