Skip to content

Commit

Permalink
Merge branch 'fix-add-wd-container-binding' of https://github.com/als…
Browse files Browse the repository at this point in the history
…mith151/SeqNado into fix-correct-single-end-spikein
  • Loading branch information
alsmith151 committed Mar 26, 2024
2 parents 8f14674 + 3487803 commit a99ea59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
4 changes: 2 additions & 2 deletions seqnado/workflow/rules/align.smk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rule align_paired:
threads: config["bowtie2"]["threads"]
resources:
runtime=lambda wildcards, attempt: f"{4 * 2 ** (attempt - 1)}h",
mem="4GB",
mem=lambda wildcards, attempt: f"{4 * 2 ** (attempt - 1)}GB",
log:
"seqnado_output/logs/align/{sample}.log",
shell:
Expand All @@ -35,7 +35,7 @@ rule align_single:
bam=temp("seqnado_output/aligned/raw/{sample}.bam"),
resources:
runtime=lambda wildcards, attempt: f"{4 * 2 ** (attempt - 1)}h",
mem="4GB",
mem=lambda wildcards, attempt: f"{4 * 2 ** (attempt - 1)}GB",
threads: config["bowtie2"]["threads"]
log:
"seqnado_output/logs/align/{sample}.log",
Expand Down
23 changes: 5 additions & 18 deletions seqnado/workflow/rules/exogenous_norm.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,19 @@ from seqnado.design import NormGroups

NORM_GROUPS = NormGroups.from_design(DESIGN)

rule align_paired_spikein:
input:
fq1="seqnado_output/trimmed/{sample}_1.fastq.gz",
fq2="seqnado_output/trimmed/{sample}_2.fastq.gz",
use rule align_paired as align_paired_spikein with:
params:
index=config["genome"]["indices"],
options="--no-mixed --no-discordant",
output:
bam=temp("seqnado_output/aligned/spikein/raw/{sample}.bam"),
threads: config["bowtie2"]["threads"]
resources:
mem=lambda wildcards, attempt: f"{4 * 2**attempt}GB",
runtime=lambda wildcards, attempt: f"{4 * 2 ** (attempt - 1)}h",
log:
"seqnado_output/logs/align/{sample}.log",
shell:
"""
bowtie2 -p {threads} {params.options} -x {params.index} -1 {input.fq1} -2 {input.fq2} 2> {log} |
samtools view -bS - > {output.bam} &&
samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} >> {log} 2>&1 &&
mv {output.bam}_sorted {output.bam}
"""
mem=lambda wildcards, attempt: f"{8 * 2 ** (attempt - 1)}GB",

use rule align_single as align_single_spikein with:
output:
bam=temp("seqnado_output/aligned/spikein/raw/{sample}.bam")
bam=temp("seqnado_output/aligned/spikein/raw/{sample}.bam"),
resources:
mem=lambda wildcards, attempt: f"{8 * 2 ** (attempt - 1)}GB",


use rule sort_bam as sort_bam_spikein with:
Expand Down

0 comments on commit a99ea59

Please sign in to comment.