Skip to content

Commit

Permalink
fixed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ens-ftricomi committed Apr 12, 2024
1 parent e9f7feb commit ef5bc79
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 45 deletions.
7 changes: 0 additions & 7 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ params {
cleanCache = false // Default to false
}

beforeCleanup {
if (params.cleanCache) {
// Clean cache directories
exec "rm -rf ${cacheDir}/*"
}
}

env {
ENSCODE = "${params.enscode}"
PERL5LIB = "${params.enscode}/ensembl/modules:${params.enscode}/ensembl-analysis/modules:" +
Expand Down
1 change: 0 additions & 1 deletion pipelines/nextflow/modules/fetch_genome.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ process FETCH_GENOME {
afterScript "sleep $params.files_latency" // Needed because of file system latency
input:
val gca
val cache_dir

output:
//tuple val(db), val(busco_dataset), path("*.fna")
Expand Down
1 change: 0 additions & 1 deletion pipelines/nextflow/modules/fetch_protein.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ process FETCH_PROTEINS {

input:
val(db)
val cache_dir

output:
//tuple val(db), val(busco_dataset), path("*_translations.fa")
Expand Down
10 changes: 4 additions & 6 deletions pipelines/nextflow/modules/species_metadata.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ process SPECIES_METADATA {

input:
val dbname
val output_dir
val project

output:
stdout
Expand Down Expand Up @@ -60,11 +58,11 @@ process SPECIES_METADATA {
if [ "\$BRC_ORGANISM" = "" ]; then BRC_ORGANISM=""; fi
HAS_GENES=\$(has_any "gene")
PUBLISH_DIR=$output_dir
if [ $project == 'ensembl' ]; then
PUBLISH_DIR="$output_dir/\$SPECIES/\$GCA/\$SOURCE/"
PUBLISH_DIR=${params.outDir}
if [ ${params.project} == 'ensembl' ]; then
PUBLISH_DIR="${params.outDir}/\$SPECIES/\$GCA/\$SOURCE/"
fi
if [ $project == 'brc' ]; then
if [ ${params.project} == 'brc' ]; then
PUBLISH_DIR="$output_dir/\$BRC_COMPONENT/\$BRC_ORGANISM"
fi
Expand Down
4 changes: 2 additions & 2 deletions pipelines/nextflow/subworkflows/run_busco.nf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ workflow RUN_BUSCO{

// Run Busco in genome mode
if (busco_mode.contains('genome')) {
genomeFile = FETCH_GENOME(db_meta.gca, params.cacheDir)
genomeFile = FETCH_GENOME(db_meta.gca)
buscoGenomeOutput = BUSCO_GENOME_LINEAGE(buscoDataset, genomeFile)
buscoGenomeSummaryFile = BUSCO_GENOME_OUTPUT(db_meta, buscoGenomeOutput, "genome", params.project)
if (params.copyToFtp) {
Expand All @@ -70,7 +70,7 @@ workflow RUN_BUSCO{
if (params.project == 'brc') {
buscoDataset = buscoDataset.filter{ it[0].has_genes == "1" } ????
}
proteinFile = FETCH_PROTEINS (db_meta.name, params.cacheDir)
proteinFile = FETCH_PROTEINS (db_meta.name)
buscoProteinOutput = BUSCO_PROTEIN_LINEAGE(buscoDataset, proteinFile)
buscoProteinSummaryFile = BUSCO_PROTEIN_OUTPUT(db_meta, buscoProteinOutput, "protein", params.project)
if (copyToFtp) {
Expand Down
4 changes: 2 additions & 2 deletions pipelines/nextflow/subworkflows/run_ensembl_stats.nf
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ include { CLEANING } from '../modules/cleaning.nf'

workflow RUN_ENSEMBL_STATS{
take:
tuple val(dbname),val(db_meta), bool(apply_stats)
tuple val(dbname),val(db_meta)

main:

statisticsFile = RUN_STATISTICS (dbname, params.cacheDir)
statisticsFile = RUN_STATISTICS (dbname)
if(params.apply_stats){
UPLOAD_STATISTICS_ON_CORE(statisticsFile, db_meta)
}
Expand Down
6 changes: 3 additions & 3 deletions pipelines/nextflow/subworkflows/run_omark.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ include { CLEANING } from '../modules/cleaning.nf'

workflow RUN_OMARK{
take:
tuple val(dbname),val(db_meta), bool(copyToFtp)
tuple val(dbname),val(db_meta)

main:
//
// MODULE: Get canonical protein from db
//
proteinFile = FETCH_PROTEINS (dbname, params.cacheDir)
proteinFile = FETCH_PROTEINS (dbname)
//
// MODULE: Get orthologous groups from Omamer db
//
Expand All @@ -64,7 +64,7 @@ workflow RUN_OMARK{
omarkOutput = OMARK (omamerOutput)

omarkSummaryFile = OMARK_OUTPUT(db_meta, omarkOutput, params.project)
if (copyToFtp) {
if (params.copyToFtp) {
COPY_OMARK_OUTPUT(db_meta, omarkSummaryFile)
}

Expand Down
46 changes: 23 additions & 23 deletions pipelines/nextflow/workflows/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if (params.help) {
include { RUN_BUSCO } from '../subworkflows/run_busco.nf'
include { RUN_OMARK } from '../subworkflows/run_omark.nf'
include { RUN_ENSEMBL_STATS } from '../subworkflows/run_ensembl_stats.nf'

include { BUILD_METADATA } from '../modules/build_metadata.nf'
include { SPECIES_METADATA } from '../modules/species_metadata.nf'

/*
Expand All @@ -117,34 +117,34 @@ workflow STATISTICS{
def gca = row[0]
def taxon = row[1]
def busco_mode = 'genome'
def copyToFtp = False

def copyToFtp = false
db_meta = BUILD_METADATA(gca,taxon_id)
RUN_BUSCO(db_meta, busco_mode, copyToFtp)
}
}

if (params.run_busco_core) {
if (params.run_busco_core || params.run_omark || params.run_ensembl_stats) {
csvData = Channel.fromPath(params.csvFile).splitCsv()
// Get db name and its metadata
db = csvData.flatten()
db_meta = SPECIES_METADATA(db, params.outDir, params.project)
db_meta = SPECIES_METADATA(db)

if (params.run_busco_core) {
RUN_BUSCO(db_meta, busco_mode, params.copyToFtp)
}

if (params.run_omark) {
RUN_OMARK(db, db_meta)
}

if (params.run_ensembl_stats) {
RUN_ENSEMBL_STATS(db, db_meta)
}
}
afterScript:
"""
if (params.cleanCache) {
// Clean cache directories
exec "rm -rf ${params.cacheDir}/*"
}

if (params.run_omark) {
csvData = Channel.fromPath(params.csvFile).splitCsv()
// Get db name and its metadata
db = csvData.flatten()
db_meta = SPECIES_METADATA(db, params.outDir, params.project)
RUN_OMARK(db, db_meta, params.copyToFtp)
}

if (params.run_ensembl_stats) {
csvData = Channel.fromPath(params.csvFile).splitCsv()
// Get db name and its metadata
db = csvData.flatten()
db_meta = SPECIES_METADATA(db, params.outDir, params.project)
RUN_ENSEMBL_STATS(db, db_meta, params.apply_stats)
}

"""
}

0 comments on commit ef5bc79

Please sign in to comment.