Commit fb1a9266 authored by Damien VINTACHE's avatar Damien VINTACHE
Browse files

utilisation de conda dans les commandes snakemake

parent 8117bc65
......@@ -11,8 +11,8 @@ export LC_ALL=en_US.utf8
export LANG=en_US.utf-8
# Activation of conda virtual environment
echo "=== activate the conda environment ==="
source activate rnaSeqQuantif
#echo "=== activate the conda environment ==="
#source activate rnaSeqQuantif
# Configure json environment : Single End or Pair Ends
echo "=== configure the pipeline environement ==="
......@@ -21,7 +21,7 @@ echo "=== configure the pipeline environement ==="
# Run pipeline
echo "=== run the pipeline ==="
echo "number of snakemake jobs : $SNAKEMAKE_JOBS"
snakemake -rp --jobs ${2} --config projf="CONFIG/project.json" reff="CONFIG/references.json" conff="CONFIG/config.json"
snakemake -rp --jobs ${2} --config projf="CONFIG/project.json" reff="CONFIG/references.json" conff="CONFIG/config.json" --use-conda
# check the result
echo "=== check the result ==="
......@@ -38,5 +38,5 @@ else
fi
# Desactivation of the conda virtual environment
echo "=== deactivate the conda environment ==="
source deactivate
#echo "=== deactivate the conda environment ==="
#source deactivate
name: deseq2
channels:
- dougal
- r
- bird
- conda-forge
- bioconda
- defaults
dependencies:
- bioconductor-annotate=1.56.0=r3.4.1_0
- bioconductor-annotationdbi=1.40.0=r3.4.1_0
- bioconductor-biobase=2.38.0=r3.4.1_0
- bioconductor-biocgenerics=0.24.0=r3.4.1_0
- bioconductor-biocparallel=1.12.0=r3.4.1_0
- bioconductor-biomart=2.34.2=r3.4.1_0
- bioconductor-delayedarray=0.4.1=r3.4.1_0
- bioconductor-deseq2=1.18.1=r3.4.1_1
- bioconductor-genefilter=1.60.0=r3.4.1_0
- bioconductor-geneplotter=1.56.0=r3.4.1_0
- bioconductor-genomeinfodb=1.14.0=r3.4.1_0
- bioconductor-genomeinfodbdata=1.0.0=r3.4.1_1
- bioconductor-genomicranges=1.30.3=r3.4.1_0
- bioconductor-iranges=2.12.0=r3.4.1_0
- bioconductor-s4vectors=0.16.0=r3.4.1_0
- bioconductor-summarizedexperiment=1.8.0=r3.4.1_0
- bioconductor-tximport=1.6.0=r3.4.1_0
- bioconductor-xvector=0.18.0=r3.4.1_0
- bioconductor-zlibbioc=1.24.0=r3.4.1_0
- bzip2=1.0.6=h470a237_2
- ca-certificates=2018.4.16=0
- cairo=1.14.12=he56eebe_1
- curl=7.60.0=0
- fontconfig=2.13.0=h074f895_2
- freetype=2.8.1=0
- gettext=0.19.8.1=0
- glib=2.55.0=0
- graphite2=1.3.11=hfc679d8_0
- gsl=2.1=2
- harfbuzz=1.7.6=0
- icu=58.2=hfc679d8_0
- jpeg=9c=h470a237_0
- krb5=1.14.6=0
- libffi=3.2.1=3
- libiconv=1.15=h470a237_1
- libpng=1.6.34=ha92aebf_1
- libssh2=1.8.0=h5b517e9_2
- libtiff=4.0.9=he6b73bb_1
- libuuid=1.0.3=1
- libxcb=1.13=h470a237_1
- libxml2=2.9.8=h422b904_2
- ncurses=5.9=10
- openssl=1.0.2o=0
- pango=1.40.14=hd50be51_1
- pcre=8.39=0
- pixman=0.34.0=2
- pthread-stubs=0.4=h470a237_1
- r-acepack=1.4.1=r3.4.1_0
- r-assertthat=0.2.0=r3.4.1_0
- r-backports=1.1.2=r3.4.1_0
- r-base=3.4.1=4
- r-base64enc=0.1_3=r3.4.1_0
- r-bh=1.66.0_1=r3.4.1_0
- r-bit=1.1_12=r3.4.1_0
- r-bit64=0.9_5=r3.4.1_0
- r-bitops=1.0_6=r3.4.1_0
- r-blob=1.1.1=r3.4.1_0
- r-catools=1.17.1=r3.4.1_0
- r-checkmate=1.8.5=r3.4.1_0
- r-cli=1.0.0=r3.4.1_0
- r-cluster=2.0.6=r3.4.1_0
- r-colorspace=1.3_2=r3.4.1_0
- r-crayon=1.3.4=r3.4.1_0
- r-curl=3.2=r3.4.1_0
- r-data.table=1.11.4=r341hc070d10_0
- r-dbi=1.0.0=r341_0
- r-dichromat=2.0_0=r3.4.1_0
- r-digest=0.6.15=r3.4.1_0
- r-evaluate=0.10.1=r3.4.1_0
- r-foreign=0.8_67=r3.4.1_0
- r-formula=1.2_1=r3.4.1_0
- r-futile.logger=1.4.3=r3.4.1_0
- r-futile.options=1.0.0=r3.4.1_0
- r-gdata=2.18.0=r3.4.1_0
- r-getopt=1.20.2=r3.4.1_0
- r-ggplot2=3.0.0=r341h6115d3f_0
- r-glue=1.2.0=r3.4.1_0
- r-gplots=3.0.1=r3.4.1_0
- r-gridextra=2.3=r3.4.1_0
- r-gtable=0.2.0=r3.4.1_0
- r-gtools=3.8.1=r341_0
- r-highr=0.7=r341_0
- r-hmisc=4.0_3=r3.4.1_0
- r-hms=0.3=r3.4.1_0
- r-htmltable=1.9=r3.4.1_0
- r-htmltools=0.3.6=r3.4.1_0
- r-htmlwidgets=1.0=r3.4.1_0
- r-httr=1.3.1=r3.4.1_0
- r-jsonlite=1.5=r3.4.1_0
- r-kernsmooth=2.23_15=r3.4.1_0
- r-knitr=1.20=r3.4.1_0
- r-labeling=0.3=r3.4.1_0
- r-lambda.r=1.2=r3.4.1_0
- r-lattice=0.20_34=r3.4.1_0
- r-latticeextra=0.6_28=r3.4.1_0
- r-lazyeval=0.2.1=r3.4.1_0
- r-locfit=1.5_9.1=r3.4.1_0
- r-magrittr=1.5=r3.4.1_0
- r-markdown=0.8=r3.4.1_1
- r-mass=7.3_50=r341hc070d10_0
- r-matrix=1.2_14=r3.4.1_0
- r-matrixstats=0.53.1=r341_0
- r-memoise=1.1.0=r3.4.1_0
- r-mgcv=1.8_24=r341_0
- r-mime=0.5=r3.4.1_0
- r-munsell=0.5.0=r341_0
- r-nlme=3.1_131=r3.4.1_0
- r-nnet=7.3_12=r3.4.1_0
- r-openssl=1.0.1=r3.4.1_0
- r-pillar=1.2.2=r341h6115d3f_1
- r-pkgconfig=2.0.1=r3.4.1_0
- r-plogr=0.2.0=r341h6115d3f_0
- r-plyr=1.8.4=r3.4.1_0
- r-prettyunits=1.0.2=r3.4.1_0
- r-progress=1.2.0=r341_0
- r-r6=2.2.2=r3.4.1_0
- r-rcolorbrewer=1.1_2=r3.4.1_0
- r-rcpp=0.12.17=r341h9d2a408_0
- r-rcpparmadillo=0.8.500.0=r3.4.1_0
- r-rcurl=1.95_4.11=r341ha4d7672_0
- r-reshape2=1.4.3=r3.4.1_0
- r-rjson=0.2.15=r3.4.1_0
- r-rlang=0.2.1=r341_0
- r-rpart=4.1_13=r3.4.1_0
- r-rsqlite=2.0=r3.4.1_0
- r-scales=0.5.0=r3.4.1_0
- r-snow=0.4_2=r3.4.1_0
- r-stringi=1.2.3=r341_0
- r-stringr=1.3.1=r341_0
- r-survival=2.42_6=r341_0
- r-tibble=1.4.2=r3.4.1_0
- r-utf8=1.1.3=r3.4.1_0
- r-viridis=0.5.1=r3.4.1_0
- r-viridislite=0.3.0=r3.4.1_0
- r-withr=2.1.1=r3.4.1_0
- r-xml=3.98_1.11=r341_0
- r-xtable=1.8_2=r3.4.1_0
- r-yaml=2.1.19=r341_0
- readline=7.0=0
- tk=8.6.7=0
- xorg-kbproto=1.0.7=h470a237_2
- xorg-libice=1.0.9=h470a237_3
- xorg-libsm=1.2.2=h470a237_3
- xorg-libx11=1.6.5=h470a237_1
- xorg-libxau=1.0.8=h470a237_5
- xorg-libxdmcp=1.1.2=h470a237_6
- xorg-libxext=1.3.3=h470a237_3
- xorg-libxrender=0.9.10=h470a237_1
- xorg-renderproto=0.11.1=h470a237_2
- xorg-xextproto=7.3.0=h470a237_2
- xorg-xproto=7.0.31=h470a237_7
- xz=5.2.3=0
- zlib=1.2.11=h470a237_3
- libgcc=7.2.0=h69d50b8_2
- libgcc-ng=7.2.0=hdf63c60_3
- libstdcxx-ng=7.2.0=hdf63c60_3
- wget=1.19.5=h1ad7b7a_0
prefix: /home/vintache-d/miniconda3/envs/deseq2
name: rnaSeqQuantif
channels:
- ostrokach
- dougal
- r
- bird
- conda-forge
- bioconda
- defaults
dependencies:
- bcftools=1.8=h4da6232_3
- cutadapt=1.16=py36_2
- fastqc=0.11.7=4
- filechunkio=1.6=py36_0
- ftputil=3.2=py36_0
- htseq=0.9.1=py36h24bf2e0_1
- htslib=1.7=0
- libdeflate=1.0=h470a237_0
- multiqc=1.6a0=py36h24bf2e0_2
- perl-threaded=5.22.0=13
- prinseq=0.20.4=2
- pyasn1-modules=0.0.5=py36_0
- pygraphviz=1.3.1=py36_0
- pysam=0.14.1=py36hae42fb6_1
- pysftp=0.2.9=py36_0
- rsa=3.1.4=py36_0
- samtools=1.7=1
- simplejson=3.8.1=py36_0
- snakemake=5.2.0=py36_0
- star=2.6.0c=1
- urllib3=1.12=py36_0
- xopen=0.3.2=py_1
- aioeasywebdav=2.2.0=py36_0
- aiohttp=3.3.2=py36h14c3975_0
- appdirs=1.4.3=py_1
- asn1crypto=0.24.0=py_1
- async-timeout=3.0.0=py36_0
- attrs=18.1.0=py_1
- boto3=1.7.58=py_0
- botocore=1.10.58=py_0
- bzip2=1.0.6=h470a237_2
- ca-certificates=2018.4.16=0
- cachetools=2.0.1=py_0
- cairo=1.14.10=0
- certifi=2018.4.16=py36_0
- cffi=1.11.5=py36_0
- chardet=3.0.4=py36_2
- click=6.7=py_1
- colormath=3.0.0=py_2
- configargparse=0.13.0=py_1
- cryptography=2.2.1=py36hdffb7b8_1
- curl=7.60.0=0
- cycler=0.10.0=py_1
- dbus=1.13.0=h3a4f0e9_0
- decorator=4.3.0=py_0
- docutils=0.14=py36_0
- dropbox=7.3.1=py36_0
- expat=2.2.5=hfc679d8_1
- fontconfig=2.12.6=0
- freetype=2.8.1=0
- future=0.16.0=py_1
- gettext=0.19.8.1=0
- glib=2.55.0=0
- google-auth=1.2.1=py_0
- google-auth-httplib2=0.0.2=py36_0
- google-cloud-core=0.24.1=py36_0
- google-cloud-storage=1.1.1=py36_0
- google-resumable-media=0.0.2=py36_0
- googleapis-common-protos=1.5.3=py_1
- graphite2=1.3.11=hfc679d8_0
- graphviz=2.38.0=7
- gst-plugins-base=1.8.0=0
- gstreamer=1.8.0=1
- harfbuzz=1.7.6=0
- httplib2=0.11.3=py36_0
- icu=58.2=hfc679d8_0
- idna=2.7=py36_2
- idna_ssl=1.0.0=0
- jinja2=2.10=py_1
- jmespath=0.9.3=py_1
- jpeg=9c=h470a237_0
- jsonschema=2.6.0=py36_1
- kiwisolver=1.0.1=py36_1
- krb5=1.14.6=0
- libffi=3.2.1=3
- libiconv=1.15=h470a237_1
- libpng=1.6.34=ha92aebf_1
- libprotobuf=3.5.2=hd28b015_1
- libssh2=1.8.0=h5b517e9_2
- libtiff=4.0.9=he6b73bb_1
- libtool=2.4.6=0
- libxcb=1.13=h470a237_1
- libxml2=2.9.8=h422b904_2
- lzstring=1.0.3=py36_0
- markdown=2.6.11=py_0
- markupsafe=1.0=py36_0
- matplotlib=2.2.2=py36_1
- mkl_fft=1.0.2=py36_0
- mkl_random=1.0.1=py36_0
- multidict=4.3.1=py36h470a237_0
- ncurses=6.1=0
- networkx=2.0=py36_1
- openjdk=8.0.144=zulu8.23.0.3_1
- openssl=1.0.2o=0
- pandas=0.23.3=py36_0
- pango=1.40.14=0
- paramiko=2.4.1=py36_0
- pcre=8.41=1
- perl=5.26.2=h470a237_0
- pigz=2.3.4=0
- pip=9.0.3=py36_0
- pixman=0.34.0=2
- prettytable=0.7.2=py_2
- protobuf=3.5.2=py36_0
- psutil=5.4.6=py36_0
- pthread-stubs=0.4=h470a237_1
- pyasn1=0.4.3=py_0
- pycparser=2.18=py_1
- pynacl=1.1.2=py36_0
- pyparsing=2.2.0=py_1
- pyqt=5.6.0=py36h8210e8a_6
- python-dateutil=2.7.3=py_0
- python-irodsclient=0.7.0=py_0
- pytz=2018.5=py_0
- pyyaml=3.12=py36_1
- qt=5.6.2=7
- ratelimiter=1.2.0=py36_0
- requests=2.13.0=py36_0
- s3transfer=0.1.13=py36_0
- setuptools=40.0.0=py36_0
- sip=4.18=py36_1
- six=1.11.0=py36_1
- spectra=0.0.11=py_0
- sqlite=3.20.1=0
- tk=8.6.7=0
- tornado=5.1=py36_0
- wheel=0.31.1=py36_0
- wrapt=1.10.11=py36_0
- xmlrunner=1.7.7=py_0
- xorg-libxau=1.0.8=h470a237_5
- xorg-libxdmcp=1.1.2=h470a237_6
- xz=5.2.3=0
- yaml=0.1.7=0
- yarl=1.2.6=py36h470a237_0
- zlib=1.2.11=h470a237_3
- bcrypt=3.1.4=py36h14c3975_0
- bz2file=0.98=py36_1
- datrie=0.7.1=py36_0
- intel-openmp=2018.0.3=0
- libgcc=7.2.0=h69d50b8_2
- libgcc-ng=7.2.0=hdf63c60_3
- libgfortran-ng=7.2.0=hdf63c60_3
- libstdcxx-ng=7.2.0=hdf63c60_3
- mkl=2018.0.3=1
- numpy=1.14.2=py36hdbf6ddf_1
- python=3.6.4=hc3d631a_1
- readline=7.0=ha6073c6_4
- gzip=1.7=1
prefix: /home/vintache-d/miniconda3/envs/rnaSeqQuantif
......@@ -15,7 +15,7 @@ def getFastqs(wildcards):
chunks.append(pair["forward"]["path"])
if(wildcards.read == "R2"):
for pair in s["files"]:
chunks.append(pair["reverse"]["path"])
chunks.append(pair["reverse"]["path"])
return chunks
def getFastqPair(wildcards):
......@@ -38,7 +38,7 @@ def getCleanedFastq(wildcards):
if(wildcards.read == "R2"):
for nb in range(nbPairs):
fastqs.append(OUTPUTDIR+"/Samples/"+s["sample"]+"/CUTADAPT/"+s["sample"]+"_"+str(nb)+"_R2.fastq.gz")
fastqs.sort()
fastqs.sort()
return fastqs
def getConditions():
......@@ -49,7 +49,7 @@ def getConditions():
sd["samplename"] = s
sd["filename"] = s
sd["condition"] = cond
sampleList.append(sd)
sampleList.append(sd)
return sampleList
......@@ -92,7 +92,7 @@ OVERHANG = int(config["read-length"]) - 1
# List samples to trigger the target rule to create
sample_all = list()
for s in config["samples"]:
sample_all.append(s["sample"])
sample_all.append(s["sample"])
# List of the direction of the read
reads=["R1","R2"]
......@@ -101,14 +101,14 @@ reads=["R1","R2"]
###############################################
###############################################
rule all:
input:
rule all:
input:
qc=OUTPUTDIR+"/Report/data/general/fastqc/multiqc_report.html",
index=expand(OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam.bai",sampleName=sample_all) ,
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
......@@ -117,6 +117,7 @@ rule all:
rule fastqc:
input: OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}.fastq.gz"
output: OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}_fastqc.html"
conda: CONDA/rnaSeqQuantif.yml
shell: "fastqc -o " + OUTPUTDIR+"/Samples/{wildcards.sampleName}/FASTQC/ {input}"
rule concat_fastq_chunks:
......@@ -129,27 +130,29 @@ rule concat_fastq_chunks:
rule multiQC:
input: expand(OUTPUTDIR+"/Samples/{sampleName}/FASTQC/{sampleName}_{read}_fastqc.html", sampleName=sample_all, read=reads)
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"
rule dezipFastq:
input: getFastqPair
output: temp(OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_{strand}.temp.fastq")
shell: """
gzip -dc {input} > {output}
gzip -dc {input} > {output}
"""
rule prinseq:
input: expand(OUTPUTDIR+"/Samples/{{sampleName}}/PRINSEQ/{{sampleName}}_{{pairNumber}}_{strand}.temp.fastq", strand=reads)
output: expand(OUTPUTDIR+"/Samples/{{sampleName}}/PRINSEQ/{{sampleName}}_{{pairNumber}}_{suffixe}.fastq", suffixe=["bad_1","bad_2","good_1","good_2","good_1_singletons","good_2_singletons"]),
output: expand(OUTPUTDIR+"/Samples/{{sampleName}}/PRINSEQ/{{sampleName}}_{{pairNumber}}_{suffixe}.fastq", suffixe=["bad_1","bad_2","good_1","good_2","good_1_singletons","good_2_singletons"]),
log = OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}.log"
params: preGood = OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_good",
preBad = OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_bad"
conda: CONDA/rnaSeqQuantif.yml
shell: """
perl `which prinseq-lite.pl` -min_qual_mean 30 -no_qual_header -fastq {input[0]} -fastq2 {input[1]} -out_good {params.preGood} -out_bad {params.preBad} -log {output.log}
if(! test -f {params.preBad}_1.fastq);then touch {params.preBad}_1.fastq {params.preGood}_1_singletons.fastq;fi
if(! test -f {params.preBad}_2.fastq);then touch {params.preBad}_2.fastq {params.preGood}_2_singletons.fastq;fi
"""
rule concatPrintseqOutput:
input: bad = OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_bad_{strand}.fastq",
good = OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_good_{strand}.fastq",
......@@ -161,17 +164,19 @@ rule concatPrintseqOutput:
"""
rule cutadaptR1:
input: OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_R1.fastq.gz"
input: OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_R1.fastq.gz"
output: fastq = OUTPUTDIR+"/Samples/{sampleName}/CUTADAPT/{sampleName}_{pairNumber}_R1.fastq.gz",
report = OUTPUTDIR+"/Samples/{sampleName}/CUTADAPT/{sampleName}_{pairNumber}_R1.fastq.report"
conda: CONDA/rnaSeqQuantif.yml
shell: """
cutadapt -a {FWADAPT} 2> {output.report} {input} | java -jar {SCRIPTPATH}/pademptyfastq-fat.jar 2> /dev/null | gzip --best -c > {output.fastq}
"""
rule cutadaptR2:
input: OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_R2.fastq.gz"
input: OUTPUTDIR+"/Samples/{sampleName}/PRINSEQ/{sampleName}_{pairNumber}_R2.fastq.gz"
output: fastq = OUTPUTDIR+"/Samples/{sampleName}/CUTADAPT/{sampleName}_{pairNumber}_R2.fastq.gz",
report = OUTPUTDIR+"/Samples/{sampleName}/CUTADAPT/{sampleName}_{pairNumber}_R2.fastq.report"
conda: CONDA/rnaSeqQuantif.yml
shell: """
cutadapt -a {RVADAPT} 2> {output.report} {input} | java -jar {SCRIPTPATH}/pademptyfastq-fat.jar 2> /dev/null | gzip --best -c > {output.fastq}
"""
......@@ -189,6 +194,7 @@ rule genomeFiles:
FASTA
output: GENOMEDIR+"/Genome"
params: cpu=config["align-cpu"]
conda: CONDA/rnaSeqQuantif.yml
shell: """
STAR --runThreadN {params.cpu} --runMode genomeGenerate --genomeDir {GENOMEDIR} --genomeFastaFiles {FASTA} --sjdbGTFfile {GTF} --sjdbOverhang {OVERHANG}
"""
......@@ -200,6 +206,7 @@ rule star_PE:
genome=GENOMEDIR+"/Genome"
output: OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam"
params: cpu=config["align-cpu"]
conda: CONDA/rnaSeqQuantif.yml
shell: """
STAR --runThreadN {params.cpu} --genomeDir {GENOMEDIR} --readFilesCommand zcat --outFileNamePrefix {OUTPUTDIR}/Samples/{wildcards.sampleName}/STAR/{wildcards.sampleName} --readFilesIn {input.R1} {input.R2} --outSAMtype BAM SortedByCoordinate --outBAMsortingThreadN 6
"""
......@@ -208,13 +215,15 @@ rule star_PE:
rule createBamIndex:
input: OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam"
output: OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam.bai"
conda: CONDA/rnaSeqQuantif.yml
shell: "samtools sort {input} | samtools index - {output}"
rule htseq:
input: OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam"
output: OUTPUTDIR+"/DESEQ2/counts/{sampleName}"
run:
conda: CONDA/rnaSeqQuantif.yml
run:
if (config["library-type"]=="fr-secondstrand"):
strand="reverse"
elif (config["library-type"]=="fr-firststrand"):
......@@ -226,7 +235,7 @@ rule htseq:
rule deseq2_conditions:
output: tab = OUTPUTDIR+"/DESEQ2/DESEQ2_CONDITIONS.tab"
run:
run:
condArray = getConditions()
with open(output.tab, 'w') as condfile:
condfile.write("samplename"+"\t"+"filename"+"\t"+"condition"+"\n")
......@@ -235,14 +244,11 @@ rule deseq2_conditions:
rule deseq2:
input:
input:
conditions=OUTPUTDIR+"/DESEQ2/DESEQ2_CONDITIONS.tab",
counts=expand(OUTPUTDIR+"/DESEQ2/counts/{sampleName}",sampleName=sample_all)
output: expand(OUTPUTDIR+"/DESEQ2/results/{suffixe}",suffixe=["NormalizedCountMatrix.txt","NormalizedCountMatrixFiltered.txt","PCAplot.png","sampletosampledistance.jpeg"])
conda: CONDA/deseq2.yml
shell: """
source deactivate
source activate deseq2
cat {SCRIPTPATH}/run_deseq2.R | R --slave --args {input.conditions} {OUTPUTDIR}/DESEQ2/counts {OUTPUTDIR}/DESEQ2/results {BIOMART}
cat {SCRIPTPATH}/run_deseq2.R | R --slave --args {input.conditions} {OUTPUTDIR}/DESEQ2/counts {OUTPUTDIR}/DESEQ2/results {BIOMART}
"""
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