Skip to content

Commit

Permalink
snakefmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tdayris committed Jul 9, 2024
1 parent 256fc03 commit 5e98698
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
54 changes: 36 additions & 18 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ def lookup_genomes(
"""
Run lookup function with default parameters in order to search user-provided sequence/annotation files
"""
query: str = "species == '{wildcards.species}' & build == '{wildcards.build}' & release == '{wildcards.release}'".format(
wildcards=wildcards
query: str = (
"species == '{wildcards.species}' & build == '{wildcards.build}' & release == '{wildcards.release}'".format(
wildcards=wildcards
)
)

query_result: str | float = getattr(
Expand All @@ -196,8 +198,10 @@ def get_dna_fasta(
"""
Return path to the final DNA fasta sequences
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.dna.fasta".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.dna.fasta".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="dna_fasta", default=default, genomes=genomes)

Expand All @@ -208,8 +212,10 @@ def get_cdna_fasta(
"""
Return path to the final cDNA fasta sequences
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.cdna.fasta".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.cdna.fasta".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="cdna_fasta", default=default, genomes=genomes)

Expand All @@ -220,8 +226,10 @@ def get_transcripts_fasta(
"""
Return path to the final cDNA transcripts fasta sequences
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.transcripts.fasta".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.transcripts.fasta".format(
wildcards=wildcards
)
)
return lookup_genomes(
wildcards, key="transcripts_fasta", default=default, genomes=genomes
Expand Down Expand Up @@ -250,8 +258,10 @@ def get_dna_fai(
"""
Return path to the final DNA fasta sequences index
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.dna.fasta.fai".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.dna.fasta.fai".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="dna_fai", default=default, genomes=genomes)

Expand All @@ -262,8 +272,10 @@ def get_cdna_fai(
"""
Return path to the final cDNA fasta sequences index
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.cdna.fasta.fai".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.cdna.fasta.fai".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="cdna_fai", default=default, genomes=genomes)

Expand All @@ -274,8 +286,10 @@ def get_transcripts_fai(
"""
Return path to the final cDNA transcripts fasta sequences index
"""
default: str = "reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.transcripts.fasta.fai".format(
wildcards=wildcards
default: str = (
"reference/sequences/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.transcripts.fasta.fai".format(
wildcards=wildcards
)
)
return lookup_genomes(
wildcards, key="transcripts_fai", default=default, genomes=genomes
Expand Down Expand Up @@ -304,8 +318,10 @@ def get_gtf(
"""
Return path to the final genome annotation (GTF formatted)
"""
default: str = "reference/annotation/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.gtf".format(
wildcards=wildcards
default: str = (
"reference/annotation/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.gtf".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="gtf", default=default, genomes=genomes)

Expand All @@ -316,8 +332,10 @@ def get_gff(
"""
Return path to the final genome annotation (GFF3 formatted)
"""
default: str = "reference/annotation/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.gff3".format(
wildcards=wildcards
default: str = (
"reference/annotation/{wildcards.species}.{wildcards.build}.{wildcards.release}/{wildcards.species}.{wildcards.build}.{wildcards.release}.gff3".format(
wildcards=wildcards
)
)
return lookup_genomes(wildcards, key="gff3", default=default, genomes=genomes)

Expand Down
6 changes: 3 additions & 3 deletions workflow/rules/fastq_screen.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ rule fair_fastqc_multiqc_fastq_screen_single_ended:
"benchmark/fair_fastqc_multiqc_fastq_screen_single_ended/{sample}.tsv"
params:
subset=lookup_config(
dpath="params/fair_fastqc_multiqc_fastq_screen/subset",
dpath="params/fair_fastqc_multiqc_fastq_screen_subset",
default=10000,
),
aligner=lookup_config(
dpath="params/fair_fastqc_multiqc_fastq_screen/aligner",
dpath="params/fair_fastqc_multiqc_fastq_screen_aligner",
default="bowtie2",
),
fastq_screen_config=lookup_config(
dpath="params/fair_fastqc_multiqc_fastq_screen/fastq_screen_config",
dpath="params/fair_fastqc_multiqc_fastq_screen_config",
),
wrapper:
f"{snakemake_wrappers_prefix}/bio/fastq_screen"
Expand Down

0 comments on commit 5e98698

Please sign in to comment.