Fixed slop file

This commit is contained in:
sruthipsuresh 2021-01-28 06:24:03 -06:00
parent 957983bd99
commit e3bbbb48fc
3 changed files with 20 additions and 50 deletions

View file

@ -15,34 +15,29 @@ process BEDTOOLS_SLOP {
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
} else {
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0"
}
input:
tuple val(meta), path(beds), path (sizes)
tuple val(meta), path(beds), path (sizes)
output:
tuple val(meta), path("*.slop.bed"), emit: bed
path "*.version.txt", emit: version
tuple val(meta), path("*.slop.bed"), emit: bed
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def header = params.header ? "-header":''
def pct = params.pct ? "-pct":''
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bedtools \\
slop \\
-i $beds \\
-g $sizes \\
$options.args \\
> ${prefix}.slop.bed
def symmetry = ''
if (meta.symmetry) {
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
"""
"""
slopBed -i $beds -g $sizes -b $params.b $header $pct $options.args> ${prefix}.slop.bed
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
"""
} else {
"""
slopBed -i $beds -g $sizes -l $params.l -r $params.r $header $pct $options.args> ${prefix}.slop.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
"""
}
}

View file

@ -6,8 +6,7 @@ include { BEDTOOLS_COMPLEMENT } from '../../../software/bedtools/complement/main
include { BEDTOOLS_GENOMECOV } from '../../../software/bedtools/genomecov/main.nf' addParams( options: [:] )
include { BEDTOOLS_INTERSECT } from '../../../software/bedtools/intersect/main.nf' addParams( options: [:] )
include { BEDTOOLS_MERGE } from '../../../software/bedtools/merge/main.nf' addParams( options: [:] )
include { BEDTOOLS_SLOP as BEDTOOLS_SLOP_S} from '../../../software/bedtools/slop/main.nf' addParams( options: [:] )
include { BEDTOOLS_SLOP as BEDTOOLS_SLOP_AS} from '../../../software/bedtools/slop/main.nf' addParams( options: [:] )
include { BEDTOOLS_SLOP} from '../../../software/bedtools/slop/main.nf' addParams( options: [args: '-l 15 -r 30'] )
include { BEDTOOLS_SORT } from '../../../software/bedtools/sort/main.nf' addParams( options: [:] )
@ -47,28 +46,12 @@ workflow test_bedtools_merge {
BEDTOOLS_MERGE(input)
}
// TODO streamline slop module
// To run with header and pct enabled, type --pct true and --header true with nextflow run command.
/*
Test with l/r method
*/
workflow test_bedtools_slop_asymmetrical {
workflow test_bedtools_slop {
def input = []
input = [ [ id:'test', symmetry: false],
input = [ [ id:'test'],
file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true),
file("${launchDir}/tests/data/bed/genome.sizes", checkIfExists: true) ] //metamap
BEDTOOLS_SLOP_AS( input )
}
/*
Test with b method
*/
workflow test_bedtools_slop_symmetrical {
def input = []
input = [ [ id:'test', symmetry: true],
file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true),
file("${launchDir}/tests/data/bed/genome.sizes", checkIfExists: true) ] //metamap
BEDTOOLS_SLOP_S( input )
BEDTOOLS_SLOP ( input )
}
workflow test_bedtools_sort {

View file

@ -46,7 +46,7 @@
md5sum: 13e5a3b254fac35fe0da0c92cbaf1761
- name: Run bedtools slop test workflow (symmetrical)
command: nextflow run ./tests/software/bedtools/ -profile docker -entry test_bedtools_slop_symmetrical -c tests/config/nextflow.config
command: nextflow run ./tests/software/bedtools/ -profile docker -entry test_bedtools_slop -c tests/config/nextflow.config
tags:
- bedtools
- bedtools_slop
@ -54,11 +54,3 @@
- path: output/bedtools/test.slop.bed
md5sum: 4279202e33fcce3d19f420f1b27fddee
- name: Run bedtools slop test workflow (asymmetrical)
command: nextflow run ./tests/software/bedtools/ -profile docker -entry test_bedtools_slop_asymmetrical -c tests/config/nextflow.config
tags:
- bedtools
- bedtools_slop
files:
- path: output/bedtools/test.slop.bed
md5sum: 4279202e33fcce3d19f420f1b27fddee