Commit 3f22d484 authored by Frédéric  LEMOINE's avatar Frédéric LEMOINE
Browse files

Added kraken run + multiqc

parent 67a09a44
......@@ -30,6 +30,8 @@ ref_name = file("${ref_path}/${ref_file}").baseName
primer = file(primer_fasta)
ref = file("${ref_path}/${ref_file}")
sum_of_2_nb = fivep_seq_nb.toInteger()+added_nb.toInteger()
k2db = file("${kraken_db}")
// end from the nextflow.config file
// from parameters
......@@ -44,6 +46,7 @@ modules = params.modules // remove the dot -> can be used in bash scripts
fastq_ch_test = file("${in_path}/${fastq_file}") // to test if exist below
primer_ch_test = file("${primer_fasta}") // to test if exist below
ref_ch_test = file("${ref_path}/${ref_file}") // to test if exist below
k2db_ch_test = file("${kraken_db}") // to test if exist below
//////// end Variables from config.file that need to be checked
......@@ -70,6 +73,10 @@ if(system_exec == 'local' || system_exec == 'slurm'){
if( ! file_exists3){
error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID ref_path: ${ref_path}\nOR ref_file: ${ref_file}\nPARAMETER IN nextflow.config FILE\n\nIF POINTING TO A DISTANT SERVER, CHECK THAT IT IS MOUNTED\n\n========\n\n"
}
def file_exists4 = k2db_ch_test.exists()
if( ! file_exists4){
error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID kraken db path: ${kraken_db}\nPARAMETER IN nextflow.config FILE\n\nIF POINTING TO A DISTANT SERVER, CHECK THAT IT IS MOUNTED\n\n========\n\n"
}
}else{
error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID system_exec PARAMETER IN nextflow.config FILE: ${system_exec}\n\n========\n\n"
}
......@@ -140,7 +147,7 @@ process trim { // Trim the oligo sequences. See section 8.4 of the labbook 20200
val alien_l_param from alientrimmer_l_param
output:
file "${file_name}_trim.fq" into fastq_trim_ch1, fastq_trim_ch2
file "${file_name}_trim.fq" into fastq_trim_ch1, fastq_trim_ch2, fastq_trim_ch3
file "report.rmd" into log_ch2
script:
......@@ -149,6 +156,22 @@ process trim { // Trim the oligo sequences. See section 8.4 of the labbook 20200
"""
}
process kraken {
label 'kraken'
input:
file fastq from fastq_trim_ch3
file k2db
output:
file "${fastq.baseName}_kraken_std.txt" into krakenreports
script:
"""
kraken2 --db ${k2db} --threads ${task.cpus} --report ${fastq.baseName}_kraken_std.txt ${fastq} > ${fastq.baseName}.kraken2
"""
}
process fastqc1 { // section 8.5 of the labbook 20200520
label 'fastqc' // see the withLabel: bash in the nextflow config file
......@@ -419,7 +442,7 @@ process multiQC{
publishDir "${out_path}/reports", mode: 'copy', overwrite: false //
input:
file "*" from fastqc_log_ch.mix(bowtie2_log_ch).collect()
file "*" from fastqc_log_ch.mix(bowtie2_log_ch).mix(krakenreports).collect()
output:
file "*.html"
......
......@@ -26,6 +26,8 @@ env {
//fastq_file="test.fastq.gz" // fastq file name
// fastq_file="Pool-B2699_S1_L001_R1_001.fastq.gz"
fastq_file="test.fastq2.gz"
//kraken_db="$baseDir/assets/k2_standard"
kraken_db="/pasteur/zeus/services/p01/banques-prod/prod/rel/kraken_standard/current/kraken/2.1.1/standard/"
//fastq_file="4-4_S1_L001_R1_001.fastq.gz"
//primer_fasta="$baseDir/dataset/20200520_adapters_TruSeq_B2699_14985_CL.fasta"
primer_fasta="$baseDir/dataset/20200520_adapters_TruSeq_B2699_14985_CL.fasta" // list of primers used for the library and used by Alien trimmer to trim the raw reads
......@@ -71,7 +73,7 @@ env {
//////// variables that will be used below (and potentially in the main.nf file)
//// must be also exported
system_exec = 'local' // the system that runs the workflow. Either 'local' or 'slurm'
system_exec = 'slurm' // the system that runs the workflow. Either 'local' or 'slurm'
//docker_exe = true // true for docker and false for singularity
//out_path="/mnt/c/Users/Gael/Desktop" // where the report file will be saved. Example report_path = '.' for where the main.nf run is executed or report_path = '/mnt/c/Users/Gael/Desktop'
out_path="$baseDir/results" // where the report file will be saved. Example report_path = '.' for where the main.nf run is executed or report_path = '/mnt/c/Users/Gael/Desktop'
......@@ -194,6 +196,12 @@ process {
memory='3G' // only used when name = "local" in the executor part above
}
withLabel: kraken{
container="evolbioinfo/kraken:v2.0.8-beta"
cpus=20
memory='100G'
}
withLabel: fastqc {
container='evolbioinfo/fastqc:v0.11.8'
cpus=1 // only used when name = "local" in the executor part above
......
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