Skip to content

Add QC check for empty files out of annotation #297

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

Merged
merged 5 commits into from
Jul 20, 2023
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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#290](https://github.com/nf-core/funcscan/pull/290) Merged pipeline template of nf-core/tools version 2.9, updated references. (by @jfy133)
- [#285](https://github.com/nf-core/funcscan/pull/285) Use nf-validation for samplesheet checking and added support for `fna.gz` input FASTA files (by @louperelo, @mirpedrol, @jfy133)

- [#295](https://github.com/nf-core/funcscan/pull/295) Add Prokka to MultiQC output (by @louperelo)

### `Fixed`

- [#296](https://github.com/nf-core/funcscan/pull/296) Fixed empty output when saving prodigal annotations. (reported by @louperelo, fix by @jasmezz)
- [#297](https://github.com/nf-core/funcscan/pull/297) Added check for empty annotation files prior going into screening. (❤️ to @alexhbnr for requesting, added by @jfy133)

### `Dependencies`

Expand Down
42 changes: 39 additions & 3 deletions workflows/funcscan.nf
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,15 @@ workflow FUNCSCAN {
AMPs
*/
if ( params.run_amp_screening ) {
AMP ( ch_prepped_input, ch_annotation_faa )
AMP (
ch_prepped_input,
ch_annotation_faa
.filter {
meta, file ->
if ( file.isEmpty() ) log.warn("Annotation of following sample produced produced an empty FAA file. AMP screening tools requiring this file will not be executed: ${meta.id}")
!file.isEmpty()
}
)
ch_versions = ch_versions.mix(AMP.out.versions)
}

Expand All @@ -254,7 +262,15 @@ workflow FUNCSCAN {
if (params.arg_skip_deeparg) {
ARG ( ch_prepped_input, [] )
} else {
ARG ( ch_prepped_input, ch_annotation_faa )
ARG (
ch_prepped_input,
ch_annotation_faa
.filter {
meta, file ->
if ( file.isEmpty() ) log.warn("Annotation of following sample produced produced an empty FAA file. AMP screening tools requiring this file will not be executed: ${meta.id}")
!file.isEmpty()
}
)
}
ch_versions = ch_versions.mix(ARG.out.versions)
}
Expand All @@ -263,7 +279,27 @@ workflow FUNCSCAN {
BGCs
*/
if ( params.run_bgc_screening ) {
BGC ( ch_prepped_input, ch_annotation_gff, ch_annotation_faa, ch_annotation_gbk )
BGC (
ch_prepped_input,
ch_annotation_gff
.filter {
meta, file ->
if ( file.isEmpty() ) log.warn("Annotation of following sample produced produced an empty GFF file. AMP screening tools requiring this file will not be executed: ${meta.id}")
!file.isEmpty()
},
ch_annotation_faa
.filter {
meta, file ->
if ( file.isEmpty() ) log.warn("Annotation of following sample produced produced an empty FAA file. AMP screening tools requiring this file will not be executed: ${meta.id}")
!file.isEmpty()
},
ch_annotation_gbk
.filter {
meta, file ->
if ( file.isEmpty() ) log.warn("Annotation of following sample produced produced an empty GBK file. AMP screening tools requiring this file will not be executed: ${meta.id}")
!file.isEmpty()
}
)
ch_versions = ch_versions.mix(BGC.out.versions)
}

Expand Down