diff --git a/docs/usage.md b/docs/usage.md index 30090ab6..7959ea74 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -129,10 +129,14 @@ These options are: - [kofamscan](https://github.com/takaram/kofam_scan) (`--kofam_dir`) +- [EUKulele](https://github.com/AlexanderLabWHOI/EUKulele) (`--eukulele_dbpath`) + All the options can run in the same time (e.g. `nextflow run main.nf -profile test,docker --eggnog --hmmdir hmms/ --rundbcan`) but each program has its own options that you will need to read carefully before running the pipeline. You can find more information about the different options in the [parameters page](https://nf-co.re/metatdenovo/parameters). For details about individual programs used, see their respective home pages. +If an Eggnog, kofam, or EUKulele database is already available, they can be specified with the above commands to skip the automatic download that the pipeline performs. + If you don't want run eggNOG-mapper, you will need to add the flag `--skip_eggnog`, otherwise metatdenovo will run the program automatically. ## Example pipeline command with some common features diff --git a/nextflow.config b/nextflow.config index 77d684e7..22ad658a 100644 --- a/nextflow.config +++ b/nextflow.config @@ -59,7 +59,7 @@ params { // KOfamscan options skip_kofamscan = false - kofam_dir = './kofam' + kofam_dir = './kofam/' // CAT cat = false @@ -71,7 +71,7 @@ params { // Eukulele options eukulele_db = null skip_eukulele = false - eukulele_dbpath = './eukulele' + eukulele_dbpath = './eukulele/' eukulele_method = 'mets' // MultiQC options multiqc_config = null @@ -98,7 +98,7 @@ params { custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" config_profile_contact = null config_profile_url = null - + // Max resource options // Defaults only, expecting to be overwritten diff --git a/subworkflows/local/eggnog.nf b/subworkflows/local/eggnog.nf index b9aa6ff6..16369570 100644 --- a/subworkflows/local/eggnog.nf +++ b/subworkflows/local/eggnog.nf @@ -17,7 +17,7 @@ workflow EGGNOG { String directoryName = eggnog_dbpath File directory = new File(directoryName) - String eggnogDB = eggnog_dbpath + "eggnog.db" + String eggnogDB = eggnog_dbpath + "/eggnog.db" File eggnogfile = new File(eggnogDB) if ( ! directory.exists() ) { diff --git a/subworkflows/local/eukulele.nf b/subworkflows/local/eukulele.nf index 67a5644b..82b11b76 100644 --- a/subworkflows/local/eukulele.nf +++ b/subworkflows/local/eukulele.nf @@ -9,6 +9,7 @@ include { SUM_TAXONOMY } from '../../modules/local/sum_taxo workflow SUB_EUKULELE { take: + eukulele // Channel: val(meta), path(fasta), val(database), path(directory) feature_counts diff --git a/subworkflows/local/kofamscan.nf b/subworkflows/local/kofamscan.nf index a5619b7c..2bbe1669 100644 --- a/subworkflows/local/kofamscan.nf +++ b/subworkflows/local/kofamscan.nf @@ -15,12 +15,30 @@ workflow KOFAMSCAN { main: ch_versions = Channel.empty() - - KOFAMSCAN_DOWNLOAD ( kofam_dir ) - KOFAMSCAN_SCAN( kofamscan, KOFAMSCAN_DOWNLOAD.out.ko_list, KOFAMSCAN_DOWNLOAD.out.koprofiles ) + String directoryName = kofam_dir + File directory = new File(directoryName) + String kofamdb = directoryName + "/ko_list" + File kolistfile = new File(kofamdb) + + if ( ! directory.exists() ) { + directory.mkdir() + } + + if ( ! kolistfile.exists() ) { + KOFAMSCAN_DOWNLOAD ( kofam_dir ) + ch_dbpath = KOFAMSCAN_DOWNLOAD.out.ko_list + ch_profiles = KOFAMSCAN_DOWNLOAD.out.koprofiles + + ch_versions = ch_versions.mix ( KOFAMSCAN_DOWNLOAD.out.versions ) + } else { + ch_dbpath = Channel.fromPath(kolistfile) + ch_profiles = Channel.fromPath(kofam_dir + "/profiles") + } + + KOFAMSCAN_SCAN( kofamscan, ch_dbpath, ch_profiles ) ch_versions = ch_versions.mix(KOFAMSCAN_SCAN.out.versions) - + SUM_KOFAMSCAN( KOFAMSCAN_SCAN.out.kout, fcs ) diff --git a/workflows/metatdenovo.nf b/workflows/metatdenovo.nf index 9b3ab832..3284f61f 100644 --- a/workflows/metatdenovo.nf +++ b/workflows/metatdenovo.nf @@ -287,7 +287,7 @@ workflow METATDENOVO { ch_se_reads_to_assembly = ch_interleaved_se.map { meta, fastq -> fastq } ch_pe_reads_to_assembly = Channel.empty() } - } + } else if ( params.bbnorm ) { BBMAP_BBNORM(ch_interleaved.collect { meta, fastq -> fastq }.map {[ [id:'all_samples', single_end:true], it ] } ) ch_pe_reads_to_assembly = BBMAP_BBNORM.out.fastq.map { it[1] } @@ -459,12 +459,10 @@ workflow METATDENOVO { // SUBWORKFLOW: run kofamscan on the ORF-called amino acid sequences // if( !params.skip_kofamscan ) { - File kofam_dir = new File(params.kofam_dir) - if ( ! kofam_dir.exists() ) { kofam_dir.mkdir() } ch_aa .map { [ it[0], it[1] ] } .set { ch_kofamscan } - KOFAMSCAN( ch_kofamscan, Channel.fromPath(params.kofam_dir), ch_fcs_for_summary) + KOFAMSCAN( ch_kofamscan, params.kofam_dir, ch_fcs_for_summary) ch_versions = ch_versions.mix(KOFAMSCAN.out.versions) ch_kofamscan_summary = KOFAMSCAN.out.kofamscan_summary.collect().map { it[1] } ch_merge_tables @@ -474,7 +472,6 @@ workflow METATDENOVO { ch_merge_tables .map { [ it[0], it[1], [] ] } .set { ch_merge_tables } - } // set up contig channel to use in CAT and TransRate