Merge branch 'dev' into final-reads-saving
commit
0245c4880b
@ -1,56 +0,0 @@
|
||||
process SAMTOOLS_BAM2FQ {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda "bioconda::samtools=1.16.1"
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' :
|
||||
'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(inputbam)
|
||||
val split
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.fq.gz"), emit: reads
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
|
||||
if (split){
|
||||
"""
|
||||
samtools \\
|
||||
bam2fq \\
|
||||
$args \\
|
||||
-@ $task.cpus \\
|
||||
-1 ${prefix}_1.fq.gz \\
|
||||
-2 ${prefix}_2.fq.gz \\
|
||||
-0 ${prefix}_other.fq.gz \\
|
||||
-s ${prefix}_singleton.fq.gz \\
|
||||
$inputbam
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
} else {
|
||||
"""
|
||||
samtools \\
|
||||
bam2fq \\
|
||||
$args \\
|
||||
-@ $task.cpus \\
|
||||
$inputbam | gzip --no-name > ${prefix}_interleaved.fq.gz
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
name: samtools_bam2fq
|
||||
description: |
|
||||
The module uses bam2fq method from samtools to
|
||||
convert a SAM, BAM or CRAM file to FASTQ format
|
||||
keywords:
|
||||
- bam2fq
|
||||
- samtools
|
||||
- fastq
|
||||
tools:
|
||||
- samtools:
|
||||
description: Tools for dealing with SAM, BAM and CRAM files
|
||||
homepage: None
|
||||
documentation: http://www.htslib.org/doc/1.1/samtools.html
|
||||
tool_dev_url: None
|
||||
doi: ""
|
||||
licence: ["MIT"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- inputbam:
|
||||
type: file
|
||||
description: BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
- split:
|
||||
type: boolean
|
||||
description: |
|
||||
TRUE/FALSE value to indicate if reads should be separated into
|
||||
/1, /2 and if present other, or singleton.
|
||||
Note: choosing TRUE will generate 4 different files.
|
||||
Choosing FALSE will produce a single file, which will be interleaved in case
|
||||
the input contains paired reads.
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- reads:
|
||||
type: file
|
||||
description: |
|
||||
FASTQ files, which will be either a group of 4 files (read_1, read_2, other and singleton)
|
||||
or a single interleaved .fq.gz file if the user chooses not to split the reads.
|
||||
pattern: "*.fq.gz"
|
||||
|
||||
authors:
|
||||
- "@lescai"
|
@ -0,0 +1,44 @@
|
||||
process SAMTOOLS_FASTQ {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda "bioconda::samtools=1.16.1"
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' :
|
||||
'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(input)
|
||||
val(interleave)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*_{1,2}.fastq.gz") , optional:true, emit: fastq
|
||||
tuple val(meta), path("*_interleaved.fastq.gz"), optional:true, emit: interleaved
|
||||
tuple val(meta), path("*_singleton.fastq.gz") , optional:true, emit: singleton
|
||||
tuple val(meta), path("*_other.fastq.gz") , optional:true, emit: other
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def output = ( interleave && ! meta.single_end ) ? "> ${prefix}_interleaved.fastq.gz" :
|
||||
meta.single_end ? "-1 ${prefix}_1.fastq.gz -s ${prefix}_singleton.fastq.gz" :
|
||||
"-1 ${prefix}_1.fastq.gz -2 ${prefix}_2.fastq.gz -s ${prefix}_singleton.fastq.gz"
|
||||
"""
|
||||
samtools \\
|
||||
fastq \\
|
||||
$args \\
|
||||
--threads ${task.cpus-1} \\
|
||||
-0 ${prefix}_other.fastq.gz \\
|
||||
$input \\
|
||||
$output
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
name: samtools_fastq
|
||||
description: Converts a SAM/BAM/CRAM file to FASTQ
|
||||
keywords:
|
||||
- bam
|
||||
- sam
|
||||
- cram
|
||||
- fastq
|
||||
tools:
|
||||
- samtools:
|
||||
description: |
|
||||
SAMtools is a set of utilities for interacting with and post-processing
|
||||
short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
|
||||
These files are generated as output by short read aligners like BWA.
|
||||
homepage: http://www.htslib.org/
|
||||
documentation: http://www.htslib.org/doc/samtools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ["MIT"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- input:
|
||||
type: file
|
||||
description: BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
- interleave:
|
||||
type: boolean
|
||||
description: Set true for interleaved fastq file
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- fastq:
|
||||
type: file
|
||||
description: Compressed FASTQ file(s) with reads with either the READ1 or READ2 flag set in separate files.
|
||||
pattern: "*_{1,2}.fastq.gz"
|
||||
- interleaved:
|
||||
type: file
|
||||
description: Compressed FASTQ file with reads with either the READ1 or READ2 flag set in a combined file. Needs collated input file.
|
||||
pattern: "*_interleaved.fastq.gz"
|
||||
- singleton:
|
||||
type: file
|
||||
description: Compressed FASTQ file with singleton reads
|
||||
pattern: "*_singleton.fastq.gz"
|
||||
- other:
|
||||
type: file
|
||||
description: Compressed FASTQ file with reads with either both READ1 and READ2 flags set or unset
|
||||
pattern: "*_other.fastq.gz"
|
||||
|
||||
authors:
|
||||
- "@priyanka-surana"
|
||||
- "@suzannejin"
|
Loading…
Reference in New Issue