Commit 006e01ca authored by Audrey BIHOUEE's avatar Audrey BIHOUEE
Browse files

From 3 to 2 config files; updated snakefile with one more fastqc and multiQC on STAR

parent 7dc56131
......@@ -68,7 +68,7 @@ def getTargetAll(wildcards):
## snakemake --config projf="project.json" reff="references.json" conff="config.json" -nrp
########## loading configuration variable ##################
configfile: config["reff"]
#configfile: config["reff"]
configfile: config["projf"]
configfile: config["conff"]
......@@ -77,11 +77,15 @@ SNAKEFILEDIR = workflow.basedir
OUTPUTDIR = os.path.abspath(config["outdir"])
SCRIPTPATH = os.path.join(SNAKEFILEDIR,"scripts")
GTF = config[config["reference"]]["gtf"]
FASTA = config[config["reference"]]["fasta"]
GTF = config["reference"]["gtf"]
FASTA = config["reference"]["fasta"]
FASTABASENAME = os.path.splitext(FASTA)[0]
BIOMART = config[config["reference"]]["biomart"]
GENOMEDIR=config["genomeDir"]
BIOMART = config["reference"]["biomart"]
GENOMEDIR=config["reference"]["STARindexDir"]
FWADAPT=config["cutadapt-forward"]
RVADAPT=config["cutadapt-reverse"]
......@@ -104,15 +108,10 @@ reads=["R1","R2"]
rule all:
input:
qc=OUTPUTDIR+"/Report/data/general/fastqc/multiqc_report.html",
#fastqc=expand(OUTPUTDIR+"/Samples/{sampleName}/FASTQC_cleaned/{sampleName}_{read}.concat_fastqc.html",sampleName=sample_all,read=reads)
index=expand(OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam.bai",sampleName=sample_all) ,
deg=expand(OUTPUTDIR+"/DESEQ2/results/{suffixe}",suffixe=["NormalizedCountMatrix.txt","NormalizedCountMatrixFiltered.txt","PCAplot.png","sampletosampledistance.jpeg"])
#input: expand(OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.out.bam",sampleName=sample_all)
#############
## Test the rule with : ./test/fastqc-test.sh
## --> requirements : test/project-test.json, test/config-test.json, test/references-test.json
## --> snakemake -s Snakefile_RNAseq_quantif -rp fastqc
##
rule fastqc:
input: OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}.fastq.gz"
......@@ -120,6 +119,12 @@ rule fastqc:
conda: "CONDA/fastQC.yml"
shell: "fastqc -o " + OUTPUTDIR+"/Samples/{wildcards.sampleName}/FASTQC/ {input}"
rule fastqc_cleaned:
input: OUTPUTDIR+"/Samples/{sampleName}/CUTADAPT/{sampleName}_{read}.concat.fastq.gz"
output: OUTPUTDIR+"/Samples/{sampleName}/FASTQC_cleaned/{sampleName}_{read}.concat_fastqc.html"
conda: "CONDA/fastQC.yml"
shell: "fastqc -o " + OUTPUTDIR+"/Samples/{wildcards.sampleName}/FASTQC_cleaned/ {input}"
rule concat_fastq_chunks:
input: getFastqs
output: temp(OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}.fastq.gz")
......@@ -128,7 +133,9 @@ rule concat_fastq_chunks:
shell("cat {chunks} > {output}")
rule multiQC:
input: expand(OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}_fastqc.html", sampleName=sample_all, read=reads)
input: f1=expand(OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}_fastqc.html", sampleName=sample_all, read=reads),
f2=expand(OUTPUTDIR+"/Samples/{sampleName}/FASTQC_cleaned/{sampleName}_{read}.concat_fastqc.html", sampleName=sample_all, read=reads),
bam=expand(OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam", sampleName=sample_all)
output: OUTPUTDIR+"/Report/data/general/fastqc/multiqc_report.html"
conda: "CONDA/rnaSeqQuantif.yml"
shell: "multiqc -f -e general_stats -e tophat -e bowtie2 " + OUTPUTDIR+"/Samples -o "+ OUTPUTDIR +"/Report/data/general/fastqc"
......@@ -225,10 +232,10 @@ rule htseq:
params: library_type=config["library-type"]
conda: "CONDA/rnaSeqQuantif.yml"
shell: """
if [ {params.library_type} = "fr-secondstrand" ]
if [ {params.library_type} = "reverse" ]
then
htseq-count -s reverse -f bam {input} {GTF} > {output}
elif [ {params.library_type} = "fr-firststrand" ]
elif [ {params.library_type} = "yes" ]
then
htseq-count -s yes -f bam {input} {GTF} > {output}
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment