Skip to content

Commit

Permalink
ensure no-domain works
Browse files Browse the repository at this point in the history
  • Loading branch information
alpae committed Jan 16, 2025
1 parent a329a31 commit 77dac24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
18 changes: 10 additions & 8 deletions subworkflows/local/domains/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
// Modules
include {ADD_DOMAINS} from "./../../../modules/local/domains"

def createEmptyFile() {
def emptyFile = file("empty.txt")
emptyFile.text = "" // Write an empty string
return emptyFile
}

workflow DOMAINS {
take:
database
known_domains
cath_names
pfam_names

main:
// TODO should be extended to include computation of new domain annotation
// for unknown sequences

known_domains = (params.known_domains != null) ? Channel.fromPath("${params.known_domains}/*") : Channel.fromPath(createEmptyFile())
cath_names = (params.cath_names_path != null) ? Channel.fromPath(params.cath_names_path) : Channel.fromPath(createEmptyFile())
pfam_names = (params.pfam_names_path != null) ? Channel.fromPath(params.pfam_names_path) : Channel.fromPath(createEmptyFile())
ADD_DOMAINS(database, known_domains, cath_names, pfam_names)
domains_h5 = ADD_DOMAINS.out.domains_h5

Expand All @@ -23,9 +28,6 @@ workflow DOMAINS {

workflow {
database = Channel.fromPath(params.database)
domains = Channel.fromPath("${params.known_domains}/*")
cath_names = Channel.fromPath(params.cath_names_path)
pfam_names = Channel.fromPath(params.pfam_names_path)

DOMAINS(database, domains, cath_names, pfam_names)
DOMAINS(database)
}
13 changes: 3 additions & 10 deletions workflows/oma_browser_build.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,9 @@ workflow OMA_BROWSER_BUILD {
vps_base,
EXTRACT_DARWIN.out.splice_json)

if (params.known_domains != null) {
domains = Channel.fromPath("${params.known_domains}/*")
cath_names = Channel.fromPath(params.cath_names_path)
pfam_names = Channel.fromPath(params.pfam_names_path)
// import Domains
DOMAINS(IMPORT_HDF5.out.db_h5)

DOMAINS(IMPORT_HDF5.out.db_h5, domains, cath_names, pfam_names)
domains_h5 = DOMAINS.out.domains_h5
} else {
domains_h5 = Channel.empty()
}
CACHE_BUILDER(IMPORT_HDF5.out.db_h5)
GEN_BROWSER_AUX_FILES(IMPORT_HDF5.out.db_h5)
download_files = GEN_BROWSER_AUX_FILES.out.genomes_json.mix(GEN_BROWSER_AUX_FILES.out.speciestree)
Expand All @@ -57,7 +50,7 @@ workflow OMA_BROWSER_BUILD {
gaf)

h5_dbs_to_combine = IMPORT_HDF5.out.db_h5.mix(
domains_h5,
DOMAINS.out.domains_h5,
GENERATE_XREFS.out.xref_db,
GO_IMPORT.out.go_h5,
CACHE_BUILDER.out.cache_h5,
Expand Down

0 comments on commit 77dac24

Please sign in to comment.