Skip to content

Commit

Permalink
Merge pull request #191 from tfalkarkea/issue-168-deal-properly-with-…
Browse files Browse the repository at this point in the history
…download-of-data

Issue 168 deal properly with download of data
  • Loading branch information
danilodileo authored Oct 11, 2023
2 parents 11ec34c + cdde51d commit 26d91c7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ params {

// KOfamscan options
skip_kofamscan = false
kofam_dir = './kofam'
kofam_dir = './kofam/'

// CAT
cat = false
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/eggnog.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down
1 change: 1 addition & 0 deletions subworkflows/local/eukulele.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 22 additions & 4 deletions subworkflows/local/kofamscan.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 )


Expand Down
7 changes: 2 additions & 5 deletions workflows/metatdenovo.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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] }
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 26d91c7

Please sign in to comment.