Skip to content
Snippets Groups Projects
Unverified Commit 84fde2c6 authored by Jacques Dainat's avatar Jacques Dainat
Browse files

add busco and fix main

parent e136af06
No related branches found
No related tags found
No related merge requests found
// limit the system resources against which nextflow schedules processes
executor {
name = 'local'
cpus = 4
memory = '8GB'
}
process {
cpus = 1
maxForks = 20
shell = ['/bin/bash', '-euo', 'pipefail']
stageOutMode = 'rsync'
withName: 'fastqc' {
cpus = 2
withName: 'agat' {
cpus = 1
}
withName: 'fastp' {
withName: 'prokka' {
cpus = 2
}
withName: 'trimmomatic' {
withName: 'bakta' {
cpus = 2
}
withName: 'hisat2_index' {
cpus = 4
}
withName: 'hisat2' {
cpus = 8
}
withName: 'stringtie' {
cpus = 8
withName: 'busco' {
cpus = 2
}
}
......@@ -2,21 +2,21 @@ process {
withName: 'agat' {
conda = { singularity.enabled || docker.enabled ? '' : "$baseDir/conda/process_fastp.yml" }
container = 'docker://quay.io/biocontainers/agat:1.0.0--pl5321hdfd78af_0'
container = 'quay.io/biocontainers/agat:1.0.0--pl5321hdfd78af_0'
}
withName: bakta {
conda = { singularity.enabled || docker.enabled ? '' : "$baseDir/conda/process_bakta.yml" }
container = 'docker://oschwengers/bakta:v1.6.0'
container = 'oschwengers/bakta:v1.6.0'
}
withLabel: busco {
conda = { singularity.enabled || docker.enabled ? '' : "$baseDir/conda/process_busco.yml" }
container = 'docker://quay.io/biocontainers/busco:5.3.2--pyhdfd78af_0'
container = 'quay.io/biocontainers/busco:5.3.2--pyhdfd78af_0'
}
withName: 'prokka' {
conda = { singularity.enabled || docker.enabled ? '' : "$baseDir/conda/process_prokka.yml" }
container = 'docker://quay.io/biocontainers/prokka:1.14.6--pl5321hdfd78af_4'
container = 'quay.io/biocontainers/prokka:1.14.6--pl5321hdfd78af_4'
}
}
This diff is collapsed.
......@@ -9,25 +9,48 @@ nextflow.enable.dsl=2
params.assembly = "/path/to/assembly.fasta"
params.outdir = "results"
params.locus_prefix = "BACTOS"
params.locus_prefix = "MBaP"
params.genus = "Escherichia"
params.species = "coli"
params.strain = "POO247"
params.codon_table = 11
params.evalue = 1e-9
// Prokka params
params.prokka = ''
if(!params.strain){
params.bakta_db="/path/to/bakta_db" // optional
params.busco_db = "/path/to/busco_db" // optional
params.busco_lineage = "" // optional
// ************* DEAL with provided params ****************
// Deal with Prokka Parameters
params.prokka = ' '
if(params.strain){
params.prokka = '--strain ${params.strain}'
}
if(!params.species){
if(params.species){
params.prokka = '${params.prokka} --species ${params.species}'
}
if(!params.genus){
if(params.genus){
params.prokka = '${params.prokka} --genus ${params.genus} --usegenus'
}
// Deal with BAKTA Parameters
params.bakta = ' '
File bakta_db_file = new File( params.bakta_db );
if (bakta_db_file.exists() ){
params.bakta = '--db ${bakta_db}'
}
// Deal with BUSCO Parameters
params.busco = ' '
File busco_db_file = new File( params.busco_db );
if (busco_db_file.exists() ){
params.busco = '--offline --download_path ${busco_db}}'
}
if(params.busco_lineage){
params.busco = '${params.busco} --lineage_dataset ${busco_lineage}'
} else {
params.busco = '${params.busco} --auto-lineage-prok'
}
log.info """
IRD
......@@ -43,7 +66,7 @@ IRD
MbaP - Mutualize Bacterial Predictors
===================================================
===================================================
General Parameters
assembly : ${params.assembly}
......@@ -78,13 +101,14 @@ workflow mbap {
main:
//busco(assembly)
prokka(assembly)
bakta(assembly)
}
process prokka {
tag "$sample_id"
publishDir "${params.outdir}/prokka", mode: 'copy'
tag "${assembly}"
publishDir "${params.outdir}/${assembly}/prokka", mode: 'copy'
input:
path(assembly)
......@@ -94,40 +118,69 @@ process prokka {
script:
"""
prokka \
--addgenes --locustag ${params.locus_prefix}
prokka \
--addgenes --locustag ${params.locus_prefix} \
--increment 10 --compliant \
--kingdom Bacteria --gcode ${params.codon_table} \
--evalue ${params.evalue} --rfam \
assembly
${params.prokka} \
${assembly}
"""
}
process bakta {
tag "$sample_id"
publishDir "${params.outdir}/bakta", mode: 'copy'
tag "$assembly"
publishDir "${params.outdir}/${assembly}/bakta", mode: 'copy'
conda 'bakta'
input:
path(assembly)
output:
file('*')
path("${assembly}_bakta")
script:
"""
bakta \
--addgenes --locustag ${params.locus_prefix}
--increment 10 --compliant \
--kingdom Bacteria --gcode ${params.codon_table} \
--evalue ${params.evalue} --rfam \
assembly
bakta \
--keep-contig-headers --genus ${params.genus} \
--species ${params.species} --prefix ${assembly} --locus-tag ${params.locus_prefix} --output ${assembly}_bakta \
--verbose \
${params.bakta} \
${assembly}
"""
}
process busco {
label 'busco'
publishDir "${params.output}/${assembly}/assembly", mode: 'copy'
input:
tuple val(id), path(contigs)
val(lineage)
output:
path("busco_${assembly}")
script:
"""
busco -i ${assembly} -o busco_${assembly} --mode genome -f ${params.busco}
"""
}
/************** onComplete ****************/
workflow.onComplete {
log.info ( workflow.success ? "\nTranscript assembly complete!\n" : "Oops .. something went wrong\n" )
log.info ( workflow.success ? "\nMbaP pipeline complete!\n" : "Oops .. something went wrong\n" )
log.info """
MbaP Pipeline execution summary
--------------------------------------
Completed at : ${workflow.complete}
UUID : ${workflow.sessionId}
Duration : ${workflow.duration}
Success : ${workflow.success}
Exit Status : ${workflow.exitStatus}
Error report : ${workflow.errorReport ?: '-'}
"""
}
......@@ -55,6 +55,7 @@ report {
}
trace {
overwrite = true
enabled = true
file = "pipeline_report/execution_trace.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