Commit 4308120e authored by Jules Sabban's avatar Jules Sabban
Browse files

Move files to NF-CORE organisation

parent 82900b10
Pipeline #47265 failed with stage
in 21 seconds
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
//include { foo } from './some/module'
//------------------------------
nextflow.enable.dsl = 2
/*
* WORKFLOWS
* Sub-workflows
* processes
*/
Copyright INRAE 2021
This software is a computer program whose purpose is to
analyze high-throughput sequencing data.
You can use, modify and/ or redistribute the software under the terms
of license (see the LICENSE file for more details).
The software is distributed in the hope that it will be useful,
but "AS IS" WITHOUT ANY WARRANTY OF ANY KIND.
Users are therefore encouraged to test the software's suitability as regards
their requirements in conditions enabling the security of their systems and/or data.
The fact that you are presently reading this means that you have had knowledge
of the license and that you accept its terms.
This script is based on :
- the nf-core guidelines . See https://nf-co.re/ for more information
- the Curie institute template https://github.com/bioinfo-pf-curie/geniac-template/
//include { decoupeSS as DECOUPE_SS } from './modules/module_test.nf'
*/
// Mettre ca dans des fichiers de config ??
/*
if DNA {
include { dna_qc as QC } from './workflows/dna_qc.nf'
}
if RNA {
include { rna_qc as QC } from './workflows/rna_qc.nf'
}
if amplicon {
if taille_insert dans itervalle {
include { diversity_qc as QC } from './workflows/diversity_qc.nf'
} else {
include { dna_qc as QC } from './workflows/dna_qc.nf'
}
}
========================================================================================
NAMED WORKFLOW FOR PIPELINE
========================================================================================
*/
//------------------------------
/*params.sequencer = 'NovaSeq'
//params.raw_data = '/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad'
params.raw_data = ''
params.outdir = '/home/sbsuser/work/Nextflow/wf-illumina-nf/results/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x'
mismatchNumber= params.sequencer == 'MiSeq'? 0 : 1
my_data_miseq=Channel.fromPath('./data_test/20210713_MISEQ_7_BULKDEMUX_JRCVF.csv')
my_data_novaseq=Channel.fromPath('./data_test/20210607_NOVASEQ6000_BULKDEMUX_HFMH7DRXY.csv')
include { ILLUMINA_QC } from './workflow/illumina_qc.nf'
//ch_ss=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/PipelineLogs_Lane1/20210713_MISEQ_7_IEM_JRCVF_Lane1.csv')
ch_ngl=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/RunNGL-Bi.created')
ch_runInfo=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/RunInfo.xml')
ch_ss=Channel.fromPath('/NovaSeq/data/210722_A00318_0223_BH3GHCDRXY/PipelineLogs_Lane1/20210722_NOVASEQ6000_IEM_H3GHCDRXY_Lane1.csv')
workflow QC_ANALYSIS {
ILLUMINA_QC()
}
/*
========================================================================================
RUN ALL WORKFLOWS
========================================================================================
*/
// ------------- Test 10x ------------ //
params.sequencer = 'NovaSeq'
params.outdir = '/home/sbsuser/work/Nextflow/wf-illumina-nf/results/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x'
params.raw_data = ''
params.data = '/work/sbsuser/data/NovaSeq/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x'
params.isMultiplex = true
params.chemistry = '10X'
ch_ss = Channel.fromPath('/NovaSeq/data/210722_A00318_0223_BH3GHCDRXY/PipelineLogs_Lane1/20210722_NOVASEQ6000_IEM_H3GHCDRXY_Lane1.csv')
ch_DemuxStatXML=Channel.fromPath(params.data+'/Stats/DemultiplexingStats.xml')
ch_DemuxSummary=Channel.fromPath(params.data+'/Stats/DemuxSummaryF1L1.txt')
ch_read=Channel
.fromPath(params.data+'/TregThymus/1ADT_S1_L001_R{1,2}_001.fastq.gz')
//.fromPath(params.data+'/TregThymus/**_R{1,2}_*.fastq.gz')
.map{$it -> [$it.simpleName, $it]}
.groupTuple()
banksForConta= [ '/work/bank/bwadb/phi.fa', '/work/bank/bwadb/ecoli536', '/work/bank/bwadb/yeast.nt', '/save/ng6/TODO/HiSeqIndexedGenomes/new_struct/Betacoronavirus_SARSr-CoV/SARS-CoV-2/genome/BWA/nCoV-2019.reference.fasta']
// -----------------------------
// Includes AFTER params !!
// -----------------------------
include { bar as FOO } from './modules/module_test.nf'
include {
Core as CORE;
} from './workflows/core_pipeline.nf'
// -----------------------------
createDir = file(params.outdir).mkdir()
println createDir ? "Creation du dossier "+ params.outdir : "Le dossier "+params.outdir + " existe deja."
// -----------------------------
workflow {
//test(my_data_miseq, my_data_novaseq)
//test.out.samplesheet.view()
CORE(ch_ss, /*ch_ngl, ch_runInfo, mismatchNumber, -*/ch_DemuxStatXML, ch_DemuxSummary, ch_read, banksForConta/*, params.raw_data*/ )
//println banksForConta
//ch_read.view()
QC_ANALYSIS()
}
......@@ -102,7 +102,8 @@ process demultiplexStats {
}
process fastqc {
publishDir path: "${params.outdir}/ReadsStats" , mode: 'copy'
publishDir path: "${params.outdir}/ReadsStats" , mode: 'copy', pattern: '*.zip', saveAs: { filename -> "${name}.zip" }
publishDir path: "${params.outdir}/ReadsStats" , mode: 'copy', pattern: '*.html', saveAs: { filename -> "${name}.html" }
errorStrategy { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' }
maxRetries 3
......@@ -146,8 +147,7 @@ process illuminaFilter {
script: // la sortie de gzip est redirigée, donc peut etre que le -c est inutile...
"""
zcat $read | fastq_illumina_filter --keep N -v 2> ${name}.out | gzip -c -f > good.fastq.gz
zcat $read | fastq_illumina_filter --keep N -v 2> ${name}.out | gzip -c -f > good.fastq.gz
"""
}
......@@ -169,7 +169,6 @@ process search_conta_bwa {
script:
genomeName=file(genomeRef).simpleName
"""
bwa aln $genomeRef $read 2>> ${name}_${genomeName}.err | bwa samse $genomeRef - $read > ${name}_${genomeName}.sam 2>> ${name}_${genomeName}.err
"""
}
......
params.outdir=''
summary = [:]
process workflow_summary {
publishDir path: "${params.outdir}/Reports" , mode: 'copy'
output:
file 'workflow_summary_mqc.yaml'
exec:
def yaml_file = task.workDir.resolve('workflow_summary_mqc.yaml')
yaml_file.text = """
id: 'summary'
description: " - this information is collected when the pipeline is started."
section_name: 'Workflow Summary'
section_href: "${workflow.manifest.homePage}"
plot_type: 'html'
data: |
<dl class=\"dl-horizontal\">
${summary.collect { k,v -> " <dt>$k</dt><dd><samp>${v ?: '<span style=\"color:#999999;\">N/A</a>'}</samp></dd>" }.join("\n")}
</dl>
""".stripIndent()
}
workflow summary {
take:
summary
main:
workflow_summary(summary)
}
\ No newline at end of file
//params.sequencer = 'MiSeq'
//params.rawdata_location = '/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad'
params.outdir=''
params.isMultiplex=''
params.chemistry=''
params.sequencer=''
banksForConta = [ ]
......@@ -18,14 +11,14 @@ include {
search_conta_bwa as align;
search_conta_samtools as filter;
search_conta_summary as summary;
} from '../modules/module_core.nf'
} from '../../modules/local/module_core.nf'
include {
prepareReadSetCreation;
readsetNGLBiCreation as readsetCreation;
checkErrorFromNGLBi as checkError;
} from '../modules/module_NGL-Bi.nf'
} from '../../modules/local/module_NGL-Bi.nf'
//-------------------------------------------------
......@@ -57,7 +50,6 @@ workflow NGLBi_readsets {
workflow Demultiplexage {
//ecriture du masque
//demux avec bcl2fastq / cellRanger
take:
......@@ -111,12 +103,12 @@ workflow Core {
// ----------- DemultiplexStat
if (params.chemistry == '10X') {
//DemuxStat_10x(ch_sampleSheet, ch_DemuxStatXML, ch_DemuxSummary)
DemuxStat_10x(ch_sampleSheet, ch_DemuxStatXML, ch_DemuxSummary)
} else {
println "Les données ne sont pas 10X !"
}
// ----------- Illumina Filter
// ----------- Illumina Filter // ou SubsetSeqFiles : dans quel cas on fait l'un ou l'autre ????
if (params.sequencer == 'NovaSeq' & params.isMultiplex) {
println "Les données ne nécessite pas de passer par IlluminaFilter"
ch_read_good = ch_read
......@@ -126,23 +118,8 @@ workflow Core {
}
// ----------- FASTQC
//fastqc(ch_read_good)
fastqc(ch_read_good)
// ----------- CheckContamination
Search_conta(ch_read_good, banksForConta)
}
/*
workflow core {
take:
ch_sampleSheet
ch_runNGLBiCreated
main:
wf_preprocessing(ch_sampleSheet, ch_runNGLBiCreated)
if not noIndex { wf_demultiplexage(data) }
pr_illuminaFilter(data) // ou SubsetSeqFiles : dans quel cas on fait l'un ou l'autre ????
wf_check_conta(data)
pr_fastqc(data)
emit:
}*/
\ No newline at end of file
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
def helpMessage() {
log.info"""
Usage:
The typical command for running the pipeline is as follows:
nextflow run get-nf/template --inputdir '/path/to/data' --samplesheet 'samples.csv' -profile docker
Mandatory arguments:
--inputdir Path to input directory
-profile Configuration profile to use. Can use multiple (comma separated)
Available: conda, docker, singularity, path, genotoul, test and more.
Options:
--samplesheet Default inputdir/samples.csv eg: SAMPLE_ID,SAMPLE_NAME,path/to/R1/fastq/file,path/to/R2/fastq/file (for paired-end only)
--contaminant Name of iGenomes // To be discussed ????
--outdir The output directory where the results will be saved
--email Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits
--email_on_fail Same as --email, except only send mail if the workflow is not successful
--maxMultiqcEmailFileSize Theshold size for MultiQC report to be attached in notification email. If file generated by pipeline exceeds the threshold, it will not be attached (Default: 25MB)
-name [str] Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic.
=======================================================
Available profiles
-profile test Run the test dataset
-profile conda Build a new conda environment before running the pipeline. Use `--condaCacheDir` to define the conda cache path
-profile path Use the installation path defined for all tools. Use `--globalPath` to define the installation path
-profile docker Use the Docker images for each process
-profile singularity Use the singularity images for each process
-profile genologin Run the workflow on the cluster, instead of locally
""".stripIndent()
}
// Show help message
if (params.help) {
helpMessage()
exit 0
}
// -------------------------------------------------
// PARAMS
// -------------------------------------------------
/*params.sequencer = 'NovaSeq'
//params.raw_data = '/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad'
//params.outdir = '/home/sbsuser/work/Nextflow/wf-illumina-nf/results/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x'
//my_data_miseq=Channel.fromPath('./data_test/20210713_MISEQ_7_BULKDEMUX_JRCVF.csv')
//my_data_novaseq=Channel.fromPath('./data_test/20210607_NOVASEQ6000_BULKDEMUX_HFMH7DRXY.csv')
//ch_ss=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/PipelineLogs_Lane1/20210713_MISEQ_7_IEM_JRCVF_Lane1.csv')
//ch_ngl=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/RunNGL-Bi.created')
//ch_runInfo=Channel.fromPath('/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/210713_M07406_0007_000000000-JRCVF_bad/RunInfo.xml')
//ch_ss=Channel.fromPath('/NovaSeq/data/210722_A00318_0223_BH3GHCDRXY/PipelineLogs_Lane1/20210722_NOVASEQ6000_IEM_H3GHCDRXY_Lane1.csv')
*/
// ------------- Test 10x ------------ //
params.sequencer = 'NovaSeq'
params.outdir = '/home/sbsuser/work/Nextflow/wf-illumina-nf/results/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x' // In config file
params.raw_data = ''
params.data = '/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/NovaSeq/210722_A00318_0223_BH3GHCDRXY_Lane1_1627020907_10x'
params.isMultiplex = true
params.chemistry = '10X'
ch_ss = Channel.fromPath(params.data+'/SampleSheet_global.csv')
// ------------- Test MiSeq ------------ //
/*
params.sequencer = 'MiSeq'
//params.outdir = '/home/sbsuser/work/Nextflow/wf-illumina-nf/results/211022_M01945_0364_000000000-DB246_rnaseq' // In config file
params.raw_data = ''
params.data = '/home/sbsuser/work/Nextflow/wf-illumina-nf/data_test/MiSeq/211022_M01945_0364_000000000-DB246_rnaseq'
params.isMultiplex = true
params.chemistry = 'amplicon'
*/
//ch_ss = Channel.fromPath(params.data+'/SampleSheet.csv')
ch_DemuxStatXML=Channel.fromPath(params.data+'/Stats/DemultiplexingStats.xml')
ch_DemuxSummary=Channel.fromPath(params.data+'/Stats/DemuxSummaryF1L1.txt')
ch_read=Channel
.fromPath(params.data+'/TregThymus/**_R{1,2}_*.fastq.gz')
//.fromPath(params.data+'/ROME/B20CG-*_R{1,2}_*.fastq.gz')
.map{$it -> [$it.simpleName, $it]}
.groupTuple()
mismatchNumber = params.sequencer == 'MiSeq'? 0 : 1
banksForConta = params.addBankForConta ? params.genomesRefForConta << params.addBankForConta : params.genomesRefForConta
createDir = file(params.outdir).mkdir()
// -------------------------------------------------
// INCLUDES
// -------------------------------------------------
// Mettre ca dans des fichiers de config ??
/*
if DNA {
include { dna_qc as QC } from '../sub-workflows/local/dna_qc.nf'
}
if RNA {
include { rna_qc as QC } from '../sub-workflows/local/rna_qc.nf'
}
if amplicon {
if taille_insert dans itervalle {
include { diversity_qc as QC } from '../sub-workflows/local/diversity_qc.nf'
} else {
include { dna_qc as QC } from '../sub-workflows/local/dna_qc.nf'
}
}
*/
include { Core as CORE } from '../sub-workflows/local/core_pipeline.nf'
// -------------------------------------------------
// WORKFLOW
// -------------------------------------------------
workflow ILLUMINA_QC {
CORE(ch_ss, ch_DemuxStatXML, ch_DemuxSummary, ch_read, banksForConta ) /*ch_ngl, ch_runInfo, mismatchNumber, params.raw_data*/
}
Markdown is supported
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