Skip to content

Commit

Permalink
Finalize eggnog download/map rework
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrikarddaniel committed Feb 9, 2024
1 parent 4f5f0a6 commit 0b3da14
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 32 deletions.
13 changes: 8 additions & 5 deletions modules/local/eggnog/download.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ process EGGNOG_DOWNLOAD {
'biocontainers/eggnog-mapper:2.1.9--pyhdfd78af_0' }"

input:
//path "eggnog_dbpath"

output:
path("eggnog_db") , emit: db
path "versions.yml", emit: versions
path "eggnog.db" , emit: eggnog_db
path "eggnog_proteins.dmnd" , emit: dmnd
path "eggnog.taxa.db" , emit: taxa_db
path "eggnog.taxa.db.traverse.pkl", emit: pkl
path "*" , emit: all
path "versions.yml" , emit: versions, optional: true // Optional to allow skipping if this is the only file that's missing

script:
def args = task.ext.args ?: ''

"""
mkdir eggnog_db
#mkdir eggnog_db
download_eggnog_data.py \\
$args \\
-y \\
--data_dir eggnog_db
--data_dir .
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
1 change: 1 addition & 0 deletions modules/local/eggnog/mapper.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process EGGNOG_MAPPER {
input:
tuple val(meta), path(fasta)
path(db)
path(eggnog_db) // Marker purpose only; to make execution wait for the download process to finish

output:
tuple val(meta), path("*.emapper.hits.gz") , emit: hits
Expand Down
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ params {

// Eggnog options
eggnog_dbpath = 'eggnog'
create_eggnogdb = false
skip_eggnog = false

// KOfamscan options
Expand Down
9 changes: 1 addition & 8 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,7 @@
"default": "eggnog",
"description": "Specify EGGNOG database path",
"fa_icon": "far fa-file-code",
"help_text": "This parameter specifies where you have an EGGNOG database, or, where it will be created using the --create_eggnog_db parameter."
},
"create_eggnogdb": {
"type": "boolean",
"default": false,
"fa_icon": "fas fa-forward",
"description": "create an EGGNOG database",
"help_text": "Use this parameter if you want to download the EGGNOG database."
"help_text": "This parameter specifies where you have an EGGNOG database, or, where it will be created using the --create_eggnog_db parameter. The directory must exist."
},
"skip_kofamscan": {
"type": "boolean",
Expand Down
20 changes: 6 additions & 14 deletions subworkflows/local/eggnog.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ workflow EGGNOG {
faa
collect_fcs
dbpath
createdb

main:
ch_versions = Channel.empty()

if ( createdb ) {
// Not allowed, or?
if ( ! file(dbpath).exists() ) {
file(dbpath).mkdir()
}
EGGNOG_DOWNLOAD( )
ch_dbpath = EGGNOG_DOWNLOAD.out.db
ch_versions = ch_versions.mix ( EGGNOG_DOWNLOAD.out.versions )
} else {
ch_dbpath = Channel.fromPath(dbpath, checkIfExists: true)
}

EGGNOG_MAPPER ( faa, ch_dbpath )
ch_dbpath = Channel.fromPath(dbpath, checkIfExists: true)

EGGNOG_DOWNLOAD()
ch_versions = ch_versions.mix ( EGGNOG_DOWNLOAD.out.versions )

EGGNOG_MAPPER ( faa, ch_dbpath, EGGNOG_DOWNLOAD.out.eggnog_db )
ch_versions = ch_versions.mix ( EGGNOG_MAPPER.out.versions )

EGGNOG_SUM ( EGGNOG_MAPPER.out.emappertsv, collect_fcs )
Expand Down
5 changes: 1 addition & 4 deletions workflows/metatdenovo.nf
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,8 @@ workflow METATDENOVO {
//
// SUBWORKFLOW: run eggnog_mapper on the ORF-called amino acid sequences
//
//ch_eggnog_dbpath = Channel.fromPath(params.eggnog_dbpath, checkIfExists: true)
//ch_create_eggnogdb = Channel.of(params.create_eggnogdb)
if ( ! params.skip_eggnog ) {
//EGGNOG(ch_protein, ch_fcs_for_summary, ch_eggnog_dbpath, ch_create_eggnogdb )
EGGNOG(ch_protein, ch_fcs_for_summary, params.eggnog_dbpath, params.create_eggnogdb )
EGGNOG(ch_protein, ch_fcs_for_summary, params.eggnog_dbpath)
ch_versions = ch_versions.mix(EGGNOG.out.versions)
ch_merge_tables = EGGNOG.out.sumtable
} else {
Expand Down

0 comments on commit 0b3da14

Please sign in to comment.