Skip to content
Snippets Groups Projects
Unverified Commit b60be324 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

solution_RNASeq.nf: update to DSL2

parent cecad357
No related branches found
No related tags found
No related merge requests found
nextflow.enable.dsl=2
/*
./nextflow src/solution_RNASeq.nf -c src/solution_RNASeq.config --fastq "data/tiny_dataset/fastq/tiny2_R{1,2}.fastq.gz" --fasta "data/tiny_dataset/fasta/tiny_v2_10.fasta" --bed "data/tiny_dataset/annot/tiny.bed" -profile docker
./nextflow src/solution_RNASeq_DSL2.nf --fastq "data/tiny_dataset/fastq/tiny2_R{1,2}.fastq.gz" --fasta "data/tiny_dataset/fasta/tiny_v2_10.fasta" --bed "data/tiny_dataset/annot/tiny.bed" -profile docker
*/
log.info "fastq files : ${params.fastq}"
......@@ -19,97 +21,16 @@ Channel
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process adaptor_removal {
tag "$pair_id"
publishDir "results/fastq/adaptor_removal/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
set pair_id, "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT -A AGATCGGAAGAG -G CTCTTCCGATCT \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
include { adaptor_removal_pairedend } from './nf_modules/cutadapt/main'
include { trimming_pairedend } from './nf_modules/urqt/main'
include { fasta_from_bed } from './nf_modules/bedtools/main'
include { index_fasta; mapping_fastq_pairedend } from './nf_modules/kallisto/main'
workflow {
adaptor_removal_pairedend(fastq_files)
trimming_pairedend(adaptor_removal_pairedend.out.fastq)
fasta_from_bed(fasta_files, bed_files)
index_fasta(fasta_from_bed.out.fasta)
mapping_fastq_pairedend(index_fasta.out.index.collect(), trimming_pairedend.out.fastq)
}
process trimming {
tag "${reads}"
publishDir "results/fastq/trimming/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files_cut
output:
set pair_id, "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads[0]} --inpair ${reads[1]} \
--out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
> ${pair_id}_trimming_report.txt
"""
}
process fasta_from_bed {
tag "${bed.baseName}"
publishDir "results/fasta/", mode: 'copy'
input:
file fasta from fasta_files
file bed from bed_files
output:
file "*_extracted.fasta" into fasta_files_extracted
script:
"""
bedtools getfasta -name \
-fi ${fasta} -bed ${bed} -fo ${bed.baseName}_extracted.fasta
"""
}
process index_fasta {
tag "$fasta.baseName"
publishDir "results/mapping/index/", mode: 'copy'
input:
file fasta from fasta_files_extracted
output:
file "*.index*" into index_files
file "*_kallisto_report.txt" into index_files_report
script:
"""
kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
2> ${fasta.baseName}_kallisto_report.txt
"""
}
process mapping_fastq {
tag "$reads"
publishDir "results/mapping/quantification/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files_trim
file index from index_files.collect()
output:
file "*" into counts_files
script:
"""
mkdir ${pair_id}
kallisto quant -i ${index} -t ${task.cpus} \
--bias --bootstrap-samples 100 -o ${pair_id} \
${reads[0]} ${reads[1]} &> ${pair_id}/kallisto_report.txt
"""
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment