Commit 36a3562c authored by Xavier Grand's avatar Xavier Grand
Browse files

Modif idx genome to Channel

parent e308fa07
......@@ -20,6 +20,7 @@ Maintainer Xavier Grand <xavier.grand@ens-lyon.fr>
def helpMessage() {
log.info"""
Usage:
Pipeline dedicated to transcriptomic analysis of short-reads paired-ends RNAseq.
The typical command for running the pipeline is as follows:
nextflow ./src/RNAseq_XGR.nf -c ./src/nextflow.config -profile singularity
......@@ -63,6 +64,7 @@ params.fastq = "${project}/fastq/*_{1,2}.fq.gz"
params.gtf = ""
params.fasta = ""
params.idx = ""
params.filter_bam = "-F 268 -f 1 -q 10"
params.fastp_out = "$params.project/fastp/"
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"
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 { 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 {
// fastp
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 ###################
if (params.idx == "") {
......@@ -145,7 +137,7 @@ workflow {
index_with_gtf(genome_file, gtf_file.collect())
mapping_fastq(index_with_gtf.out.index.collect(), fastp.out.fastq)
htseq_count(mapping_fastq.out.bam, gtf_file)
}
else {
idx_genome = "${params.idx}"
......@@ -153,7 +145,23 @@ workflow {
.of( idx_genome )
.set { genome_indexed_input }
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_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
"""
}
params.idx = ""
process mapping_withindex {
container = "${container_url}"
label "big_mem_multi_cpus"
......@@ -194,6 +193,7 @@ process mapping_withindex {
}
input:
val(index)
tuple val(reads_id), path(reads)
output:
......@@ -210,7 +210,7 @@ if (reads_id instanceof List){
if (reads.size() == 2)
"""
STAR --runThreadN ${task.cpus} \
--genomeDir ${params.idx} \
--genomeDir ${index} \
--readFilesCommand zcat \
--readFilesIn ${reads[0]} ${reads[1]} \
--outFileNamePrefix ${reads_id}. \
......@@ -223,7 +223,7 @@ mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
else
"""
STAR --runThreadN ${task.cpus} \
--genomeDir ${params.idx} \
--genomeDir ${index} \
--readFilesCommand zcat \
--readFilesIn ${reads} \
--outFileNamePrefix ${reads_id}. \
......
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