modified the samtools/fastq module (#339)

* new module: samtools/fastq

* solve conflict: pytest_software.yml

* solve linting conflicts

* solved EditorConfig linting problem

* Module samtools/fastq:
	* output compressed fastq.gz file(s)
	* add if conditionals for single/paired reads

* samtools/fastq: modified test.yml

* samtools/fastq: modified main.nf to avoid duplicated part of the script section

Co-authored-by: suzannejin <suzanne.jin@crg.eu>
This commit is contained in:
suzannejin 2021-03-23 18:43:52 +01:00 committed by GitHub
parent 5e3c9dfbf0
commit d6850f8312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View file

@ -22,19 +22,20 @@ process SAMTOOLS_FASTQ {
tuple val(meta), path(bam)
output:
tuple val(meta), path("*.fastq"), emit: fastq
tuple val(meta), path("*.fastq.gz"), emit: fastq
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def endedness = meta.single_end ? "-0 ${prefix}.fastq.gz" : "-1 ${prefix}_1.fastq.gz -2 ${prefix}_2.fastq.gz"
"""
samtools \\
fastq \\
samtools fastq \\
$options.args \\
-@ $task.cpus \\
$bam \\
> ${bam}.fastq
$endedness \\
$bam
echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt
"""
}

View file

@ -1,10 +1,9 @@
name: samtools_fastq
description: Converts a SAM/BAM/CRAM file to FASTA or FASTQ
description: Converts a SAM/BAM/CRAM file to FASTQ
keywords:
- bam
- sam
- cram
- fasta
- fastq
tools:
- samtools:
@ -33,8 +32,8 @@ output:
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: FASTA/FASTQ file
pattern: "*.{fasta,fastq}"
description: compressed FASTQ file
pattern: "*.fastq.gz"
- version:
type: file
description: File containing software version

View file

@ -1,8 +1,10 @@
- name: samtools fastq test_samtools_fastq
command: nextflow run tests/software/samtools/fastq -entry test_samtools_fastq -c tests/config/nextflow.config
tags:
- samtools_fastq
- samtools
- samtools_fastq
files:
- path: output/samtools/test_paired_end.sorted.bam.fastq
md5sum: 4863ac55a2781962dba179a929673535
- path: output/samtools/test_2.fastq.gz
md5sum: 42d3afede8c7ef21577fcd3d07edaa83
- path: output/samtools/test_1.fastq.gz
md5sum: 166feed91e5109214b0a7a0d8c53641d