Skip to content
Snippets Groups Projects
Commit 36a3562c authored by Xavier Grand's avatar Xavier Grand
Browse files

Modif idx genome to Channel

parent e308fa07
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ Maintainer Xavier Grand <xavier.grand@ens-lyon.fr> ...@@ -20,6 +20,7 @@ Maintainer Xavier Grand <xavier.grand@ens-lyon.fr>
def helpMessage() { def helpMessage() {
log.info""" log.info"""
Usage: Usage:
Pipeline dedicated to transcriptomic analysis of short-reads paired-ends RNAseq.
The typical command for running the pipeline is as follows: The typical command for running the pipeline is as follows:
nextflow ./src/RNAseq_XGR.nf -c ./src/nextflow.config -profile singularity nextflow ./src/RNAseq_XGR.nf -c ./src/nextflow.config -profile singularity
...@@ -63,6 +64,7 @@ params.fastq = "${project}/fastq/*_{1,2}.fq.gz" ...@@ -63,6 +64,7 @@ params.fastq = "${project}/fastq/*_{1,2}.fq.gz"
params.gtf = "" params.gtf = ""
params.fasta = "" params.fasta = ""
params.idx = "" params.idx = ""
params.filter_bam = "-F 268 -f 1 -q 10"
params.fastp_out = "$params.project/fastp/" params.fastp_out = "$params.project/fastp/"
params.star_mapping_fastq_out = "$params.project/STAR/" params.star_mapping_fastq_out = "$params.project/STAR/"
...@@ -107,6 +109,10 @@ include { index_with_gtf } from "./nf_modules/star/main_2.7.8a.nf" ...@@ -107,6 +109,10 @@ include { index_with_gtf } from "./nf_modules/star/main_2.7.8a.nf"
include { mapping_fastq } from "./nf_modules/star/main_2.7.8a.nf" include { mapping_fastq } from "./nf_modules/star/main_2.7.8a.nf"
include { mapping_withindex } from "./nf_modules/star/main_2.7.8a.nf" include { mapping_withindex } from "./nf_modules/star/main_2.7.8a.nf"
include { htseq_count } from "./nf_modules/htseq/main.nf" include { htseq_count } from "./nf_modules/htseq/main.nf"
include { filter_bam } from "./nf_modules/samtools/main.nf"
include { stats_bam } from "./nf_modules/samtools/main.nf"
include { sort_bam } from "./nf_modules/samtools/main.nf"
include { index_bam } from "./nf_modules/samtools/main.nf"
/* /*
**************************************************************** ****************************************************************
...@@ -120,20 +126,6 @@ workflow { ...@@ -120,20 +126,6 @@ workflow {
// fastp // fastp
fastp(fastq_files) fastp(fastq_files)
//########################## QUALITY CHECKS ###################
// fastqc_rawdata
fastqc_raw(fastq_files)
// fastqc_processed
fastqc_preprocessed(fastp.out.fastq.map { it -> [it [0], it[1]]})
// multiqc
multiqc(
fastqc_raw.out.report
.mix(
fastqc_preprocessed.out.report
).collect()
)
//############ GENOME INDEXATION AND MAPPING ################### //############ GENOME INDEXATION AND MAPPING ###################
if (params.idx == "") { if (params.idx == "") {
...@@ -145,7 +137,7 @@ workflow { ...@@ -145,7 +137,7 @@ workflow {
index_with_gtf(genome_file, gtf_file.collect()) index_with_gtf(genome_file, gtf_file.collect())
mapping_fastq(index_with_gtf.out.index.collect(), fastp.out.fastq) mapping_fastq(index_with_gtf.out.index.collect(), fastp.out.fastq)
htseq_count(mapping_fastq.out.bam, gtf_file)
} }
else { else {
idx_genome = "${params.idx}" idx_genome = "${params.idx}"
...@@ -153,7 +145,23 @@ workflow { ...@@ -153,7 +145,23 @@ workflow {
.of( idx_genome ) .of( idx_genome )
.set { genome_indexed_input } .set { genome_indexed_input }
genome_indexed_input.view() genome_indexed_input.view()
mapping_withindex(fastp.out.fastq) mapping_withindex(genome_indexed_input.collect(), fastp.out.fastq)
htseq_count(mapping_withindex.out.bam, gtf_file) htseq_count(mapping_withindex.out.bam, gtf_file)
} }
htseq_count(mapping_fastq.out.bam, gtf_file)
//########################## QUALITY CHECKS ###################
// fastqc_rawdata
fastqc_raw(fastq_files)
// fastqc_processed
fastqc_preprocessed(fastp.out.fastq.map { it -> [it [0], it[1]]})
// multiqc
multiqc(
fastqc_raw.out.report
.mix(
fastqc_preprocessed.out.report
).collect()
)
} }
...@@ -185,7 +185,6 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam ...@@ -185,7 +185,6 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
""" """
} }
params.idx = ""
process mapping_withindex { process mapping_withindex {
container = "${container_url}" container = "${container_url}"
label "big_mem_multi_cpus" label "big_mem_multi_cpus"
...@@ -194,6 +193,7 @@ process mapping_withindex { ...@@ -194,6 +193,7 @@ process mapping_withindex {
} }
input: input:
val(index)
tuple val(reads_id), path(reads) tuple val(reads_id), path(reads)
output: output:
...@@ -210,7 +210,7 @@ if (reads_id instanceof List){ ...@@ -210,7 +210,7 @@ if (reads_id instanceof List){
if (reads.size() == 2) if (reads.size() == 2)
""" """
STAR --runThreadN ${task.cpus} \ STAR --runThreadN ${task.cpus} \
--genomeDir ${params.idx} \ --genomeDir ${index} \
--readFilesCommand zcat \ --readFilesCommand zcat \
--readFilesIn ${reads[0]} ${reads[1]} \ --readFilesIn ${reads[0]} ${reads[1]} \
--outFileNamePrefix ${reads_id}. \ --outFileNamePrefix ${reads_id}. \
...@@ -223,7 +223,7 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam ...@@ -223,7 +223,7 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
else else
""" """
STAR --runThreadN ${task.cpus} \ STAR --runThreadN ${task.cpus} \
--genomeDir ${params.idx} \ --genomeDir ${index} \
--readFilesCommand zcat \ --readFilesCommand zcat \
--readFilesIn ${reads} \ --readFilesIn ${reads} \
--outFileNamePrefix ${reads_id}. \ --outFileNamePrefix ${reads_id}. \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment