Skip to content

Commit

Permalink
remove LSF-specific memory directives from params
Browse files Browse the repository at this point in the history
  • Loading branch information
agillen committed Nov 14, 2023
1 parent 7bca704 commit 252bcc1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 35 deletions.
3 changes: 2 additions & 1 deletion rules/check_versions.snake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ rule check:
checked = "{data}/check_versions.txt"
params:
job_name = "check",
memory = "select[mem>5] rusage[mem=5]", # LSF format; change as needed
log:
"{data}/logs/check_versions.txt"
resources:
mem_mb = 5000
threads:
1
shell:
Expand Down
46 changes: 28 additions & 18 deletions rules/count.snake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ rule assign_sites_R1:
bam = temp("{results}/temp/{sample}_R1_assigned.bam")
params:
job_name = "assign_sites_R1",
memory = "select[mem>8] rusage[mem=8]", # LSF format; change as needed
out = "{results}/temp/{sample}_R1_assigned",
out_bam = "{results}/temp/{sample}_R1.bam.featureCounts.bam"
log:
"{results}/logs/assign_sites_{sample}_R1.txt"
threads:
12
resources:
mem_mb = 8000
shell:
"""
if echo {POLYA_SITES} | tr '[:upper:]' '[:lower:]' | grep -q -e "\.saf$" -e "\.saf.gz$"; then
Expand Down Expand Up @@ -53,13 +54,14 @@ rule assign_sites_R2:
bam = temp("{results}/temp/{sample}_R2_assigned.bam")
params:
job_name = "assign_sites_R2",
memory = "select[mem>8] rusage[mem=8]", # LSF format; change as needed
out = "{results}/temp/{sample}_R2_assigned",
out_bam = "{results}/temp/{sample}_R2.bam.featureCounts.bam"
log:
"{results}/logs/assign_sites_{sample}_R2.txt"
threads:
12
resources:
mem_mb = 8000
shell:
"""
if echo {POLYA_SITES} | tr '[:upper:]' '[:lower:]' | grep -q -e "\.saf$" -e "\.saf.gz$"; then
Expand Down Expand Up @@ -94,13 +96,14 @@ rule assign_sites_paired:
bam = temp("{results}/temp/{sample}_paired_assigned.bam")
params:
job_name = "assign_sites_paired",
memory = "select[mem>8] rusage[mem=8]", # LSF format; change as needed
out = "{results}/temp/{sample}_paired_assigned",
out_bam = "{results}/temp/{sample}_paired.bam.featureCounts.bam"
log:
"{results}/logs/assign_sites_{sample}_paired.txt"
threads:
12
resources:
mem_mb = 8000
shell:
"""
if echo {POLYA_SITES} | tr '[:upper:]' '[:lower:]' | grep -q -e "\.saf$" -e "\.saf.gz$"; then
Expand Down Expand Up @@ -137,12 +140,13 @@ rule filter_R1:
length = _get_chem_length_R1,
temp = "{results}/temp/{sample}_R1_filter.bam",
temp2 = "{results}/temp/{sample}_R1_filter2.bam",
final = "{results}/counts/{sample}_R1_counts.tsv.gz",
memory = "select[mem>8] rusage[mem=8]" # LSF format; change as needed
final = "{results}/counts/{sample}_R1_counts.tsv.gz"
log:
"{results}/logs/filter_{sample}_R1.txt"
threads:
4
resources:
mem_mb = 8000
shell:
"""
samtools view -h {input} | grep -v 'CB:Z:-\|UB:Z:-' | samtools view -b - > {params.temp}
Expand All @@ -168,12 +172,13 @@ rule filter_R2:
params:
job_name = "filter",
temp = "{results}/temp/{sample}_R2_filter.bam",
tempbai = "{results}/temp/{sample}_R2_filter.bam.bai",
memory = "select[mem>8] rusage[mem=8]" # LSF format; change as needed
tempbai = "{results}/temp/{sample}_R2_filter.bam.bai"
log:
"{results}/logs/filter_{sample}_R2.txt"
threads:
4
resources:
mem_mb = 8000
shell:
"""
samtools view -h {input} | grep -v 'CB:Z:-\|UB:Z:-' | samtools view -b - > {params.temp}
Expand All @@ -194,12 +199,13 @@ rule filter_paired:
length = _get_chem_length_R1,
temp = "{results}/temp/{sample}_paired_filter.bam",
temp2 = "{results}/temp/{sample}_paired_filter2.bam",
final = "{results}/counts/{sample}_paired_counts.tsv.gz",
memory = "select[mem>8] rusage[mem=8]" # LSF format; change as needed
final = "{results}/counts/{sample}_paired_counts.tsv.gz"
log:
"{results}/logs/filter_{sample}_paired.txt"
threads:
4
resources:
mem_mb = 8000
shell:
"""
samtools view -h {input} | grep -v 'CB:Z:-\|UB:Z:-' | samtools view -b - > {params.temp}
Expand All @@ -223,12 +229,13 @@ rule count:
output:
"{results}/counts/{sample}_{read}_counts.tsv.gz"
params:
job_name = "count",
memory = "select[mem>8] rusage[mem=8]" # LSF format; change as needed
job_name = "count"
log:
"{results}/logs/count_{sample}_{read}.txt"
threads:
4
resources:
mem_mb = 8000
shell:
"""
umi_tools count \
Expand All @@ -252,12 +259,13 @@ rule bed_R1:
params:
job_name = "bed",
dedup = "{results}/temp/{sample}_R1_dedup.bam",
r = "{results}/temp/{sample}_R1_r.bam",
memory = "select[mem>48] rusage[mem=48]" # LSF format; change as needed
r = "{results}/temp/{sample}_R1_r.bam"
log:
"{results}/logs/bed_{sample}_R1.txt"
threads:
4
resources:
mem_mb = 48000
shell:
"""
umi_tools dedup \
Expand All @@ -283,12 +291,13 @@ rule bed_R2:
"{results}/bed/{sample}_R2.bed.gz"
params:
job_name = "bed",
dedup = "{results}/temp/{sample}_R2_dedup.bam",
memory = "select[mem>48] rusage[mem=48]" # LSF format; change as needed
dedup = "{results}/temp/{sample}_R2_dedup.bam"
log:
"{results}/logs/bed_{sample}_R2.txt"
threads:
4
resources:
mem_mb = 48000
shell:
"""
umi_tools dedup \
Expand All @@ -312,12 +321,13 @@ rule bed_paired:
params:
job_name = "bed",
dedup = "{results}/temp/{sample}_paired_dedup.bam",
r = "{results}/temp/{sample}_paired_r.bam",
memory = "select[mem>48] rusage[mem=48]" # LSF format; change as needed
r = "{results}/temp/{sample}_paired_r.bam"
log:
"{results}/logs/bed_{sample}_paired.txt"
threads:
4
resources:
mem_mb = 48000
shell:
"""
umi_tools dedup \
Expand All @@ -334,4 +344,4 @@ rule bed_paired:
samtools view -f 0x42 {params.dedup} -b > {params.r}
bedtools genomecov -ibam {params.r} -5 -dz | awk 'BEGIN {{ OFS = "\t" }} {{ print $1, $2 - 1, $2, $3 }}' - | gzip > {output}
rm -rf {params.r}
"""
"""
31 changes: 16 additions & 15 deletions rules/cutadapt_star.snake
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,19 @@ rule cutadapt_R1:
job_name = "cutadapt",
bc_cut = _get_bc_cut,
info = "{results}/cutadapt/temp_{sample}_R1.info",
temp = "{results}/cutadapt/temp_{sample}_R1_trimmed.R1.fastq.gz",
memory = "select[mem>32] rusage[mem=32]"
temp = "{results}/cutadapt/temp_{sample}_R1_trimmed.R1.fastq.gz"
log: "{results}/logs/{sample}_cutadapt.out"
threads: 24
resources:
mem_mb = 32000
shell:
"""
cutadapt -j 24 \
-a TSO_R1=CCCATGTACTCTGCGTTGATACCACTGCTT \
-a TruSeq_R1=AGATCGGAAGAGCACACGTCTGAACTCCAGTCA \
-n 4 \
-m 75 \
-l 300 \
-l 300 \
--nextseq-trim=20 \
-o {output.R1} \
<(zcat {input})
Expand All @@ -79,10 +80,11 @@ rule cutadapt_paired:
bc_cut = _get_bc_cut,
info = "{results}/cutadapt/temp_{sample}_paired.info",
temp = "{results}/cutadapt/temp_{sample}_paired_trimmed.R1.fastq.gz",
temp2 = "{results}/cutadapt/temp_{sample}_paired_trimmed.R2.fastq.gz",
memory = "select[mem>32] rusage[mem=32]"
temp2 = "{results}/cutadapt/temp_{sample}_paired_trimmed.R2.fastq.gz"
log: "{results}/logs/{sample}_cutadapt.out"
threads: 24
resources:
mem_mb = 32000
shell:
"""
if [ -z "{params.bc_cut}" ] ; then
Expand Down Expand Up @@ -131,11 +133,11 @@ rule starsolo_R1:
chemistry = _get_chem_version_R1,
extra_args = _get_extra_args,
out_dir = "{results}/{sample}/{sample}_R1_",
job_name = "star_R1",
memory = "select[mem>48] rusage[mem=48]"
job_name = "star_R1"
log: "{results}/logs/{sample}_star_R1.out"
resources:
total_impact = 5
total_impact = 5,
mem_mb = 48000
threads: 14
shell:
"""
Expand Down Expand Up @@ -174,11 +176,11 @@ rule starsolo_R2:
chemistry = _get_chem_version_R2,
extra_args = _get_extra_args,
out_dir = "{results}/{sample}/{sample}_R2_",
job_name = "star_R2",
memory = "select[mem>48] rusage[mem=48]"
job_name = "star_R2"
log: "{results}/logs/{sample}_star_R2.out"
resources:
total_impact = 5
total_impact = 5,
mem_mb = 48000
threads: 14
shell:
"""
Expand Down Expand Up @@ -215,12 +217,11 @@ rule starsolo_paired:
chemistry = _get_chem_version_R1,
extra_args = _get_extra_args,
out_dir = "{results}/{sample}/{sample}_paired_",
job_name = "star_paired",
memory =
"select[mem>48] rusage[mem=48]"
job_name = "star_paired"
log: "{results}/logs/{sample}_star_paired.out"
resources:
total_impact = 5
total_impact = 5,
mem_mb = 48000
threads: 14
shell:
"""
Expand Down
3 changes: 2 additions & 1 deletion rules/qc.snake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ rule qc_check:
job_name = "qc",
target = "{results}",
path = "{results}/report",
memory = "select[mem>5] rusage[mem=5]", # LSF format; change as needed
log:
"{results}/logs/multiqc.txt"
threads:
1
resources:
mem_mb = 5000
shell:
"""
export LC_ALL=en_US.utf-8
Expand Down

0 comments on commit 252bcc1

Please sign in to comment.