mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 19:18:17 +00:00
Add samtools
This commit is contained in:
parent
993d0d5743
commit
137db462a7
10 changed files with 153 additions and 0 deletions
1
software/samtools/flagstat/functions.nf
Symbolic link
1
software/samtools/flagstat/functions.nf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../lib/functions.nf
|
29
software/samtools/flagstat/main.nf
Normal file
29
software/samtools/flagstat/main.nf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Import generic module functions
|
||||||
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
process SAMTOOLS_FLAGSTAT {
|
||||||
|
tag "$meta.id"
|
||||||
|
publishDir "${params.outdir}",
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
|
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
|
||||||
|
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
|
||||||
|
|
||||||
|
conda (params.conda ? "bioconda::samtools=1.10" : null)
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(bam), path(bai)
|
||||||
|
val options
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.flagstat"), emit: flagstat
|
||||||
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
|
script:
|
||||||
|
def software = getSoftwareName(task.process)
|
||||||
|
"""
|
||||||
|
samtools flagstat $bam > ${bam}.flagstat
|
||||||
|
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
|
||||||
|
"""
|
||||||
|
}
|
1
software/samtools/idxstats/functions.nf
Symbolic link
1
software/samtools/idxstats/functions.nf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../lib/functions.nf
|
29
software/samtools/idxstats/main.nf
Normal file
29
software/samtools/idxstats/main.nf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Import generic module functions
|
||||||
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
process SAMTOOLS_IDXSTATS {
|
||||||
|
tag "$meta.id"
|
||||||
|
publishDir "${params.outdir}",
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
|
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
|
||||||
|
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
|
||||||
|
|
||||||
|
conda (params.conda ? "bioconda::samtools=1.10" : null)
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(bam), path(bai)
|
||||||
|
val options
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.idxstats"), emit: idxstats
|
||||||
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
|
script:
|
||||||
|
def software = getSoftwareName(task.process)
|
||||||
|
"""
|
||||||
|
samtools idxstats $bam > ${bam}.idxstats
|
||||||
|
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
|
||||||
|
"""
|
||||||
|
}
|
1
software/samtools/index/functions.nf
Symbolic link
1
software/samtools/index/functions.nf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../lib/functions.nf
|
29
software/samtools/index/main.nf
Normal file
29
software/samtools/index/main.nf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Import generic module functions
|
||||||
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
process SAMTOOLS_INDEX {
|
||||||
|
tag "$meta.id"
|
||||||
|
publishDir "${params.outdir}",
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
|
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
|
||||||
|
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
|
||||||
|
|
||||||
|
conda (params.conda ? "bioconda::samtools=1.10" : null)
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(bam)
|
||||||
|
val options
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.bai"), emit: bai
|
||||||
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
|
script:
|
||||||
|
def software = getSoftwareName(task.process)
|
||||||
|
"""
|
||||||
|
samtools index $bam
|
||||||
|
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
|
||||||
|
"""
|
||||||
|
}
|
1
software/samtools/sort/functions.nf
Symbolic link
1
software/samtools/sort/functions.nf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../lib/functions.nf
|
32
software/samtools/sort/main.nf
Normal file
32
software/samtools/sort/main.nf
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
// Import generic module functions
|
||||||
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
process SAMTOOLS_SORT {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
publishDir "${params.outdir}",
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
|
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
|
||||||
|
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
|
||||||
|
|
||||||
|
conda (params.conda ? "bioconda::samtools=1.10" : null)
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(bam)
|
||||||
|
val options
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.bam"), emit: bam
|
||||||
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
|
script:
|
||||||
|
def software = getSoftwareName(task.process)
|
||||||
|
def ioptions = initOptions(options)
|
||||||
|
def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}"
|
||||||
|
"""
|
||||||
|
samtools sort $ioptions.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam
|
||||||
|
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
|
||||||
|
"""
|
||||||
|
}
|
1
software/samtools/stats/functions.nf
Symbolic link
1
software/samtools/stats/functions.nf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../lib/functions.nf
|
29
software/samtools/stats/main.nf
Normal file
29
software/samtools/stats/main.nf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Import generic module functions
|
||||||
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
process SAMTOOLS_STATS {
|
||||||
|
tag "$meta.id"
|
||||||
|
publishDir "${params.outdir}",
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
|
container "quay.io/biocontainers/samtools:1.10--h9402c20_2"
|
||||||
|
//container " https://depot.galaxyproject.org/singularity/samtools:1.10--h9402c20_2"
|
||||||
|
|
||||||
|
conda (params.conda ? "bioconda::samtools=1.10" : null)
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(bam), path(bai)
|
||||||
|
val options
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.stats"), emit: stats
|
||||||
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
|
script:
|
||||||
|
def software = getSoftwareName(task.process)
|
||||||
|
"""
|
||||||
|
samtools stats $bam > ${bam}.stats
|
||||||
|
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
|
||||||
|
"""
|
||||||
|
}
|
Loading…
Reference in a new issue