Skip to content

Commit

Permalink
feat: create files summarizing annotation issues and failures
Browse files Browse the repository at this point in the history
  • Loading branch information
peterk87 committed Jul 25, 2024
1 parent 01f61e2 commit fb0e4bf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
11 changes: 11 additions & 0 deletions conf/modules_illumina.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ process {
]
}

withName: 'VADR_SUMMARIZE_ISSUES' {
ext.args = ''
publishDir = [
[
path: { "${params.outdir}/annotation" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
]
}

withName: 'POST_TABLE2ASN' {
ext.args = ''
publishDir = [
Expand Down
11 changes: 11 additions & 0 deletions conf/modules_nanopore.config
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@ process {
]
}

withName: 'VADR_SUMMARIZE_ISSUES' {
ext.args = ''
publishDir = [
[
path: { "${params.outdir}/annotation" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
]
}

withName: 'POST_TABLE2ASN' {
ext.args = ''
publishDir = [
Expand Down
18 changes: 18 additions & 0 deletions modules/local/vadr.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,21 @@ process VADR {
END_VERSIONS
"""
}

process VADR_SUMMARIZE_ISSUES {
executor 'local'
memory 100.MB

input:
path(vadr_output, stageAs: "input*/*")

output:
path('vadr-annotation-issues.txt'), emit: issues
path('vadr-annotation-failed-sequences.txt'), emit: failed

script:
"""
cat input*/**/*.alt.list | awk 'NR == 1 || \$0 !~ /^#/' > vadr-annotation-issues.txt
cat input*/**/*.fail.list > vadr-annotation-failed-sequences.txt
"""
}
3 changes: 2 additions & 1 deletion workflows/illumina.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include { BLAST_MAKEBLASTDB } from '../modules/local/blast_makeblastdb'
include { BLAST_BLASTN } from '../modules/local/blastn'
include { CAT_ILLUMINA_FASTQ } from '../modules/local/cat_illumina_fastq'
include { ZSTD_DECOMPRESS as ZSTD_DECOMPRESS_FASTA; ZSTD_DECOMPRESS as ZSTD_DECOMPRESS_CSV } from '../modules/local/zstd_decompress'
include { VADR } from '../modules/local/vadr'
include { VADR; VADR_SUMMARIZE_ISSUES } from '../modules/local/vadr'
include { PRE_TABLE2ASN; TABLE2ASN; POST_TABLE2ASN } from '../modules/local/table2asn'
include { CUSTOM_DUMPSOFTWAREVERSIONS as SOFTWARE_VERSIONS } from '../modules/nf-core/modules/custom/dumpsoftwareversions/main'

Expand Down Expand Up @@ -92,6 +92,7 @@ workflow ILLUMINA {
VADR.out.feature_table
.combine(VADR.out.pass_fasta, by: 0)
.set { ch_pre_table2asn }
VADR_SUMMARIZE_ISSUES(VADR.out.vadr_outdir.map { [it[1]] }.collect())
PRE_TABLE2ASN(ch_pre_table2asn)
ch_versions = ch_versions.mix(PRE_TABLE2ASN.out.versions)
TABLE2ASN(PRE_TABLE2ASN.out.table2asn_input)
Expand Down
3 changes: 2 additions & 1 deletion workflows/nanopore.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include { BLAST_BLASTN as BLAST_BLASTN_IRMA } from '../modules
include { BLAST_BLASTN as BLAST_BLASTN_CONSENSUS } from '../modules/local/blastn'
include { BLAST_BLASTN as BLAST_BLASTN_CONSENSUS_REF_DB } from '../modules/local/blastn'
include { CUSTOM_DUMPSOFTWAREVERSIONS as SOFTWARE_VERSIONS } from '../modules/nf-core/modules/custom/dumpsoftwareversions/main'
include { VADR } from '../modules/local/vadr'
include { VADR; VADR_SUMMARIZE_ISSUES } from '../modules/local/vadr'
include { PRE_TABLE2ASN; TABLE2ASN; POST_TABLE2ASN } from '../modules/local/table2asn'
include { MULTIQC } from '../modules/local/multiqc'

Expand Down Expand Up @@ -247,6 +247,7 @@ workflow NANOPORE {
VADR.out.feature_table
.combine(VADR.out.pass_fasta, by: 0)
.set { ch_pre_table2asn }
VADR_SUMMARIZE_ISSUES(VADR.out.vadr_outdir.map { [it[1]] }.collect())
PRE_TABLE2ASN(ch_pre_table2asn)
ch_versions = ch_versions.mix(PRE_TABLE2ASN.out.versions)
TABLE2ASN(PRE_TABLE2ASN.out.table2asn_input)
Expand Down

0 comments on commit fb0e4bf

Please sign in to comment.