Skip to content

Commit

Permalink
Adding bowtie/1.X log to multiqc input
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Jul 7, 2023
1 parent dc41c01 commit 7a3c8e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions workflow/rules/align.smk
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,29 @@ rule mirdeep2_mapper:
output:
arf = join(workpath, "mirdeep2", "mapper", "{sample}_mapped.arf"),
collapsed = join(workpath, "mirdeep2", "mapper", "{sample}_collapsed.fa"),
new_log = join(workpath, "mirdeep2", "mapper", "{sample}", "{sample}.bowtie.log"),
params:
rname = "mapper",
# Minimum read length also
# used for trimming reads
min_len = min_read_length,
bw_index = config['references'][genome]['bowtie1_index'],
tmpdir = join(workpath, "mirdeep2", "mapper", "{sample}"),
envmodules: config['tools']['bowtie'],
container: config['images']['mir-seek'],
threads: int(allocated("threads", "mirdeep2_mapper", cluster)),
shell: """
# Setups temporary directory for
# intermediate files, miRDeep2
# output directories rely on
# timestamps, this helps avoid
# collision due to multiple runs
# of the same sample, needed for
# the bowtie/1.X log files
if [ ! -d "{params.tmpdir}" ]; then mkdir -p "{params.tmpdir}"; fi
tmp=$(mktemp -d -p "{params.tmpdir}")
cd "${{tmp}}"
# Aligns reads to the reference
# genome with Bowtie/1.X, allows
# one mismatch in the alignment
Expand All @@ -41,4 +54,7 @@ rule mirdeep2_mapper:
-t {output.arf} \\
-v \\
-o {threads}
# Rename bowtie/1.X log file
mv "${{tmp}}/bowtie.log" "{output.new_log}"
"""
1 change: 1 addition & 0 deletions workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ rule multiqc:
expand(join(workpath, "fastqc", "{sample}.R1_fastqc.zip"), sample=samples),
expand(join(workpath, "fastqc", "{sample}_trimmed_fastqc.zip"), sample=samples),
expand(join(workpath, "mirdeep2", "mapper", "{sample}_mapped.arf"), sample=samples),
expand(join(workpath, "mirdeep2", "mapper", "{sample}", "{sample}.bowtie.log"), sample=samples),
output:
html = join(workpath, "reports", "multiqc_report.html"),
params:
Expand Down

0 comments on commit 7a3c8e6

Please sign in to comment.