nf-core_modules/modules/bedtools/genomecov/main.nf

56 lines
1.7 KiB
Text
Raw Normal View History

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process BEDTOOLS_GENOMECOV {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
2021-02-16 23:58:23 +00:00
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
2021-01-28 14:24:33 +00:00
container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0"
} else {
2021-01-28 14:24:33 +00:00
container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0"
}
input:
Enhance bedtools (#557) * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * Generalized intersect and genomecov * Finished subtract and tests for intersect and genomecov * Finished up meta YAMLs * Replaced functions.nf in subtract * do not add "." in prefix when suffix is set (#550) when using the suffix option in the fastqc module it gets added with a "." to the ${meta.id}, this leads to sample name clashing when passing the fastqc output of raw and processed files suffixed with "trim" or "clean" to multiqc. I suggest to remove the "." this would also be more consistent with the prefix def in most of the other nf-core modules. ##' Ref: https://nfcore.slack.com/archives/CJRH30T6V/p1625129138043900 * Modules TLC (#551) * Modules TLC * Fix all the tests * Fix linting failures (#552) * Modules TLC * Fix all the tests * Fix linting failures * Soft-link build files to bypass lint error * Update software/rseqc/junctionannotation/main.nf * Fix rsem (#555) * bump bcftools filter * fix bcftools * rsem/preparereference * added calculateexpression * meta.yml and pytest_software * paired end * add test.yml * fix rseqc/junctionsaturation (#553) * bump bcftools filter * junctionsaturation meta.yml and test * pytest config entry * bump bcftools version down again * fix test * fix bcftools * Adapt linting action (#556) * bump bcftools filter * fix bcftools * adapt module linting * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Fixed variable names in intersect and genomecov Co-authored-by: Sviatoslav Sidorov <sviatoslav.sidorov@crick.ac.uk> Co-authored-by: riederd <dietmar.rieder@i-med.ac.at> Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> Co-authored-by: Kevin Menden <kevin.menden@t-online.de>
2021-07-07 08:44:09 +00:00
tuple val(meta), path(intervals)
path sizes
val extension
output:
Enhance bedtools (#557) * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * Generalized intersect and genomecov * Finished subtract and tests for intersect and genomecov * Finished up meta YAMLs * Replaced functions.nf in subtract * do not add "." in prefix when suffix is set (#550) when using the suffix option in the fastqc module it gets added with a "." to the ${meta.id}, this leads to sample name clashing when passing the fastqc output of raw and processed files suffixed with "trim" or "clean" to multiqc. I suggest to remove the "." this would also be more consistent with the prefix def in most of the other nf-core modules. ##' Ref: https://nfcore.slack.com/archives/CJRH30T6V/p1625129138043900 * Modules TLC (#551) * Modules TLC * Fix all the tests * Fix linting failures (#552) * Modules TLC * Fix all the tests * Fix linting failures * Soft-link build files to bypass lint error * Update software/rseqc/junctionannotation/main.nf * Fix rsem (#555) * bump bcftools filter * fix bcftools * rsem/preparereference * added calculateexpression * meta.yml and pytest_software * paired end * add test.yml * fix rseqc/junctionsaturation (#553) * bump bcftools filter * junctionsaturation meta.yml and test * pytest config entry * bump bcftools version down again * fix test * fix bcftools * Adapt linting action (#556) * bump bcftools filter * fix bcftools * adapt module linting * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Fixed variable names in intersect and genomecov Co-authored-by: Sviatoslav Sidorov <sviatoslav.sidorov@crick.ac.uk> Co-authored-by: riederd <dietmar.rieder@i-med.ac.at> Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> Co-authored-by: Kevin Menden <kevin.menden@t-online.de>
2021-07-07 08:44:09 +00:00
tuple val(meta), path("*.${extension}"), emit: genomecov
path "*.version.txt" , emit: version
script:
2021-01-28 14:24:33 +00:00
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
Enhance bedtools (#557) * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * hifiasm copied from fastqc * hifiasm tests init from fastqc * meta.yml init; test.yml and main.nf for printing version * Add hifiasm version printing * Removed spaced on an empty line * Reverted hifiasm from main * Generalized intersect and genomecov * Finished subtract and tests for intersect and genomecov * Finished up meta YAMLs * Replaced functions.nf in subtract * do not add "." in prefix when suffix is set (#550) when using the suffix option in the fastqc module it gets added with a "." to the ${meta.id}, this leads to sample name clashing when passing the fastqc output of raw and processed files suffixed with "trim" or "clean" to multiqc. I suggest to remove the "." this would also be more consistent with the prefix def in most of the other nf-core modules. ##' Ref: https://nfcore.slack.com/archives/CJRH30T6V/p1625129138043900 * Modules TLC (#551) * Modules TLC * Fix all the tests * Fix linting failures (#552) * Modules TLC * Fix all the tests * Fix linting failures * Soft-link build files to bypass lint error * Update software/rseqc/junctionannotation/main.nf * Fix rsem (#555) * bump bcftools filter * fix bcftools * rsem/preparereference * added calculateexpression * meta.yml and pytest_software * paired end * add test.yml * fix rseqc/junctionsaturation (#553) * bump bcftools filter * junctionsaturation meta.yml and test * pytest config entry * bump bcftools version down again * fix test * fix bcftools * Adapt linting action (#556) * bump bcftools filter * fix bcftools * adapt module linting * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/intersect/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update software/bedtools/subtract/meta.yml Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/genomecov/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Update tests/software/bedtools/intersect/main.nf Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> * Fixed variable names in intersect and genomecov Co-authored-by: Sviatoslav Sidorov <sviatoslav.sidorov@crick.ac.uk> Co-authored-by: riederd <dietmar.rieder@i-med.ac.at> Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> Co-authored-by: Kevin Menden <kevin.menden@t-online.de>
2021-07-07 08:44:09 +00:00
if (intervals.name =~ /\.bam/) {
"""
bedtools \\
genomecov \\
-ibam $intervals \\
$options.args \\
> ${prefix}.${extension}
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
"""
} else {
"""
bedtools \\
genomecov \\
-i $intervals \\
-g $sizes \\
$options.args \\
> ${prefix}.${extension}
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
"""
}
}