Macs2 calllpeak (#1038)

* Add tests and yml file for macs2/callpeak

* add format option for macs2

* update macs2/callpeak to accept format argument

* update test.yml

* update the container version.

* try to fix the issue in conda container.

* Update conda and containers

* Going back to previous container versions

Co-authored-by: JoseEspinosa <kadomu@gmail.com>
This commit is contained in:
JIANHONG OU 2021-11-15 12:17:40 -05:00 committed by GitHub
parent 3426834744
commit 4398056204
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 146 additions and 3 deletions

View file

@ -13,9 +13,9 @@ process MACS2_CALLPEAK {
conda (params.enable_conda ? "bioconda::macs2=2.2.7.1" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py38h0213d0e_1"
container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py38h4a8c8d9_3"
} else {
container "quay.io/biocontainers/macs2:2.2.7.1--py38h0213d0e_1"
container "quay.io/biocontainers/macs2:2.2.7.1--py38h4a8c8d9_3"
}
input:
@ -33,12 +33,19 @@ process MACS2_CALLPEAK {
script:
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def args = options.args.tokenize()
def format = meta.single_end ? 'BAM' : 'BAMPE'
def control = controlbam ? "--control $controlbam" : ''
if(args.contains('--format')){
def id = args.findIndexOf{it=='--format'}
format = args[id+1]
args.remove(id+1)
args.remove(id)
}
"""
macs2 \\
callpeak \\
$options.args \\
${args.join(' ')} \\
--gsize $macs2_gsize \\
--format $format \\
--name $prefix \\

View file

@ -0,0 +1,63 @@
name: macs2_callpeak
description: Peak calling of enriched genomic regions of ChIP-seq and ATAC-seq experiments
keywords:
- alignment
- atac-seq
- chip-seq
- peak-calling
tools:
- macs2:
description: Model Based Analysis for ChIP-Seq data
homepage: None
documentation: https://docs.csc.fi/apps/macs2/
tool_dev_url: https://github.com/macs3-project/MACS
doi: "https://doi.org/10.1101/496521"
licence: ['BSD']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- ipbam:
type: file
description: The ChIP-seq treatment file
- controlbam:
type: file
description: The control file
- macs2_gsize:
type: string
description: Effective genome size. It can be 1.0e+9 or 1000000000, or shortcuts:'hs' for human (2.7e9),
'mm' for mouse (1.87e9), 'ce' for C. elegans (9e7) and 'dm' for fruitfly (1.2e8)
output:
- versions:
type: file
description: File containing software version
pattern: "versions.yml"
- peak:
type: file
description: BED file containing annotated peaks
pattern: "*.gappedPeak,*.narrowPeak}"
- xls:
type: file
description: xls file containing annotated peaks
pattern: "*.xls"
- gapped:
type: file
description: Optional BED file containing gapped peak
pattern: "*.gappedPeak"
- bed:
type: file
description: Optional BED file containing peak summits locations for every peak
pattern: "*.bed"
- bdg:
type: file
description: Optional bedGraph files for input and treatment input samples
pattern: "*.bdg"
authors:
- "@ntoda03"
- "@JoseEspinosa"
- "@jianhong"

View file

@ -778,6 +778,10 @@ lofreq/indelqual:
- modules/lofreq/indelqual/**
- tests/modules/lofreq/indelqual/**
macs2/callpeak:
- modules/macs2/callpeak/**
- tests/modules/macs2/callpeak/**
malt/build:
- modules/malt/build/**
- tests/modules/malt/build_test/**

View file

@ -0,0 +1,31 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MACS2_CALLPEAK } from '../../../../modules/macs2/callpeak/main.nf' addParams( options: ["args": "--qval 0.1"] )
include { MACS2_CALLPEAK as MACS2_CALLPEAK_CTRL } from '../../../../modules/macs2/callpeak/main.nf' addParams( options: ["args": "--qval 0.1"] )
include { MACS2_CALLPEAK as MACS2_CALLPEAK_BED } from '../../../../modules/macs2/callpeak/main.nf' addParams( options: ["args": "--format BED --qval 1 --nomodel --extsize 200"] )
workflow test_macs2_callpeak_bed {
input = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['pacbio']['genemodel1'], checkIfExists: true)],
[]]
MACS2_CALLPEAK_BED ( input, 4000 )
}
workflow test_macs2_callpeak {
input = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ],
[]]
MACS2_CALLPEAK ( input, 40000 )
}
workflow test_macs2_callpeak_ctrl {
input = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ],
[ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]]
MACS2_CALLPEAK_CTRL ( input, 40000 )
}

View file

@ -0,0 +1,38 @@
- name: macs2 callpeak test_macs2_callpeak_bed
command: nextflow run tests/modules/macs2/callpeak -entry test_macs2_callpeak_bed -c tests/config/nextflow.config
tags:
- macs2
- macs2/callpeak
files:
- path: output/macs2/test_peaks.narrowPeak
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: output/macs2/test_peaks.xls
md5sum: 762383e3a35e1f9ac3834fd6b2926092
- path: output/macs2/test_summits.bed
md5sum: d41d8cd98f00b204e9800998ecf8427e
- name: macs2 callpeak test_macs2_callpeak
command: nextflow run tests/modules/macs2/callpeak -entry test_macs2_callpeak -c tests/config/nextflow.config
tags:
- macs2
- macs2/callpeak
files:
- path: output/macs2/test_peaks.narrowPeak
md5sum: 2e4da1c1704595e12aaf99cc715ad70c
- path: output/macs2/test_peaks.xls
md5sum: 5d65cb3dbd5421ea3bb5b490a100e9a4
- path: output/macs2/test_summits.bed
md5sum: 26f0f97b6c14dbca129e947a58067c82
- name: macs2 callpeak test_macs2_callpeak_ctrl
command: nextflow run tests/modules/macs2/callpeak -entry test_macs2_callpeak_ctrl -c tests/config/nextflow.config
tags:
- macs2
- macs2/callpeak
files:
- path: output/macs2/test_peaks.narrowPeak
md5sum: 653e1108cc57ca07d0f60fc0f4fb8ba3
- path: output/macs2/test_peaks.xls
md5sum: bf86546faa7b581b5209c29b22046a0a
- path: output/macs2/test_summits.bed
md5sum: 4f3c7c53a1d730d90d1b3dd9d3197af4