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

45 lines
1.5 KiB
Text
Raw Normal View History

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:]
options = initOptions(params.options)
process BEDTOOLS_INTERSECT {
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-01-08 19:44:02 +00:00
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-27 14:23:52 +00:00
container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0"
} else {
2021-01-27 14:23:52 +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(intervals1), path(intervals2)
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: intersect
path "versions.yml" , emit: versions
script:
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bedtools \\
intersect \\
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
-a $intervals1 \\
-b $intervals2 \\
$options.args \\
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
> ${prefix}.${extension}
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
"""
}