mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2025-01-02 20:52:07 -05:00
Mpileup also likes intervals (#1445)
* Mpileup also likes intervals * Also update meta yml with inclusive input and intervals Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: Maxime U. Garcia <max.u.garcia@gmail.com>
This commit is contained in:
parent
e3a5795652
commit
b5825fe6b3
4 changed files with 36 additions and 7 deletions
|
@ -8,7 +8,7 @@ process SAMTOOLS_MPILEUP {
|
||||||
'quay.io/biocontainers/samtools:1.15--h1170115_1' }"
|
'quay.io/biocontainers/samtools:1.15--h1170115_1' }"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(bam)
|
tuple val(meta), path(input), path(intervals)
|
||||||
path fasta
|
path fasta
|
||||||
|
|
||||||
output:
|
output:
|
||||||
|
@ -21,12 +21,13 @@ process SAMTOOLS_MPILEUP {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
def intervals = intervals ? "-l ${intervals}" : ""
|
||||||
"""
|
"""
|
||||||
samtools mpileup \\
|
samtools mpileup \\
|
||||||
--fasta-ref $fasta \\
|
--fasta-ref $fasta \\
|
||||||
--output ${prefix}.mpileup \\
|
--output ${prefix}.mpileup \\
|
||||||
$args \\
|
$args \\
|
||||||
$bam
|
$input
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||||
|
|
|
@ -21,7 +21,7 @@ input:
|
||||||
description: |
|
description: |
|
||||||
Groovy Map containing sample information
|
Groovy Map containing sample information
|
||||||
e.g. [ id:'test', single_end:false ]
|
e.g. [ id:'test', single_end:false ]
|
||||||
- bam:
|
- input:
|
||||||
type: file
|
type: file
|
||||||
description: BAM/CRAM/SAM file
|
description: BAM/CRAM/SAM file
|
||||||
pattern: "*.{bam,cram,sam}"
|
pattern: "*.{bam,cram,sam}"
|
||||||
|
@ -29,6 +29,10 @@ input:
|
||||||
type: file
|
type: file
|
||||||
description: FASTA reference file
|
description: FASTA reference file
|
||||||
pattern: "*.{fasta,fa}"
|
pattern: "*.{fasta,fa}"
|
||||||
|
- intervals:
|
||||||
|
type: file
|
||||||
|
description: Interval FILE
|
||||||
|
pattern: "*.bed"
|
||||||
output:
|
output:
|
||||||
- meta:
|
- meta:
|
||||||
type: map
|
type: map
|
||||||
|
|
|
@ -6,7 +6,18 @@ include { SAMTOOLS_MPILEUP } from '../../../../modules/samtools/mpileup/main.nf'
|
||||||
|
|
||||||
workflow test_samtools_mpileup {
|
workflow test_samtools_mpileup {
|
||||||
input = [ [ id:'test', single_end:false ], // meta map
|
input = [ [ id:'test', single_end:false ], // meta map
|
||||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
SAMTOOLS_MPILEUP ( input, fasta )
|
||||||
|
}
|
||||||
|
|
||||||
|
workflow test_samtools_mpileup_intervals {
|
||||||
|
input = [ [ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||||
|
file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)
|
||||||
]
|
]
|
||||||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,21 @@
|
||||||
- name: samtools mpileup
|
- name: samtools mpileup test_samtools_mpileup
|
||||||
command: nextflow run ./tests/modules/samtools/mpileup -entry test_samtools_mpileup -c ./tests/config/nextflow.config -c ./tests/modules/samtools/mpileup/nextflow.config
|
command: nextflow run tests/modules/samtools/mpileup -entry test_samtools_mpileup -c tests/config/nextflow.config
|
||||||
tags:
|
tags:
|
||||||
- samtools
|
- samtools
|
||||||
- samtools/mpileup
|
- samtools/mpileup
|
||||||
files:
|
files:
|
||||||
- path: ./output/samtools/test.mpileup
|
- path: output/samtools/test.mpileup
|
||||||
md5sum: 958e6bead4103d72026f80153b6b5150
|
md5sum: 958e6bead4103d72026f80153b6b5150
|
||||||
|
- path: output/samtools/versions.yml
|
||||||
|
md5sum: 26350e1e145451f0b807911db029861e
|
||||||
|
|
||||||
|
- name: samtools mpileup test_samtools_mpileup_intervals
|
||||||
|
command: nextflow run tests/modules/samtools/mpileup -entry test_samtools_mpileup_intervals -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- samtools
|
||||||
|
- samtools/mpileup
|
||||||
|
files:
|
||||||
|
- path: output/samtools/test.mpileup
|
||||||
|
md5sum: 958e6bead4103d72026f80153b6b5150
|
||||||
|
- path: output/samtools/versions.yml
|
||||||
|
md5sum: 11d8118a558efb9db6798453862d719c
|
||||||
|
|
Loading…
Reference in a new issue