Skip to content

Commit

Permalink
chore: add temp flags (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbtf authored Dec 22, 2021
1 parent 300decd commit a0e3d96
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ jobs:
steps:
- uses: actions/checkout@v2

# - name: Cache conda dependencies
# uses: actions/cache@v2
# with:
# path: |
# .tests/.snakemake/conda
# key: technology-${{ runner.os }}-${{ matrix.rule }}-${{ matrix.technology }}-${{ matrix.seq_method }}-${{ hashFiles('*.tests/.snakemake/conda/*.yaml') }}
# android - will release about 10 GB if you don't need Android
# dotnet - will release about 20 GB if you don't need .NET
- name: Free up some disk sapce
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Prepare test data for all technologies
if: steps.test-data.outputs.cache-hit != true && (startsWith(matrix.rule, 'all') && matrix.technology == 'all' || matrix.rule == 'compare_assemblers')
Expand Down
12 changes: 6 additions & 6 deletions workflow/rules/assembly.smk
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ rule spades_assemble_se:
input:
get_reads_after_qc,
output:
"results/{date}/assembly/{sample}/spades-se/{sample}.contigs.fasta",
temp("results/{date}/assembly/{sample}/spades-se/{sample}.contigs.fasta"),
log:
"logs/{date}/spades/se/{sample}.log",
conda:
Expand All @@ -112,7 +112,7 @@ rule check_contigs:
input:
get_contigs,
output:
"results/{date}/contigs/checked/{sample}.fasta",
temp("results/{date}/contigs/checked/{sample}.fasta"),
log:
"logs/{date}/check_contigs/{sample}.log",
conda:
Expand Down Expand Up @@ -146,7 +146,7 @@ rule filter_chr0:
input:
"results/{date}/contigs/ordered-unfiltered/{sample}.fasta",
output:
"results/{date}/contigs/ordered/{sample}.fasta",
temp("results/{date}/contigs/ordered/{sample}.fasta"),
log:
"logs/{date}/ragoo/{sample}_cleaned.log",
conda:
Expand Down Expand Up @@ -206,7 +206,7 @@ rule aggregate_polished_de_novo_sequences:
input:
get_polished_sequence,
output:
"results/{date}/contigs/polished/{sample}.fasta",
temp("results/{date}/contigs/polished/{sample}.fasta"),
log:
"logs/{date}/aggregate_polished_de_novo_sequences/{sample}.log",
conda:
Expand All @@ -219,7 +219,7 @@ rule aggregate_fallback_sequences:
input:
get_fallback_sequence,
output:
"results/{date}/contigs/fallback/{sample}.fasta",
temp("results/{date}/contigs/fallback/{sample}.fasta"),
log:
"logs/{date}/aggregate_fallback_sequences/{sample}.log",
conda:
Expand All @@ -233,7 +233,7 @@ rule align_contigs:
target="resources/genomes/main.fasta",
query=get_quast_fastas,
output:
"results/{date}/aligned/ref~main/{stage}~{sample}.bam",
temp("results/{date}/aligned/ref~main/{stage}~{sample}.bam"),
log:
"results/{date}/aligned/ref~main/{stage}~{sample}.log",
conda:
Expand Down
14 changes: 7 additions & 7 deletions workflow/rules/long_read.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rule nanoQC:
input:
get_reads_by_stage,
output:
"results/{date}/qc/nanoQC/{sample}/{stage}/nanoQC.html",
temp("results/{date}/qc/nanoQC/{sample}/{stage}/nanoQC.html"),
log:
"logs/{date}/nanoQC/{sample}_{stage}.log",
params:
Expand All @@ -23,7 +23,7 @@ rule count_fastq_reads:
input:
get_reads_by_stage,
output:
"results/{date}/tables/fastq-read-counts/{stage}~{sample}.txt",
temp("results/{date}/tables/fastq-read-counts/{stage}~{sample}.txt"),
log:
"logs/{date}/count_reads/{stage}~{sample}.log",
conda:
Expand All @@ -36,7 +36,7 @@ rule porechop_adapter_barcode_trimming:
input:
get_fastqs,
output:
"results/{date}/trimmed/porechop/adapter_barcode_trimming/{sample}.fastq",
temp("results/{date}/trimmed/porechop/adapter_barcode_trimming/{sample}.fastq"),
conda:
"../envs/porechop.yaml"
log:
Expand Down Expand Up @@ -68,7 +68,7 @@ rule porechop_primer_trimming:
),
repl_flag="results/.indicators/replacement_notice.txt",
output:
"results/{date}/trimmed/porechop/primer_clipped/{sample}.fastq",
temp("results/{date}/trimmed/porechop/primer_clipped/{sample}.fastq"),
conda:
"../envs/primechop.yaml"
log:
Expand All @@ -82,7 +82,7 @@ rule nanofilt:
input:
"results/{date}/trimmed/porechop/primer_clipped/{sample}.fastq",
output:
"results/{date}/trimmed/nanofilt/{sample}.fastq",
temp("results/{date}/trimmed/nanofilt/{sample}.fastq"),
log:
"logs/{date}/nanofilt/{sample}.log",
params:
Expand Down Expand Up @@ -126,7 +126,7 @@ use rule assembly_polishing_ont as medaka_consensus_reference with:
fasta="results/{date}/corrected/{sample}/{sample}.correctedReads.fasta.gz",
reference="resources/genomes/main.fasta",
output:
"results/{date}/consensus/medaka/{sample}/{sample}.fasta",
temp("results/{date}/consensus/medaka/{sample}/{sample}.fasta"),


