Skip to content

Commit

Permalink
Merge pull request #297 from nf-core/start-qc
Browse files Browse the repository at this point in the history
Add QC check for empty files out of annotation
  • Loading branch information
jfy133 committed Jul 20, 2023
2 parents 3bce3b4 + 9d16c0d commit 2a5c3ee
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
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
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

0 comments on commit 2a5c3ee

Please sign in to comment.