New subtool: hmmcopy/generatemap (#1168)

* Initial structure

* Working with local singularity image

* Working generateMap.pl script

* Remote not working bioconda

* Working generateMap with biocontainer

* Lint changes

* Updated hmmcopy container version to be consistent

* Fix failing test

* Remove path to perl

* No hardpath to script

* Update main.nf

Moved version outside of process, add support for zipped fasta file

* Revert to not allowing gzip via pipe, as perl script can't cope

Co-authored-by: Simon Pearce <simon.pearce@cruk.manchester.ac.uk>
This commit is contained in:
Simon Pearce 2021-12-15 15:57:42 +00:00 committed by GitHub
parent 61376425fb
commit ae92159762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 109 additions and 6 deletions

View file

@ -5,8 +5,8 @@ process HMMCOPY_GCCOUNTER {
conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_5' :
'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_5' }"
'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7' :
'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }"
input:
path fasta

View file

@ -0,0 +1,38 @@
def VERSION = '0.1.1'
process HMMCOPY_GENERATEMAP {
tag '$bam'
label 'process_long'
conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7':
'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }"
input:
path fasta
output:
path "*.map.bw" , emit: bigwig
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
"""
# build required indexes
generateMap.pl -b \\
$args \\
$fasta
# run
generateMap.pl \\
$args \\
$fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hmmcopy: \$(echo $VERSION)
END_VERSIONS
"""
}

View file

@ -0,0 +1,32 @@
name: hmmcopy_generatemap
description: Perl script (generateMap.pl) generates the mappability of a genome given a certain size of reads, for input to hmmcopy mapcounter. Takes a very long time on large genomes, is not parallelised at all.
keywords:
- hmmcopy
- mapcounter
- mappability
tools:
- hmmcopy:
description: C++ based programs for analyzing BAM files and preparing read counts -- used with bioconductor-hmmcopy
homepage: https://github.com/shahcompbio/hmmcopy_utils
documentation: https://github.com/shahcompbio/hmmcopy_utils
tool_dev_url: https://github.com/shahcompbio/hmmcopy_utils
doi: ""
licence: ['GPL v3']
input:
- fasta:
type: file
description: Input genome fasta file
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- bigwig:
type: file
description: bigwig file containing the mappability of the genome
pattern: "*.{map.bw}"
authors:
- "@sppearce"

View file

@ -6,8 +6,8 @@ process HMMCOPY_READCOUNTER {
conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_5' :
'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_5' }"
'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7' :
'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }"
input:
tuple val(meta), path(bam), path(bai)

View file

@ -685,6 +685,10 @@ hmmcopy/gccounter:
- modules/hmmcopy/gccounter/**
- tests/modules/hmmcopy/gccounter/**
hmmcopy/generatemap:
- modules/hmmcopy/generatemap/**
- tests/modules/hmmcopy/generatemap/**
hmmcopy/readcounter:
- modules/hmmcopy/readcounter/**
- tests/modules/hmmcopy/readcounter/**

View file

@ -0,0 +1,12 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { HMMCOPY_GENERATEMAP } from '../../../../modules/hmmcopy/generatemap/main.nf'
workflow test_hmmcopy_generatemap {
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
HMMCOPY_GENERATEMAP ( fasta )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,10 @@
- name: hmmcopy generatemap test_hmmcopy_generatemap
command: nextflow run tests/modules/hmmcopy/generatemap -entry test_hmmcopy_generatemap -c tests/config/nextflow.config
tags:
- hmmcopy
- hmmcopy/generatemap
files:
- path: output/hmmcopy/genome.fasta.map.bw
md5sum: 7ad68224a1e40287978284c387e8eb70
- path: output/hmmcopy/versions.yml
md5sum: f950580f94d8a2d88332c477972cb9f0

View file

@ -1,8 +1,10 @@
- name: hmmcopy readcounter test_hmmcopy_readcounter
command: nextflow run ./tests/modules/hmmcopy/readcounter -entry test_hmmcopy_readcounter -c ./tests/config/nextflow.config -c ./tests/modules/hmmcopy/readcounter/nextflow.config
command: nextflow run tests/modules/hmmcopy/readcounter -entry test_hmmcopy_readcounter -c tests/config/nextflow.config
tags:
- hmmcopy
- hmmcopy/readcounter
files:
- path: output/hmmcopy/test.wig
md5sum: 3655d8325baea81b3b690791262c6b57
md5sum: 4682778422b9a2510a3cb70bd13ccd08
- path: output/hmmcopy/versions.yml
md5sum: 624a85e6a1bc61abc33cac03aea33a1e