Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions meta/bio/salmon_tximport/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ description: >
+----------------+----------+------------------------------------------------+
authors:
- Thibault Dayris
pathvars:
default:
- results
- resources
- logs
custom:
transcriptome_sequence: Path to FASTA file with transcriptome sequence
genome_sequence: Path to FASTA file with genome sequence
genome_annotation: Path to GTF file with genome annotation
reads_r1: Path/pattern for FASTQ files with R1 reads
reads_r2: Path/pattern for FASTQ files with R2 reads
tx_to_gene: Path to TSV table with transcript_id <tab> gene_id
per: Pattern for sample identifiers, e.g. ``"{sample}"``
68 changes: 38 additions & 30 deletions meta/bio/salmon_tximport/meta_wrapper.smk
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
rule salmon_decoy_sequences:
input:
transcriptome="resources/transcriptome.fasta",
genome="resources/genome.fasta",
transcriptome="<transcriptome_sequence>",
genome="<genome_sequence>",
output:
gentrome=temp("resources/gentrome.fasta"),
decoys=temp("resources/decoys.txt"),
gentrome=temp("<resources>/gentrome.fasta"),
decoys=temp("<resources>/decoys.txt"),
threads: 1
log:
"decoys.log",
"<logs>/decoys.log",
wrapper:
"v6.0.0/bio/salmon/decoys"


rule salmon_index_gentrome:
input:
sequences="resources/gentrome.fasta",
decoys="resources/decoys.txt",
sequences="<resources>/gentrome.fasta",
decoys="<resources>/decoys.txt",
output:
multiext(
"salmon/transcriptome_index/",
"<resources>/salmon_gentrome_index/",
"complete_ref_lens.bin",
"ctable.bin",
"ctg_offsets.bin",
Expand All @@ -37,7 +37,7 @@ rule salmon_index_gentrome:
),
cache: True
log:
"logs/salmon/transcriptome_index.log",
"<logs>/salmon/gentrome_index.log",
threads: 2
params:
# optional parameters
Expand All @@ -48,9 +48,10 @@ rule salmon_index_gentrome:

