UofABioinformaticsHub / RNAseq_snakemake

Bioinformatics Hub RNAseq snakemake pipeline
13 stars 2 forks source link

Salmon indexing run for each trimmed fastq #1

Open jimmybgammyknee opened 7 years ago

jimmybgammyknee commented 7 years ago

Instead of indexing the transcriptome at the start of each code block, I have indexed a copy of mm10 on AFW. Can this be changed in the code?

i.e. rule quant_salmon: input: R1 = config["BASE"] + config["TRIM"] + "/{samples}_t1.fastq.gz", R2 = config["BASE"] + config["TRIM"] + "/{samples}_t2.fastq.gz", Tran = config["TRAN"] output: out = config["BASE"] + config["QUANT_SAL"] + "/{samples}/" params: salmon = config["salmon"], index = config["INDEX_DIR"], bootstrap = config["bootstrap"], out = config["BASE"] + config["QUANT_SAL"] + "/{samples}/" threads: config["SAL_threads"] message: "Salmon - Quantification of transcripts" log: config["BASE"] + config["LOG"] + config["QUANT_SAL"] + "/{samples}.log"

shell:
 """
    {params.salmon} quant -l A -i **{params.index}** -p {threads} -1 {input.R1} -2 {input.R2} \
            --numBootstraps {params.bootstrap} -o {params.out} 2> {log}
 """
a-lud commented 7 years ago

Should be solved. I've included a new rule salmon_index, and it's output is directed to salmon_quant. The index step will only be executed once for the pipeline, and will occur before the quantification stage.

Let me know if there are any issues.