Hi all
I tried to make a snakemake pipeline for fastp but somehow I feel I'm going wrong or code is incorrect I'm posting my code so can you suggest where am I going wrong because I'm new to snakemake and I'm confused
This is my code
import os
SRA,FRR=glob_wildcards("rawReads/{sra}_{frr}.fastq.gz")
rule all:
input:
expand ("rawQC/{sra}_{frr}_fastqc.{extension}",sra=SRA,frr=FRR,extension=["gz","html"])
rule rawFastqc:
input:
rawread="rawReads/{sra}_{frr}.fastq.gz"
output:
gz="rawQC/{sra}_{frr}_fastq.gz",
html="rawQC/{sra}_{frr}_fastqc.html"
threads:
1
params:
path="rawQC/"
shell:
"""
fastqc {input.rawread} --threads {threads} -o {params.path}
"""
rule fastp:
input:
read1="rawReads/{sra}_1.fastq.gz",
read2="rawReads/{sra}_2.fastq.gz"
output:
forwardpaired="trimmedreads/{sra}_1P.fastq.gz",
reversepaired="trimmedreads/{sra}_2P.fastq.gz",
report_html=trimmedreads{sra}_{frr}_fastq.html
threads:
4
shell:
"""
fastp -i {input[read1]} -I{input[read2]} -o{output[read1]} -O {output[read2]}
"""
in your
rule fastp
, how is snakemake supposed to match up{frr}
to anything? need quotes there. also the input and output variables aren't indexed with [] but use.
like you did in therawFastqc
In addition, rule all has input for rule fastqc only, not for fastp rule. In fastp rule, output html is not quoted like other outputs. Threads in fastp rule are declared, but not used.
Does the snakemake interpreter agree with your feelings that the code is incorrect? What does it say exactly when you try to run a rule?
When I dry run the code I get this kind of message, but according to me it should show me my jobs that are running fastqc and fastp and that's the reason I feel something is not right
By the way, I've merged your comments into a single comment and cleaned up a little.
i will take care of it and thanks for the suggestions
can you post the command you are running? Since it is a dry-run there would not be any jobs (and ids) AFAIK. But if you want to check what programs are going to be executed with parameter, try adding
-p
to the dry-run code.