rule salmon_quant_reads:
input:
r="reads/{sample}.fastq.gz",
r1="<reads_r1>",
r2="<reads_r2>",
index=multiext(
"salmon/transcriptome_index/",
"<resources>/salmon_gentrome_index/",
"complete_ref_lens.bin",
"ctable.bin",
"ctg_offsets.bin",
Expand All @@ -67,17 +68,17 @@ rule salmon_quant_reads:
"seq.bin",
"versionInfo.json",
),
gtf="resources/annotation.gtf",
gtf="<genome_annotation>",
output:
quant=temp("pseudo_mapping/{sample}/quant.sf"),
quant_gene=temp("pseudo_mapping/{sample}/quant.genes.sf"),
lib=temp("pseudo_mapping/{sample}/lib_format_counts.json"),
aux_info=temp(directory("pseudo_mapping/{sample}/aux_info")),
cmd_info=temp("pseudo_mapping/{sample}/cmd_info.json"),
libparams=temp(directory("pseudo_mapping/{sample}/libParams")),
logs=temp(directory("pseudo_mapping/{sample}/logs")),
quant=temp("<results>/pseudo_mapping/<per>/quant.sf"),
quant_gene=temp("<results>/pseudo_mapping/<per>/quant.genes.sf"),
lib=temp("<results>/pseudo_mapping/<per>/lib_format_counts.json"),
aux_info=temp(directory("<results>/pseudo_mapping/<per>/aux_info")),
cmd_info=temp("<results>/pseudo_mapping/<per>/cmd_info.json"),
libparams=temp(directory("<results>/pseudo_mapping/<per>/libParams")),
logs=temp(directory("<results>/pseudo_mapping/<per>/logs")),
log:
"logs/salmon/{sample}.log",
"<logs>/salmon/<per>.log",
params:
# optional parameters
libtype="A",
Expand All @@ -90,28 +91,35 @@ rule salmon_quant_reads:
rule tximport:
input:
quant=expand(
"pseudo_mapping/{sample}/quant.sf", sample=["S1", "S2", "S3", "S4"]
"<results>/pseudo_mapping/{sample}/quant.sf",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
lib=expand(
"pseudo_mapping/{sample}/lib_format_counts.json",
sample=["S1", "S2", "S3", "S4"],
"<results>/pseudo_mapping/{sample}/lib_format_counts.json",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
aux_info=expand(
"pseudo_mapping/{sample}/aux_info", sample=["S1", "S2", "S3", "S4"]
"<results>/pseudo_mapping/{sample}/aux_info",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
cmd_info=expand(
"pseudo_mapping/{sample}/cmd_info.json", sample=["S1", "S2", "S3", "S4"]
"<results>/pseudo_mapping/{sample}/cmd_info.json",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
libparams=expand(
"pseudo_mapping/{sample}/libParams", sample=["S1", "S2", "S3", "S4"]
"<results>/pseudo_mapping/{sample}/libParams",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
logs=expand("pseudo_mapping/{sample}/logs", sample=["S1", "S2", "S3", "S4"]),
tx_to_gene="resources/tx2gene.tsv",
logs=expand(
"<results>/pseudo_mapping/{sample}/logs",
sample=lookup(dpath="salmon_tximport_submodule/samples", within=config),
),
tx_to_gene="<tx_to_gene>",
output:
txi="tximport/SummarizedExperimentObject.RDS",
txi="<results>/tximport/SummarizedExperimentObject.RDS",
params:
extra="type='salmon'",
log:
"logs/tximport.log"
"<logs>/tximport.log",
wrapper:
"v6.0.2/bio/tximport"
12 changes: 10 additions & 2 deletions meta/bio/salmon_tximport/test/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ from snakemake.utils import min_version

min_version("9.13.1")


configfile: "config.yaml"


module salmon_tximport:
meta_wrapper: "file:.."
meta_wrapper:
"file:.."
config:
config


use rule * from salmon_tximport
use rule * from salmon_tximport
14 changes: 14 additions & 0 deletions meta/bio/salmon_tximport/test/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pathvars:
transcriptome_sequence: "resources/transcriptome.fasta"
genome_sequence: "resources/genome.fasta"
genome_annotation: "resources/annotation.gtf"
tx_to_gene: "resources/tx2gene.tsv"
per: "{sample}"
reads_r1: "reads/{sample}_R1.fq.gz"
reads_r2: "reads/{sample}_R2.fq.gz"
resources: "resources"

salmon_tximport_submodule:
samples:
- "S1"
- "S2"
Binary file removed meta/bio/salmon_tximport/test/reads/S1.fastq.gz
Binary file not shown.
Binary file added meta/bio/salmon_tximport/test/reads/S1_R1.fq.gz
Binary file not shown.
Binary file added meta/bio/salmon_tximport/test/reads/S1_R2.fq.gz
Binary file not shown.
Binary file removed meta/bio/salmon_tximport/test/reads/S2.fastq.gz
Binary file not shown.
Binary file added meta/bio/salmon_tximport/test/reads/S2_R1.fq.gz
Binary file not shown.
Binary file added meta/bio/salmon_tximport/test/reads/S2_R2.fq.gz
Binary file not shown.
Binary file removed meta/bio/salmon_tximport/test/reads/S3.fastq.gz
Binary file not shown.
Binary file removed meta/bio/salmon_tximport/test/reads/S4.fastq.gz
Binary file not shown.
1 change: 1 addition & 0 deletions meta/bio/salmon_tximport/test/resources/genome.fasta.fai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chromosome1 927 13 79 80
5 changes: 3 additions & 2 deletions meta/bio/salmon_tximport/test/resources/transcriptome.fasta
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
>transcript1
CCAGGCTCGTATGTACATCGCTCCTCAAAGTGAGGGGAAGTCCTAAT
CAGGCTCGTATGTACATCGCTCCTCAAAGTGAGGGGAAGTCCTAATCGG
>transcript2
CATCTCCCTGAGTCGGTTTAAAGATTGTCTTGTATGCGTACTCTTGATAGGTAACCCG
CAGGCTCGTATGTACATCGCTCCTCAAAGTGAGGGGAAGTCCTAATCGGATACCGATTGGACTCTTGAGT
ACCGGCCCTGT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
transcript1 49 13 49 50
transcript2 81 76 70 71
2 changes: 1 addition & 1 deletion test_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def test_salmon_tximport_meta(run):
"--cores",
"2",
"--use-conda",
"tximport/SummarizedExperimentObject.RDS",
"results/tximport/SummarizedExperimentObject.RDS",
],
)

Expand Down
Loading