Skip to content

Commit

Permalink
Merge pull request #31 from itrujnara/bug_fixes
Browse files Browse the repository at this point in the history
Improved path handling in get_orthologs
  • Loading branch information
JoseEspinosa authored May 24, 2024
2 parents 58c1b95 + 3dae2cb commit f2d0a43
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
8 changes: 8 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,31 @@
"oma_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the OMA database.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the OMA database.",
"fa_icon": "fas fa-database"
},
"oma_uniprot_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the Uniprot-OMA ID map.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the OMA-Uniprot ID map.",
"fa_icon": "fas fa-database"
},
"oma_ensembl_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the Ensembl-OMA ID map.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the OMA-Ensembl ID map.",
"fa_icon": "fas fa-database"
},
"oma_refseq_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the RefSeq-OMA ID map.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the OMA-RefSeq ID map.",
"fa_icon": "fas fa-database"
Expand All @@ -115,6 +119,7 @@
"panther_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the PANTHER database.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the PANTHER database.",
"fa_icon": "fas fa-database"
Expand All @@ -136,6 +141,7 @@
"orthoinspector_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the OrthoInspector database.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the OrthoInspector database.",
"fa_icon": "fas fa-database"
Expand All @@ -150,13 +156,15 @@
"eggnog_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the EggNOG database.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the EggNOG database.",
"fa_icon": "fas fa-database"
},
"eggnog_idmap_path": {
"type": "string",
"format": "path",
"exists": true,
"description": "Path to the EggNOG ID map.",
"help_text": "If `local_databases` is set to `true`, the pipeline will use this path to the EggNOG ID map.",
"fa_icon": "fas fa-database"
Expand Down
48 changes: 28 additions & 20 deletions subworkflows/local/get_orthologs.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ workflow GET_ORTHOLOGS {
ch_samplesheet_fasta

main:
ch_versions = Channel.empty()
ch_orthogroups = Channel.empty()
ch_versions = Channel.empty()
ch_orthogroups = Channel.empty()

ch_oma_groups = params.oma_path ? Channel.value(file(params.oma_path)) : Channel.empty()
ch_oma_uniprot = params.oma_uniprot_path ? Channel.value(file(params.oma_uniprot_path)) : Channel.empty()
ch_oma_ensembl = params.oma_ensembl_path ? Channel.value(file(params.oma_ensembl_path)) : Channel.empty()
ch_oma_refseq = params.oma_refseq_path ? Channel.value(file(params.oma_refseq_path)) : Channel.empty()
ch_panther = params.panther_path ? Channel.value(file(params.panther_path)) : Channel.empty()
ch_eggnog = params.eggnog_path ? Channel.value(file(params.eggnog_path)) : Channel.empty()
ch_eggnog_idmap = params.eggnog_idmap_path ? Channel.value(file(params.eggnog_idmap_path)) : Channel.empty()

fasta_input = true
ch_samplesheet_fasta.ifEmpty {
Expand Down Expand Up @@ -69,10 +77,10 @@ workflow GET_ORTHOLOGS {
if (params.local_databases) {
FETCH_OMA_GROUP_LOCAL (
ch_query,
params.oma_path,
params.oma_uniprot_path,
params.oma_ensembl_path,
params.oma_refseq_path
ch_oma_groups,
ch_oma_uniprot,
ch_oma_ensembl,
ch_oma_refseq
)

ch_orthogroups
Expand All @@ -96,7 +104,7 @@ workflow GET_ORTHOLOGS {
if (params.local_databases) {
FETCH_PANTHER_GROUP_LOCAL (
ch_query,
params.panther_path
ch_panther
)

ch_orthogroups
Expand Down Expand Up @@ -129,10 +137,10 @@ workflow GET_ORTHOLOGS {

FETCH_EGGNOG_GROUP_LOCAL (
ch_query,
params.eggnog_path,
params.eggnog_idmap_path,
params.oma_ensembl_path,
params.oma_refseq_path,
ch_eggnog,
ch_eggnog_idmap,
ch_oma_ensembl,
ch_oma_refseq,
params.offline_run
)

Expand All @@ -148,10 +156,10 @@ workflow GET_ORTHOLOGS {
if (!params.skip_oma) {
FETCH_OMA_GROUP_LOCAL (
ch_query,
params.oma_path,
params.oma_uniprot_path,
params.oma_ensembl_path,
params.oma_refseq_path
ch_oma_groups,
ch_oma_uniprot,
ch_oma_ensembl,
ch_oma_refseq
)

ch_orthogroups
Expand All @@ -164,7 +172,7 @@ workflow GET_ORTHOLOGS {
if (!params.skip_panther) {
FETCH_PANTHER_GROUP_LOCAL (
ch_query,
params.panther_path
ch_panther
)

ch_orthogroups
Expand All @@ -177,10 +185,10 @@ workflow GET_ORTHOLOGS {
if(!params.skip_eggnog) {
FETCH_EGGNOG_GROUP_LOCAL (
ch_query,
params.eggnog_path,
params.eggnog_idmap_path,
params.oma_ensembl_path,
params.oma_refseq_path,
ch_eggnog,
ch_eggnog_idmap,
ch_oma_ensembl,
ch_oma_refseq,
params.offline_run
)

Expand Down

0 comments on commit f2d0a43

Please sign in to comment.