Skip to content

Commit

Permalink
Merge changes from develop (#48)
Browse files Browse the repository at this point in the history
* Split out the config profiles (#43)

* Split out the config profiles

* Resolve the conflict using the upstream config

* Refactor channel identifiers and process names (#45)

**Main change**

Processes, channels and workflow names have had its case names changed in order to meet nextflow's community standards.

**Commits**
* Refactor names
* refactor names in the workflows
* Update workflows/bacannot.nf
* Update workflows/bacannot.nf
* Apply suggestions from code review
* Update workflows/bacannot.nf wrt iceberg
* Accomodate code review and fix the channel name
* fix MERGE_ANNOTATIONS process case in line 331

Co-authored-by: Felipe Marques de Almeida <felipemarques89@gmail.com>

* added small dataset test profile

* fixing name of quicktest profile

* fixing urls of testing samplesheets

* removing unnecessary files

* added new action to test the pipeline from PR and updated docs about quicktest

* fixed branch name in github action

* fixing input typo in quicktest profile

* adding more space to workflow env

* fixed action as only 2 threads are available

Co-authored-by: Abhinav Sharma <abhi18av@users.noreply.github.com>
  • Loading branch information
fmalmeida and abhi18av authored Jan 24, 2022
1 parent 476fb47 commit 6ba5460
Show file tree
Hide file tree
Showing 47 changed files with 364 additions and 336 deletions.
6 changes: 6 additions & 0 deletions conf/awsbatch.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process {
executor = 'awsbatch'
queue = 'my-batch-queue'
// cpu allocation
cpus = params.threads
}
45 changes: 45 additions & 0 deletions conf/docker.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Container usage and permission

docker {
enabled = true
runOptions = '--platform linux/amd64 -u $(id -u):root'
fixOwnership = true
}


/*
Configuration of Docker usage
DO NOT change any of those
*/

// specific images
process {
withLabel: 'main' {
container = 'fmalmeida/bacannot:v3.0'
}

withLabel: 'renv' {
container = 'fmalmeida/bacannot:v3.0_renv'
}

withLabel: 'jbrowse' {
container = 'fmalmeida/bacannot:jbrowse'
}

withLabel: 'kofam' {
container = 'fmalmeida/bacannot:kofamscan'
}

withLabel: 'smash' {
container = 'fmalmeida/bacannot:antismash'
}

withLabel: 'unicycler' {
container = 'quay.io/biocontainers/unicycler:0.4.8--py38h8162308_3'
}

withLabel: 'flye' {
container = 'quay.io/biocontainers/flye:2.9--py39h39abbe0_0'
}
}

86 changes: 86 additions & 0 deletions conf/small_dataset_test_profile.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Configuration File to run fmalmeida/bacannot pipeline.
*/

/*

Required Parameters.
This parameters must always be set

*/
params {

/*

INPUT SAMPLESHEET

*/

// Input data mus be given inside a well-formated samplesheet.
// We provide a well-formated example at: https://github.com/fmalmeida/test_datasets/raw/main/bacannot_testing_samplesheets/samplesheet.yaml
//
// Please read the example samplesheet so you can understand how to properly fill it.
//
// It is also documented in the main manual: https://bacannot.readthedocs.io/en/latest/samplesheet.html
input = 'https://github.com/fmalmeida/test_datasets/raw/main/bacannot_testing_samplesheets/small_dataset_samplesheet.yml'

/*

GENERAL PARAMETERS

*/

// Main output folder name. More than one bacannot annotation can be redirected
// to the same output parameter. It is good to keep related annotations together.
// A subdirectory with the filename will be created inside this directory.
output = 'EXAMPLE_OUTPUT'

// Number of threads to be used by each software
threads = 5

/*
* Resfinder species panel
*/

// Species panel to be used when annotating with Resfinder.
// It sets a default for all samples in the samplesheet.
// If a sample has a different value inside the samplesheet it will overwrite the value for that sample
// If blank it will not be executed.
// It must be identical (without the *) as written in their webservice https://cge.cbs.dtu.dk/services/ResFinder/.
// E.g. 'Escherichia coli'; 'Klebsiella' ...
resfinder_species = 'Other'

/*
* Custom databases can be used to annotate additional genes in the genome.
* It runs a BLASTn alignment against the genome, therefore, the custom database
* MUST be a nucleotide fasta of genes. More than one custom database can be given
* separated by commas. Gene headers must be properly formated as described in the
* documentation: https://bacannot.readthedocs.io/en/latest/custom-db.html
*/
// Custom nucleotide fastas
custom_db = 'https://github.com/fmalmeida/test_datasets/raw/main/small_custom_db.fasta'

}

/*
Configuration of Nextflow Scopes
*/

//Trace Report
trace {
enabled = true
file = "${params.output}" + "/annotation_pipeline_trace.txt"
fields = 'task_id,name,status,exit,realtime,cpus,%cpu,memory,%mem,rss'
}

//Timeline Report
timeline {
enabled = true
file = "${params.output}" + "/annotation_pipeline_timeline.html"
}

//Complete Report
report {
enabled = true
file = "${params.output}" + "/annotation_pipeline_nextflow_report.html"
}
15 changes: 15 additions & 0 deletions conf/standard.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Executor
process {
executor = "local"
}

// QueueSize limit
if (params.parallel_jobs || params.parallel_jobs != '') {
qs = params.parallel_jobs
}
executor {
name = "local"
if (params.parallel_jobs || params.parallel_jobs != '') {
queueSize = qs
}
}
6 changes: 3 additions & 3 deletions test_data/test_profile.config → conf/test_profile.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ params {
*/

// Input data mus be given inside a well-formated samplesheet.
// We provide a well-formated example at: https://github.com/fmalmeida/bacannot/blob/master/example_samplesheet.yaml
// We provide a well-formated example at: https://github.com/fmalmeida/test_datasets/raw/main/bacannot_testing_samplesheets/samplesheet.yaml
//
// Please read the example samplesheet so you can understand how to properly fill it.
//
// It is also documented in the main manual: https://bacannot.readthedocs.io/en/latest/samplesheet.html
input = 'https://github.com/fmalmeida/bacannot/raw/master/test_data/samplesheet.yaml'
input = 'https://github.com/fmalmeida/test_datasets/raw/main/bacannot_testing_samplesheets/samplesheet.yaml'

/*

Expand Down Expand Up @@ -58,7 +58,7 @@ params {
* documentation: https://bacannot.readthedocs.io/en/latest/custom-db.html
*/
// Custom nucleotide fastas
custom_db = 'https://github.com/fmalmeida/bacannot/raw/master/test_data/small_custom_db.fasta'
custom_db = 'https://github.com/fmalmeida/test_datasets/raw/main/small_custom_db.fasta'

}

Expand Down
5 changes: 4 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ Moreover, we have also made available a few example datasets in the pipeline so

.. code-block:: bash
# Run the pipeline using the provided test datasets
# Run the pipeline using the provided (bigger) test dataset
nextflow run fmalmeida/bacannot --profile test --threads 10
# Or run the quick test
nextflow run fmalmeida/bacannot --profile quicktest --threads 10
.. note::

Unfortunately, due to file sizes, we could not provide fast5 files for users to check on the methylation step.
2 changes: 1 addition & 1 deletion modules/KOs/kegg-decoder.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process kegg_decoder {
process KEGG_DECODER {
publishDir "${params.output}/${prefix}/KOfamscan", mode: 'copy'
tag "${prefix}"
label 'kofam'
Expand Down
2 changes: 1 addition & 1 deletion modules/KOs/kofamscan.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process kofamscan {
process KOFAMSCAN {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/digIS.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process digis {
process DIGIS {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "${prefix}.gff") null
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/draw_gis.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process draw_GIs {
process DRAW_GIS {
publishDir "${params.output}/${prefix}/genomic_islands", mode: 'copy', saveAs: { filename ->
if (filename == "plots") "$filename"
else null
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/iceberg.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process iceberg {
process ICEBERG {
publishDir "${params.output}/${prefix}/ICEs", mode: 'copy'
tag "${prefix}"
label 'main'
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/islandPath_DIMOB.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process find_GIs {
process FIND_GIS {
publishDir "${params.output}/${prefix}/genomic_islands", mode: 'copy'
errorStrategy 'retry'
maxRetries 5
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/plasmidfinder.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process plasmidfinder {
process PLASMIDFINDER {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename == "plasmidfinder") "plasmids/$filename"
else null
Expand Down
2 changes: 1 addition & 1 deletion modules/MGEs/platon.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process platon {
process PLATON {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "platon") "plasmids/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/assembly/flye.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process flye {
process FLYE {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "flye_${prefix}") "assembly"
Expand Down
2 changes: 1 addition & 1 deletion modules/assembly/unicycler.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process unicycler {
process UNICYCLER {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "unicycler_${prefix}") "assembly"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/antismash.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process antismash {
process ANTISMASH {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/barrnap.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process barrnap {
process BARRNAP {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "rRNA/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/compute_gc.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process compute_gc {
process COMPUTE_GC {
tag "${prefix}"
label 'main'

Expand Down
2 changes: 1 addition & 1 deletion modules/generic/custom_blast.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process custom_blast {
process CUSTOM_BLAST {
publishDir "${params.output}/${prefix}/custom_annotations/${customDB.baseName}", mode: 'copy'
tag "${prefix}"
label 'main'
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/custom_blast_report.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process custom_blast_report {
process CUSTOM_BLAST_REPORT {
publishDir "${params.output}/${prefix}/report_files/custom_databases", mode: 'copy', saveAs: { filename ->
if (filename.indexOf(".html") > 0) "report_${customDB}.html"
else "$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/genome_mask.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process masking_genome {
process MASKING_GENOME {
publishDir "${params.output}/${prefix}", mode: 'copy',
saveAs: {filename ->
//This line saves the files with specific sufixes in specific folders
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/gff2gbk.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process gff2gbk {
process GFF2GBK {
publishDir "${params.output}/${prefix}/gbk", mode: 'copy'
label 'main'
tag "${prefix}"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/gff2sql.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process create_sql {
process CREATE_SQL {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf(".sqlite") > 0) "sqldb/$filename"
else "$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/jbrowse.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process jbrowse {
process JBROWSE {
publishDir "${params.output}/${prefix}/jbrowse", mode: 'copy'
label 'jbrowse'
tag "${prefix}"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/mash.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process refseq_masher {
process REFSEQ_MASHER {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "refseq_masher/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/merge_annotations.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process merge_annotations {
process MERGE_ANNOTATIONS {
publishDir "${params.output}/${prefix}/gffs", mode: 'copy'
label 'renv'
tag "${prefix}"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/merge_gff.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process gff_merge {
process GFF_MERGE {
publishDir "${params.output}/${prefix}/gffs", mode: 'copy'
label 'main'
tag "${prefix}"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/methylation.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process call_methylation {
process CALL_METHYLATION {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "methylations/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/mlst.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process mlst {
process MLST {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "MLST/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/prokka.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process prokka {
process PROKKA {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "annotation") "$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/generic/reports.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process report {
process REPORT {
publishDir "${params.output}/${prefix}/report_files", mode: 'copy'
label 'renv'
tag "${prefix}"
Expand Down
4 changes: 2 additions & 2 deletions modules/generic/sequenceserver.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process sequenceserver {
process SEQUENCESERVER {
publishDir "${params.output}/${prefix}/SequenceServerDBs", mode: 'copy'
tag "${prefix}"
label 'main'
Expand All @@ -23,4 +23,4 @@ process sequenceserver {
# proteins
makeblastdb -in $proteins -dbtype prot -title "${prefix} proteins" -parse_seqids
"""
}
}
2 changes: 1 addition & 1 deletion modules/prophages/phast.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process phast {
process PHAST {
publishDir "${params.output}/${prefix}/prophages/phast_db", mode: 'copy'
tag "${prefix}"
label 'main'
Expand Down
2 changes: 1 addition & 1 deletion modules/prophages/phigaro.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process phigaro {
process PHIGARO {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename == "out.phg") null
else if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/prophages/phispy.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process phispy {
process PHISPY {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else if (filename == "PhiSpy") "prophages/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/resistance/amrfinder.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process amrfinder {
process AMRFINDER {
publishDir "${params.output}/${prefix}", mode: 'copy', saveAs: { filename ->
if (filename.indexOf("_version.txt") > 0) "tools_versioning/$filename"
else "resistance/AMRFinderPlus/$filename"
Expand Down
2 changes: 1 addition & 1 deletion modules/resistance/argminer.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process argminer {
process ARGMINER {
publishDir "${params.output}/${prefix}/resistance/ARGMiner", mode: 'copy'
tag "${prefix}"
label 'main'
Expand Down
2 changes: 1 addition & 1 deletion modules/resistance/resfinder.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process resfinder {
process RESFINDER {
publishDir "${params.output}/${prefix}/resistance", mode: 'copy'
tag "${prefix}"
label 'main'
Expand Down
Loading

0 comments on commit 6ba5460

Please sign in to comment.