Skip to content

Commit

Permalink
try to optimize large outputs trying to fit tests in GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ftabaro committed Mar 11, 2024
1 parent e9f047e commit be557f4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
36 changes: 21 additions & 15 deletions workflow/rules/star.smk
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,26 @@ rule star:
genome_annotation_file=gtf_path,
output:
temp(star_folder.joinpath("{serie}/{sample}.Aligned.sortedByCoord.out.bam")),
star_folder.joinpath("{serie}/{sample}.Aligned.toTranscriptome.out.bam"),
star_folder.joinpath("{serie}/{sample}.ReadsPerGene.out.tab"),
star_folder.joinpath("{serie}/{sample}.SJ.out.tab"),
star_folder.joinpath("{serie}/{sample}.Signal.Unique.str1.out.wig"),
star_folder.joinpath("{serie}/{sample}.Signal.Unique.str2.out.wig"),
star_folder.joinpath("{serie}/{sample}.Signal.UniqueMultiple.str1.out.wig"),
star_folder.joinpath("{serie}/{sample}.Signal.UniqueMultiple.str2.out.wig"),
star_folder.joinpath("{serie}/{sample}.Log.final.out"),
temp(star_folder.joinpath("{serie}/{sample}.Aligned.toTranscriptome.out.bam")),
temp(star_folder.joinpath("{serie}/{sample}.ReadsPerGene.out.tab")),
temp(star_folder.joinpath("{serie}/{sample}.SJ.out.tab")),
temp(star_folder.joinpath("{serie}/{sample}.Signal.Unique.str1.out.wig")),
temp(star_folder.joinpath("{serie}/{sample}.Signal.Unique.str2.out.wig")),
temp(
star_folder.joinpath("{serie}/{sample}.Signal.UniqueMultiple.str1.out.wig")
),
temp(
star_folder.joinpath("{serie}/{sample}.Signal.UniqueMultiple.str2.out.wig")
),
temp(star_folder.joinpath("{serie}/{sample}.Log.final.out")),
threads: 8
resources:
runtime=lambda wildcards, attempt: 1440 * attempt,
mem_mb=32000,
params:
libtype=lambda wildcards: "SINGLE"
if wildcards.serie in library_names_single
else "PAIRED",
libtype=lambda wildcards: (
"SINGLE" if wildcards.serie in library_names_single else "PAIRED"
),
alignments_folder=star_folder,
tmp_folder=tmp_folder,
others=lambda wildcards: get_params(wildcards, "star"),
Expand Down Expand Up @@ -150,9 +154,11 @@ rule verify_star:
lambda wildcards: expand(
star_folder.joinpath("{serie}/{sample}.Aligned.sortedByCoord.out.bam"),
serie=wildcards.serie,
sample=samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie],
sample=(
samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie]
),
),
output:
touch(star_folder.joinpath("{serie}.done")),
Expand All @@ -162,7 +168,7 @@ rule index_bam:
input:
star_folder.joinpath("{serie}/{sample}.Aligned.sortedByCoord.out.bam"),
output:
temp(star_folder.joinpath("{serie}/{sample}.Aligned.sortedByCoord.out.bam.bai")),
star_folder.joinpath("{serie}/{sample}.Aligned.sortedByCoord.out.bam.bai"),
threads: 1
resources:
runtime=30,
Expand Down
34 changes: 19 additions & 15 deletions workflow/rules/starTE.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ rule starTE_random:
bam=get_star_input,
star_index_folder=references_folder.joinpath("STAR"),
output:
starTE_folder.joinpath("{serie}/random/{sample}.Aligned.out.bam"),
temp(starTE_folder.joinpath("{serie}/random/{sample}.Aligned.out.bam")),
threads: 8
resources:
runtime=lambda wildcards, attempt: 1440 * attempt,
mem_mb=32000,
params:
libtype=lambda wildcards: "SINGLE"
if wildcards.serie in library_names_single
else "PAIRED",
libtype=lambda wildcards: (
"SINGLE" if wildcards.serie in library_names_single else "PAIRED"
),
alignments_folder=starTE_folder,
tmp_folder=tmp_folder,
conda:
Expand Down Expand Up @@ -63,9 +63,11 @@ rule featureCounts_random:
bam=lambda wildcards: expand(
starTE_folder.joinpath("{serie}/filter/random/{sample}.TEonly.bam"),
serie=wildcards.serie,
sample=samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie],
sample=(
samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie]
),
),
annotation=rmsk_path,
output:
Expand Down Expand Up @@ -157,13 +159,13 @@ rule starTE_multihit:
runtime=lambda wildcards, attempt: 1440 * attempt,
mem_mb=32000,
output:
starTE_folder.joinpath("{serie}/multihit/{sample}.Aligned.out.bam"),
temp(starTE_folder.joinpath("{serie}/multihit/{sample}.Aligned.out.bam")),
params:
libtype=lambda wildcards: "SINGLE"
if wildcards.serie in library_names_single
else "PAIRED",
libtype=lambda wildcards: (
"SINGLE" if wildcards.serie in library_names_single else "PAIRED"
),
alignments_folder=starTE_folder,
tmp_folder=tmp_folder
tmp_folder=tmp_folder,
conda:
"../env/alignment.yml"
log:
Expand Down Expand Up @@ -212,9 +214,11 @@ rule featureCounts_multihit:
bam=lambda wildcards: expand(
starTE_folder.joinpath("{serie}/filter/multihit/{sample}.TEonly.bam"),
serie=wildcards.serie,
sample=samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie],
sample=(
samples["single"][wildcards.serie]
if wildcards.serie in samples["single"]
else samples["paired"][wildcards.serie]
),
),
annotation=rmsk_path,
output:
Expand Down

0 comments on commit be557f4

Please sign in to comment.