Commit ae2eb1e8 authored by Chris Cheshire's avatar Chris Cheshire
Browse files

Updated the seacr module

parent 542f814c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@
                "git_sha": "c5235a983d454787fa0c3247b02086969217163b"
            },
            "seacr/callpeak": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
                "git_sha": "4d89d6b2f0c478ac7ef80ece5cad44fdf7ffd614"
            },
            "ucsc/bedclip": {
                "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d"
+32 −22
Original line number Diff line number Diff line
@@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
    return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
}

//
// 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
//
@@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// 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 ]

    // 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) {
@@ -65,4 +76,3 @@ def saveFiles(Map args) {
        return "${getPathFromList(path_list)}/$args.filename"
    }
}
}
+15 −10
Original line number Diff line number Diff line
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'

params.options = [:]
options        = initOptions(params.options)
@@ -13,30 +13,35 @@ process SEACR_CALLPEAK {
        mode: params.publish_dir_mode,
        saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }

    conda (params.enable_conda ? "bioconda::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.29.2" : null)
    conda (params.enable_conda ? "bioconda::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.30.0" : null)
    if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
        container "https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0"
        container "https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0"
    } else {
        container 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0'
        container 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0'
    }

    input:
    tuple val(meta), path(bedgraph), path(ctrlbedgraph)
    val (threshold)

    output:
    tuple val(meta), path("*.bed"), emit: bed
    path "*.version.txt"          , emit: version
    path "versions.yml"           , emit: versions

    script:
    def software = getSoftwareName(task.process)
    def prefix          = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
    def function_switch = ctrlbedgraph ? "$ctrlbedgraph" : "$threshold"
    """
    SEACR_1.3.sh \\
        $bedgraph \\
        $ctrlbedgraph \\
        $function_switch \\
        $options.args \\
        $prefix

    echo $VERSION > ${software}.version.txt
    cat <<-END_VERSIONS > versions.yml
    ${getProcessName(task.process)}:
        ${getSoftwareName(task.process)}: \$(echo $VERSION)
        bedtools: \$(bedtools --version | sed -e "s/bedtools v//g")
        r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
    END_VERSIONS
    """
}
+8 −3
Original line number Diff line number Diff line

name: seacr_callpeak
description: Call peaks using SEACR on sequenced reads in bedgraph format
keywords:
@@ -30,6 +31,10 @@ input:
        type: file
        description: |
            Control (IgG) data bedgraph file to generate an empirical threshold for peak calling.
    - threshold:
        type: value
        description: |
            Threshold value used to call peaks if the ctrlbedgraph input is set to []. Set to 1 if using a control bedgraph
output:
    - meta:
        type: map
@@ -40,9 +45,9 @@ output:
        type: file
        description: Bed file containing the calculated peaks.
        pattern: "*.bed"
    - version:
    - versions:
        type: file
        description: File containing software version
        pattern: "*.{version.txt}"
        description: File containing software versions
        pattern: "versions.yml"
authors:
    - "@chris-cheshire"