Skip to content
Snippets Groups Projects
Commit fb686f83 authored by elabaron's avatar elabaron
Browse files

src/RNAseq.nf : cosmetic changes

parent ba8ad15c
No related branches found
No related tags found
No related merge requests found
...@@ -2,18 +2,41 @@ ...@@ -2,18 +2,41 @@
* RNAseq Analysis pipeline * RNAseq Analysis pipeline
*/ */
//////////////////////////////////////////////////////
// PARAMETERS //
//////////////////////////////////////////////////////
///////////////////////
// PARMS : FILE PATH //
///////////////////////
params.fastq_raw = "data/fastq/*{_R1,_R2}.fastq.gz" params.fastq_raw = "data/fastq/*{_R1,_R2}.fastq.gz"
params.output = "results" params.output = "results"
params.do_fastqc = true
//params.script_cov = "src/norm_coverage.sh"
params.filter = "data/filter/human_rRNA_tRNA/*.bt2" params.filter = "data/filter/human_rRNA_tRNA/*.bt2"
params.index_genome = "data/genome/*.ht2" params.index_genome = "data/genome/*.ht2"
params.do_dedup = true
params.gtf = "data/annotation/*.gtf" params.gtf = "data/annotation/*.gtf"
params.gtf_collapse = "data/annotation/*.gtf" params.gtf_collapse = "data/annotation/*.gtf"
params.index_postgenome = "data/post_genome/*.ht2" params.index_postgenome = "data/post_genome/*.ht2"
/////////////////////
// PARMS : OPTIONS //
/////////////////////
params.do_fastqc = true
params.do_dedup = true
params.do_postgenome = true params.do_postgenome = true
////////////////////////
// ADAPTORS SEQUENCES //
////////////////////////
params.adaptorR1 = "AGATCGGAAGAGCACACGTCTGAACTCCAGTCA"
params.adaptorR2 = "AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT"
//////////////
// LOG INFO //
//////////////
log.info "input raw : ${params.fastq_raw}" log.info "input raw : ${params.fastq_raw}"
log.info "outut directory : ${params.output}" log.info "outut directory : ${params.output}"
log.info "filter index files : ${params.filter}" log.info "filter index files : ${params.filter}"
...@@ -27,6 +50,10 @@ log.info "do deduplication ? : ${params.do_dedup}" ...@@ -27,6 +50,10 @@ log.info "do deduplication ? : ${params.do_dedup}"
log.info "do post genome alignement ? : ${params.do_postgenome}" log.info "do post genome alignement ? : ${params.do_postgenome}"
log.info "" log.info ""
//////////////
// CHANNELS //
//////////////
Channel Channel
.fromFilePairs(params.fastq_raw) .fromFilePairs(params.fastq_raw)
.ifEmpty { error "Cannot find any file matching: ${params.fastq_raw}" } .ifEmpty { error "Cannot find any file matching: ${params.fastq_raw}" }
...@@ -58,7 +85,18 @@ Channel ...@@ -58,7 +85,18 @@ Channel
.ifEmpty { error "Cannot find any index files matching: ${params.index_postgenome}" } .ifEmpty { error "Cannot find any index files matching: ${params.index_postgenome}" }
.set { POSTGENOME_INDEX } .set { POSTGENOME_INDEX }
//////////////////////////////////////////////////////
// PROCESS //
//////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//////////////////////////// PRE PROCESS ///////////////////////////////
////////////////////////////////////////////////////////////////////////
/////////////////////////
/* Fastqc of raw input */ /* Fastqc of raw input */
/////////////////////////
process fastqc_raw { process fastqc_raw {
tag "$file_id" tag "$file_id"
...@@ -77,7 +115,10 @@ process fastqc_raw { ...@@ -77,7 +115,10 @@ process fastqc_raw {
fastqc ${file_id}* -t ${task.cpus} fastqc ${file_id}* -t ${task.cpus}
""" """
} }
///////////////////////
/* Trimming adaptors */ /* Trimming adaptors */
///////////////////////
process trimming { process trimming {
tag "$file_id" tag "$file_id"
...@@ -119,7 +160,10 @@ process trimming { ...@@ -119,7 +160,10 @@ process trimming {
CUTADAPT_OUTPUT.into{CUTADAPT_OUTPUT_FASTQC; CUTADAPT_OUTPUT.into{CUTADAPT_OUTPUT_FASTQC;
CUTADAPT_OUTPUT_FILTER} CUTADAPT_OUTPUT_FILTER}
/////////////////////////
/* Fastqc of raw input */ /* Fastqc of raw input */
/////////////////////////
process fastqc_cut { process fastqc_cut {
tag "$file_id" tag "$file_id"
...@@ -139,7 +183,9 @@ process fastqc_cut { ...@@ -139,7 +183,9 @@ process fastqc_cut {
""" """
} }
/////////////////////////////
/* rRNA and tRNA filtering */ /* rRNA and tRNA filtering */
/////////////////////////////
process rRNA_removal { process rRNA_removal {
tag "$file_id" tag "$file_id"
...@@ -181,7 +227,9 @@ FILTER_FASTQ.into{FILTER_FASTQ_FASTQC; ...@@ -181,7 +227,9 @@ FILTER_FASTQ.into{FILTER_FASTQ_FASTQC;
FILTER_FASTQ_POSTGENOME FILTER_FASTQ_POSTGENOME
} }
/////////////////////////////
/* Fastqc of filtred reads */ /* Fastqc of filtred reads */
/////////////////////////////
process fastqc_filter { process fastqc_filter {
tag "$file_id" tag "$file_id"
...@@ -201,7 +249,15 @@ process fastqc_filter { ...@@ -201,7 +249,15 @@ process fastqc_filter {
""" """
} }
///////////////////////////////////////////////////////////////////
//////////////////////////// GENOME ///////////////////////////////
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////
/* mapping against human genome with hisat2 */ /* mapping against human genome with hisat2 */
///////////////////////////////////////////////
process hisat2_human { process hisat2_human {
tag "$file_id" tag "$file_id"
...@@ -245,8 +301,9 @@ fi ...@@ -245,8 +301,9 @@ fi
HISAT_ALIGNED.into{HISAT_ALIGNED_FASTQC; HISAT_ALIGNED.into{HISAT_ALIGNED_FASTQC;
HISAT_ALIGNED_DEDUP} HISAT_ALIGNED_DEDUP}
////////////////////////////
/* Fastqc of genome reads */ /* Fastqc of genome reads */
////////////////////////////
process fastqc_genome { process fastqc_genome {
tag "$file_id" tag "$file_id"
...@@ -266,7 +323,9 @@ process fastqc_genome { ...@@ -266,7 +323,9 @@ process fastqc_genome {
""" """
} }
////////////////////////////
/* Deduplication of reads */ /* Deduplication of reads */
////////////////////////////
process dedup_genome { process dedup_genome {
tag "$file_id" tag "$file_id"
...@@ -297,7 +356,9 @@ DEDUP_GENOME.into{DEDUP_GENOME_HTSEQ; ...@@ -297,7 +356,9 @@ DEDUP_GENOME.into{DEDUP_GENOME_HTSEQ;
DEDUP_GENOME_RNASEQC DEDUP_GENOME_RNASEQC
} }
///////////
/* HTseq */ /* HTseq */
///////////
process sort_bam { process sort_bam {
tag "$file_id" tag "$file_id"
...@@ -348,7 +409,9 @@ htseq-count ${bam[0]} ${gtf} \ ...@@ -348,7 +409,9 @@ htseq-count ${bam[0]} ${gtf} \
""" """
} }
/* HTseq */ ///////////////
/* RNASEQ QC */
///////////////
process rnaseq_qc { process rnaseq_qc {
tag "$file_id" tag "$file_id"
...@@ -372,8 +435,9 @@ rnaseqc ${gtf} ${bam[0]} -s ${file_id} ./ \ ...@@ -372,8 +435,9 @@ rnaseqc ${gtf} ${bam[0]} -s ${file_id} ./ \
//////////////////////////// POST GENOME /////////////////////////////// //////////////////////////// POST GENOME ///////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/////////////////////////
/* HISAT2 POST_GENOMIC */ /* HISAT2 POST_GENOMIC */
/////////////////////////
process hisat2_postGenomic { process hisat2_postGenomic {
tag "$file_id" tag "$file_id"
...@@ -418,7 +482,9 @@ fi ...@@ -418,7 +482,9 @@ fi
POSTGENOME_ALIGNED.into{POSTGENOME_ALIGNED_FASTQC; POSTGENOME_ALIGNED.into{POSTGENOME_ALIGNED_FASTQC;
POSTGENOME_ALIGNED_DEDUP} POSTGENOME_ALIGNED_DEDUP}
////////////////////////////
/* Deduplication of reads */ /* Deduplication of reads */
////////////////////////////
process dedup_postgenome { process dedup_postgenome {
tag "$file_id" tag "$file_id"
...@@ -459,34 +525,14 @@ process fastqc_postgenome { ...@@ -459,34 +525,14 @@ process fastqc_postgenome {
""" """
} }
/* ////////////////////////////////////////////////////////////////////////
Channel //////////////////////////// POST PROCESS //////////////////////////////
.fromFilePairs(params.script_cov) ////////////////////////////////////////////////////////////////////////
.ifEmpty { error "Cannot find any file matching: ${params.script_cov}" }
.set {script_channel}
process coverage {
tag "$file_id"
publishDir "${params.output}/05_coverage/", mode: 'copy'
input:
set file_id, file(bam) from sorted_bam_coverage
set script from script_channel.collect()
output:
file "*.bw" into coverage_files
script:
"""
bash ${script} -b ${bam} \
-o {file_id}.bw \
--binSize 1 \
-p ${cpus} 8
"""
}
*/
/////////////
/* MultiQC */ /* MultiQC */
/////////////
process multiqc { process multiqc {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment