Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add busco_clean parameter #353

Merged
merged 7 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#353](https://github.com/nf-core/mag/pull/353) - Added the busco_clean parameter to optionally clean each BUSCO directory after a successful

### `Changed`

- [#340](https://github.com/nf-core/mag/pull/340) - Update to nf-core 2.6.1 `TEMPLATE`
Expand Down
1 change: 1 addition & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ params {
min_length_unbinned_contigs = 1
max_unbinned_contigs = 2
busco_reference = "https://busco-data.ezlab.org/v5/data/lineages/bacteria_odb10.2020-03-06.tar.gz"
busco_clean = true
gtdb = false
}
11 changes: 11 additions & 0 deletions modules/local/busco.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ process BUSCO {
if (params.busco_reference)
lineage_dataset_provided = "Y"

def busco_clean = "N"
if (params.busco_clean)
busco_clean = "Y"

def p = "--auto-lineage"
if (params.busco_reference){
p = "--lineage_dataset dataset/${db}"
Expand Down Expand Up @@ -181,6 +185,13 @@ process BUSCO {
mv BUSCO/logs/prodigal_out.log "${bin}_prodigal.gff"
fi
# if needed delete temporary BUSCO files
if [ ${busco_clean} ]; then
find . -depth -type d -name "augustus_config" -execdir rm -rf "{}" \\;
find . -depth -type d -name "auto_lineage" -execdir rm -rf "{}" \\;
find . -depth -type d -name "run_*" -execdir rm -rf "{}" +
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version 2>&1 | sed 's/Python //g')
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ params {
busco_download_path = null
busco_auto_lineage_prok = false
save_busco_reference = false
busco_clean = false

// Reproducibility options
megahit_fix_cpu_1 = false
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@
"description": "Specify which binning output is sent for downstream annotation, taxonomic classification, bin quality control etc.",
"help_text": "`raw_bins_only`: only bins (and unbinned contigs) from the binners.\n`refined_bins_only`: only bins (and unbinned contigs) from the bin refinement step .\n`both`: bins and unbinned contigs from both the binning and bin refinement steps.",
"enum": ["raw_bins_only", "refined_bins_only", "both"]
},
"busco_clean": {
"type": "boolean",
"description": "Enable clean-up of temporary files created during BUSCO runs.",
"help_text": "By default, BUSCO creates a large number of intermediate files every run. This may cause problems on some clusters which have file number limits in plate, particularly with large numbers of bins. Enabling this option cleans these files, reducing the total file count of the work directory."
}
}
},
Expand Down