nf-core_modules/modules/homer/findpeaks/main.nf

43 lines
1.3 KiB
Text
Raw Normal View History

Homer Modules (#75) * feat(homer): Add initial makeTagDirectory * feat(homer): Add initial findPeaks module * feat(homer): Update with new options See 1d30e2c21affedc742680e8e04d60c6481d9cd11 * fix(homer): Correct findpeaks process name * fix(homer): Takes a bam file instead of bed * feat(homer): Add initial makeTagDirectory test * fix(homer): Hardcode genome and configureHomer I'd like to modularize configureHomer, but I need to figure out how exactly the genomes work. * fix(homer): bam => bed Bam requires samtools to be present, which it's not in this docker image * feat(homer): Add initial configureHomer script * ci(homer): Add initial test * test(homer): Reproducible configuration workaround - I can't run both tests(one file and two files) at the same time because it breaks - I can't copy the genome stuff from the configurehomer module because it's read only - So I can't make the makeTagDirectory module depend on configureHomer * test(homer): Add placeholder annotatepeaks The required inputs are necessarily required for all workflows from what I've used, but I'll need to look at the actual docs * test(homer): Add missing B.bed * test(homer): Rename two => groseq Then all of the various workflows that homer provides can be e2e tested * feat(homer): Add initial makeUCSCfile module * test(homer): Add start to makeUCSCfile testing * chore(homer): Add various cleanups * test(homer): Rewrite annotatepeaks Not passing yet * test(homer): Rewrite configurehomer * test(homer): Rewrite findpeaks Still failing * test(homer): Rewrite makeucscfile Not passing yet * test(homer): Rewrite maketagdirectory All homer modules now follow the new structure. Time to make them pass. * test(homer): Fix typo for workflow name * fix(homer): Use correct container * fix(homer): Accept fasta in maketagdirectory Apparently all of the homer stuff can just take any old fasta and you don't need to configure the genome ahead of time with configureHomer * test(homer): makeTagDirectory passes now * fix(homer): Update containers in makeucscfile * test(homer): Rewrite makeucscfile Takes input from maketagdirectory which is how the module should be used * fix(homer): Update makeUCSCFile bedgraph path * test(homer): Update makeucscfile expected output * fix(homer): Update containers in findpeaks * fix(homer): Change findpeaks args The user is just going to have to know what they're doing for now * test(homer): findPeaks rewrite with tagDir input * test(homer): Update expected files for findPeaks And bump filters * style: Appease editorconfig * ci: Remove old workflow * tests(homer): Add md5sums * test(homer): Add meta test * style(homer): Capitalize HOMER * docs(homer): Add maketagdirectory meta.yml * docs(homer): Add makeucscfile meta.yml * docs(homer): Add findpeaks meta.yml * test(homer): Update to new test data standards * chore: Remove stuff that got revived in the rebase * chore: software => modules * test(homer): Update tags * test(homer): Update annotatepeaks * ci: Fix uploading of artifacts GitHub actions doesn't like the / in the tags * test(homer): Remove annotate md5sum This is failing and breaking new tests * test(homer): Use bams instead of beds * test(homer): Fix meta maketagdirectory * test(homer): Fix input in all tests * test(homer): Move back to bed files Forgot samtools isn't present * chore(homer): Add TODOs for tests * test(homer): Add bed format arg * test(homer): Update md5sums * test(homer): Fix tags tsvs * style(homer): Appease nf-core linting * docs(homer): Be in line with what is in the main.nf file Co-authored-by: Kevin Menden <kevin.menden@live.com> Co-authored-by: Kevin Menden <kevin.menden@live.com>
2021-09-08 15:40:34 +00:00
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
def options = initOptions(params.options)
def VERSION = '4.11'
process HOMER_FINDPEAKS {
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']) }
conda (params.enable_conda ? "bioconda::homer=4.11=pl526hc9558a2_3" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3"
} else {
container "quay.io/biocontainers/homer:4.11--pl526hc9558a2_3"
}
input:
tuple val(meta), path(tagDir)
output:
tuple val(meta), path("*peaks.txt"), emit: txt
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
findPeaks \\
$tagDir \\
$options.args \\
-o ${prefix}.peaks.txt
echo $VERSION > ${software}.version.txt
"""
}