# polish consensus
Expand All @@ -136,7 +136,7 @@ rule bcftools_consensus_ont:
bcf="results/{date}/filtered-calls/ref~{sample}/{sample}.subclonal.high+moderate-impact.bcf", # clonal vs. subclonal?
bcfidx="results/{date}/filtered-calls/ref~{sample}/{sample}.subclonal.high+moderate-impact.bcf.csi",
output:
"results/{date}/consensus/bcftools/{sample}.fasta",
temp("results/{date}/consensus/bcftools/{sample}.fasta"),
log:
"logs/{date}/bcftools-consensus-ont/{sample}.log",
conda:
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/pseudoassembly.smk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rule compare_assemblies:
assembly="results/{date}/contigs/polished/{sample}.fasta",
pseudoassembly="results/{date}/contigs/pseudoassembled/{sample}.fasta",
output:
"results/{date}/aligned/assemblies/{sample}.bam",
temp("results/{date}/aligned/assemblies/{sample}.bam"),
log:
"logs/{date}/aligned/assemblies/{sample}log",
conda:
Expand Down
12 changes: 7 additions & 5 deletions workflow/rules/read_clipping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rule samtools_sort:
input:
get_samtools_sort_input,
output:
"results/{date}/read-sorted/{read_type}~{sorted_by}/{sample}.{stage}.bam",
temp("results/{date}/read-sorted/{read_type}~{sorted_by}/{sample}.{stage}.bam"),
params:
extra=(
lambda wildcards: "-n -m 4G" if wildcards.sorted_by == "name" else "-m 4G"
Expand Down Expand Up @@ -56,7 +56,9 @@ rule fgbio:
reference=config["adapters"]["amplicon-reference"]
),
output:
"results/{date}/read-clipping/hardclipped/{read_type}/{sample}/{sample}.bam",
temp(
"results/{date}/read-clipping/hardclipped/{read_type}/{sample}/{sample}.bam"
),
log:
"logs/{date}/fgbio/{read_type}/{sample}.log",
conda:
Expand All @@ -69,8 +71,8 @@ rule samtools_fastq_pe:
input:
bam="results/{date}/read-sorted/pe~name/{sample}.hardclipped.bam",
output:
fq1="results/{date}/read-clipping/fastq/pe/{sample}.1.fastq.gz",
fq2="results/{date}/read-clipping/fastq/pe/{sample}.2.fastq.gz",
fq1=temp("results/{date}/read-clipping/fastq/pe/{sample}.1.fastq.gz"),
fq2=temp("results/{date}/read-clipping/fastq/pe/{sample}.2.fastq.gz"),
log:
"logs/{date}/samtools_fastq/pe/{sample}.log",
conda:
Expand All @@ -84,7 +86,7 @@ rule samtools_fastq_se:
input:
bam="results/{date}/read-sorted/se~name/{sample}.hardclipped.bam",
output:
"results/{date}/read-clipping/fastq/se/{sample}.fastq",
temp("results/{date}/read-clipping/fastq/se/{sample}.fastq"),
log:
"logs/{date}/samtools_fastq/se/{sample}.log",
conda:
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/read_mapping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ rule samtools_calmd:
aln=get_recal_input,
ref=get_reference(),
output:
"results/{date}/recal/ref~{reference}/{sample}.bam",
temp("results/{date}/recal/ref~{reference}/{sample}.bam"),
log:
"logs/{date}/samtools-calmd/ref~{reference}/{sample}.log",
params:
Expand Down
6 changes: 3 additions & 3 deletions workflow/rules/read_trimming.smk
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ rule fastp_se:
input:
sample=get_fastqs,
output:
trimmed="results/{date}/trimmed/fastp-se/{sample}.fastq.gz",
html="results/{date}/trimmed/fastp-se/{sample}.html",
json="results/{date}/trimmed/fastp-se/{sample}.fastp.json",
trimmed=temp("results/{date}/trimmed/fastp-se/{sample}.fastq.gz"),
html=temp("results/{date}/trimmed/fastp-se/{sample}.html"),
json=temp("results/{date}/trimmed/fastp-se/{sample}.fastp.json"),
params:
adapters=get_adapters,
extra="--qualified_quality_phred {} ".format(
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/strain_calling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ rule kallisto_metrics:
input:
get_reads_after_qc,
output:
avg_read_length="results/{date}/tables/avg_read_length/{sample}.txt",
standard_deviation="results/{date}/tables/standard_deviation/{sample}.txt",
avg_read_length=temp("results/{date}/tables/avg_read_length/{sample}.txt"),
standard_deviation=temp("results/{date}/tables/standard_deviation/{sample}.txt"),
log:
"logs/{date}/kallisto/metrics/{sample}.log",
conda:
Expand Down
6 changes: 3 additions & 3 deletions workflow/rules/variant_calling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ rule vcf_2_bcf:
input:
"results/{date}/candidate-calls/ref~{reference}/{sample}.{varrange}.vcf",
output:
"results/{date}/candidate-calls/ref~{reference}/{sample}.{varrange}.bcf",
temp("results/{date}/candidate-calls/ref~{reference}/{sample}.{varrange}.bcf"),
log:
"logs/{date}/vcf_2_bcf/ref~{reference}/{sample}.{varrange}.log",
conda:
Expand Down Expand Up @@ -122,7 +122,7 @@ rule varlociraptor_alignment_properties:
ref_idx=get_reference(".fai"),
bam="results/{date}/recal/ref~{reference}/{sample}.bam",
output:
"results/{date}/alignment-properties/ref~{reference}/{sample}.json",
temp("results/{date}/alignment-properties/ref~{reference}/{sample}.json"),
log:
"logs/{date}/varlociraptor/estimate-alignment-properties/ref~{reference}/{sample}.log",
conda:
Expand All @@ -141,7 +141,7 @@ rule varlociraptor_preprocess:
bam="results/{date}/recal/ref~{reference}/{sample}.bam",
bai="results/{date}/recal/ref~{reference}/{sample}.bam.bai",
output:
"results/{date}/observations/ref~{reference}/{sample}.{varrange}.bcf",
temp("results/{date}/observations/ref~{reference}/{sample}.{varrange}.bcf"),
params:
depth=config["variant-calling"]["max-read-depth"],
log:
Expand Down

0 comments on commit a0e3d96

Please sign in to comment.