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

Aded fasta_gxf_busco_plot sub workflow #96

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.0dev - [date]
## v1.0dev - [27-Nov-2024]

Initial release of ecoflow/genomeqc, created with the [nf-core](https://nf-co.re/) template.
Initial release of nf-core/genomeqc, created with the [nf-core](https://nf-co.re/) template.

### `Added`

1. Now using `FASTA_GXF_BUSCO_PLOT` sub workflow from nf-core/modules [#77](https://github.com/nf-core/genomeqc/issues/77)

### `Fixed`

### `Dependencies`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ ecoflow/genomeqc was originally written by Chris Wyatt, Fernando Duarte.
We thank the following people for their extensive assistance in the development of this pipeline:

- [Stephen Turner](https://github.com/stephenturner/) ([Colossal Biosciences](https://colossal.com/))
- [Usman Rashid](https://github.com/gallvp) ([The New Zealand Institute for Plant and Food Research](https://www.plantandfood.com/en-nz/))

<!-- TODO nf-core: If applicable, make list of people who have also contributed -->

Expand Down
4 changes: 4 additions & 0 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ report_section_order:
export_plots: true

disable_version_detection: true

extra_fn_clean_exts:
- type: regex
pattern: "^short_summary\\.specific\\..*_odb10\\."
42 changes: 40 additions & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ process {
]
}

withName: 'GFFREAD' {
withName: '.*:FASTA_GXF_BUSCO_PLOT:EXTRACT_PROTEINS' {
ext.args = '-y -S'
publishDir = [
path: { "${params.outdir}/gffread" },
Expand All @@ -57,7 +57,7 @@ process {
]
}

withName: 'BUSCO_BUSCO' {
withName: '.*:GENOME:BUSCO_BUSCO' {
publishDir = [
path: { "${params.outdir}/busco" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -133,4 +133,42 @@ process {
]
}

withName: '.*:FASTA_GXF_BUSCO_PLOT:BUSCO_ASSEMBLY' {
ext.args = '--metaeuk'
publishDir = [
path: { "${params.outdir}/busco/fasta" },
mode: params.publish_dir_mode,
pattern: 'short_summary.*.txt',
saveAs: { filename -> "short_summary.specific.${meta.id}.${lineage}.txt" }
]
}

withName: '.*:FASTA_GXF_BUSCO_PLOT:PLOT_ASSEMBLY' {
ext.prefix = 'busco_figure'
publishDir = [
path: { "${params.outdir}/busco/fasta" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals("versions.yml") ? null : filename }
]
}

withName: '.*:FASTA_GXF_BUSCO_PLOT:BUSCO_ANNOTATION' {
ext.args = '--metaeuk'
publishDir = [
path: { "${params.outdir}/busco/gff" },
mode: params.publish_dir_mode,
pattern: 'short_summary.*.txt',
saveAs: { filename -> "short_summary.specific.${meta.id}.${lineage}.txt" }
]
}

withName: '.*:FASTA_GXF_BUSCO_PLOT:PLOT_ANNOTATION' {
ext.prefix = 'busco_figure'
publishDir = [
path: { "${params.outdir}/busco/gff" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals("versions.yml") ? null : filename }
]
}

}
Empty file modified main.nf
100644 → 100755
Empty file.
14 changes: 12 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
"busco/busco": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": ["fasta_gxf_busco_plot", "modules"]
},
"busco/generateplot": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["fasta_gxf_busco_plot"]
},
"fastavalidator": {
"branch": "master",
Expand All @@ -33,7 +38,7 @@
"gffread": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": ["fasta_gxf_busco_plot", "modules"]
},
"merqury/merqury": {
"branch": "master",
Expand Down Expand Up @@ -109,6 +114,11 @@
"git_sha": "ab80a04707104a4baf39341581dfbced5da05479",
"installed_by": ["subworkflows"]
},
"fasta_gxf_busco_plot": {
"branch": "master",
"git_sha": "3628d826c68eea367143e403412133054f607650",
"installed_by": ["subworkflows"]
},
"utils_nextflow_pipeline": {
"branch": "master",
"git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/busco/generateplot/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::busco=5.7.1
45 changes: 45 additions & 0 deletions modules/nf-core/busco/generateplot/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process BUSCO_GENERATEPLOT {
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/busco:5.7.1--pyhdfd78af_0':
'biocontainers/busco:5.7.1--pyhdfd78af_0' }"

input:
path short_summary_txt, stageAs: 'busco/*'

output:
path '*.png' , emit: png
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: 'busco_figure'
"""
generate_plot.py \\
$args \\
-wd busco

mv ./busco/busco_figure.png ${prefix}.png

cat <<-END_VERSIONS > versions.yml
"${task.process}":
busco: \$( busco --version 2>&1 | sed 's/^BUSCO //' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: 'busco_figure'
"""
touch ${prefix}.png

cat <<-END_VERSIONS > versions.yml
"${task.process}":
busco: \$( busco --version 2>&1 | sed 's/^BUSCO //' )
END_VERSIONS
"""
}
40 changes: 40 additions & 0 deletions modules/nf-core/busco/generateplot/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "busco_generateplot"
description: BUSCO plot generation tool
keywords:
- genome
- fasta
- annotation
- busco
- transcriptome
- quality control
tools:
- busco:
description: BUSCO provides measures for quantitative assessment of genome assembly,
gene set, and transcriptome completeness based on evolutionarily informed expectations
of gene content from near-universal single-copy orthologs selected from OrthoDB.
homepage: https://busco.ezlab.org/
documentation: https://busco.ezlab.org/busco_userguide.html
tool_dev_url: https://gitlab.com/ezlab/busco
doi: "10.1007/978-1-4939-9173-0_14"
licence: ["MIT"]
identifier: biotools:busco
input:
- - short_summary_txt:
type: file
description: One or more short summary txt files from BUSCO
pattern: "short_summary.*.txt"
output:
- png:
- "*.png":
type: file
description: A summary plot in png format
pattern: "*.png"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@GallVp"
maintainers:
- "@GallVp"
72 changes: 72 additions & 0 deletions modules/nf-core/busco/generateplot/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
nextflow_process {

name "Test Process BUSCO_GENERATEPLOT"
script "../main.nf"
process "BUSCO_GENERATEPLOT"

tag "modules"
tag "modules_nfcore"
tag "busco"
tag "busco/busco"
tag "busco/generateplot"

test("bacteroides_fragilis-genome_fna_gz") {

setup {
run("BUSCO_BUSCO") {
script "../../busco"
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true)
]
input[1] = 'genome'
input[2] = 'bacteria_odb10'
input[3] = []
input[4] = []
"""
}
}
}

when {
process {
"""
input[0] = BUSCO_BUSCO.out.short_summaries_txt.map { meta, summary -> summary }
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") },
{ assert process.out.png != null } // PNGs with same data but different meta-data. Not sure how to get around this, yet!
)
}

}

test("stub") {

options "-stub"

when {
process {
"""
input[0] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
37 changes: 37 additions & 0 deletions modules/nf-core/busco/generateplot/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"versions": {
"content": [
[
"versions.yml:md5,726fa3440ea3a0b2e9d032d7e4d25e74"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-03T15:40:01.523993"
},
"stub": {
"content": [
{
"0": [
"busco_figure.png:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"1": [
"versions.yml:md5,726fa3440ea3a0b2e9d032d7e4d25e74"
],
"png": [
"busco_figure.png:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,726fa3440ea3a0b2e9d032d7e4d25e74"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-03T15:40:11.864276"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/busco/generateplot/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
busco/generateplot:
- "modules/nf-core/busco/generateplot/**"
Loading