Commit 6eeba927 authored by Chris Cheshire's avatar Chris Cheshire
Browse files

Merge branch 'module_version_2' into dev

parents a0cf7ead be1f559c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -46,6 +46,12 @@ module_order:
    - picard
    - custom_content

custom_content:
  order:
    - fragment_lengths
    - software_versions
    - software_versions_unique

# Don't show % Dups in the General Stats table (we have this from Picard)
table_columns_visible:
    FastQC:
+2 −2
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ params {
        */

        "picard_markduplicates" {
            args          = "ASSUME_SORTED=true REMOVE_DUPLICATES=false VALIDATION_STRINGENCY=LENIENT TMP_DIR=tmp"
            args          = "-ASSUME_SORT_ORDER coordinate -REMOVE_DUPLICATES false -VALIDATION_STRINGENCY LENIENT -TMP_DIR tmp"
            suffix        = ".target.markdup"
            publish_files = false
        }
@@ -101,7 +101,7 @@ params {
        }

        "picard_dedup" {
            args          = "ASSUME_SORTED=true REMOVE_DUPLICATES=true VALIDATION_STRINGENCY=LENIENT TMP_DIR=tmp"
            args          = "-ASSUME_SORT_ORDER coordinate -REMOVE_DUPLICATES true -VALIDATION_STRINGENCY LENIENT -TMP_DIR tmp"
            suffix        = ".target.dedup"
            publish_files = false
        }
+19 −22
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
    "repos": {
        "nf-core/modules": {
            "bedtools/bamtobed": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "bedtools/genomecov": {
                "git_sha": "e8b33e6eb1be2a03abdd2c06068f9a5cebc02bb4"
@@ -13,64 +13,61 @@
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "bedtools/merge": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "bedtools/sort": {
                "git_sha": "3aacd46da2b221ed47aaa05c413a828538d2c2ae"
                "git_sha": "2959b4ba070d138d1577acc48d35cc669fbef972"
            },
            "bowtie2/align": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "bowtie2/build": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "cat/fastq": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "deeptools/computematrix": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "deeptools/plotheatmap": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "fastqc": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
            },
            "gunzip": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "picard/markduplicates": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/flagstat": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/idxstats": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/index": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/sort": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/stats": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "samtools/view": {
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "seacr/callpeak": {
                "git_sha": "4d89d6b2f0c478ac7ef80ece5cad44fdf7ffd614"
            },
            "ucsc/bedclip": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "ucsc/bedgraphtobigwig": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            },
            "untar": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "49da8642876ae4d91128168cd0db4f1c858d7792"
            }
        }
    }
+59 −39
Original line number Diff line number Diff line
/*
 * -----------------------------------------------------
 *  Utility functions used in nf-core DSL2 module files
 * -----------------------------------------------------
 */
//
//  Utility functions used in nf-core DSL2 module files
//

/*
 * Extract name of software tool from process name using $task.process
 */
//
// Extract name of software tool from process name using $task.process
//
def getSoftwareName(task_process) {
    return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
}

/*
 * Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
 */
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
    return task_process.tokenize(':')[-1]
}

//
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
//
def initOptions(Map args) {
    def Map options = [:]
    options.args            = args.args ?: ''
    options.args2           = args.args2 ?: ''
    options.publish_by_id = args.publish_by_id ?: false
    options.args3           = args.args3 ?: ''
    options.publish_by_meta = args.publish_by_meta ?: []
    options.publish_dir     = args.publish_dir ?: ''
    options.publish_files   = args.publish_files
    options.suffix          = args.suffix ?: ''
    return options
}

/*
 * Tidy up and join elements of a list to return a path string
 */
//
// Tidy up and join elements of a list to return a path string
//
def getPathFromList(path_list) {
    def paths = path_list.findAll { item -> !item?.trim().isEmpty() }      // Remove empty entries
    paths     = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
    return paths.join('/')
}

/*
 * Function to save/publish module results
 */
//
// Function to save/publish module results
//
def saveFiles(Map args) {
    if (!args.filename.endsWith('.version.txt')) {
    def ioptions  = initOptions(args.options)
    def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
        if (ioptions.publish_by_id) {
            path_list.add(args.publish_id)

    // Do not publish versions.yml unless running from pytest workflow
    if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
        return null
    }
    if (ioptions.publish_by_meta) {
        def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
        for (key in key_list) {
            if (args.meta && key instanceof String) {
                def path = key
                if (args.meta.containsKey(key)) {
                    path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
                }
                path = path instanceof String ? path : ''
                path_list.add(path)
            }
        }
    }
    if (ioptions.publish_files instanceof Map) {
        for (ext in ioptions.publish_files) {
@@ -56,4 +76,4 @@ def saveFiles(Map args) {
        return "${getPathFromList(path_list)}/$args.filename"
    }
}
}
+1 −1
Original line number Diff line number Diff line
include { initOptions; saveFiles; getSoftwareName } from './common/functions'
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './common/functions'

params.options = [:]
options        = initOptions(params.options)
Loading