mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-13 05:13:09 +00:00
Fixes for nanoseq modules (#479)
* Fix minimap2 index module * Fix minimap2 index tests * Fix graphmap2 index module * Fix graphmap2 module * Fix ECLint * Fix bedtools bamtobed module * Fix tests for bedtools bamtobed module * Add tag for graphmap2 align module * Fix EClint * Fix qcat module * Add md5sum for graphmap2/align module * Remove non-started test data file * Remove md5sum for graphmap2 align
This commit is contained in:
parent
05f479f03a
commit
466ab67808
16 changed files with 115 additions and 80 deletions
|
@ -2,7 +2,7 @@
|
|||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
options = initOptions(params.options)
|
||||
|
||||
process BEDTOOLS_BAMTOBED {
|
||||
tag "$meta.id"
|
||||
|
@ -11,24 +11,30 @@ process BEDTOOLS_BAMTOBED {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.29.2" : null)
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(sizes), path(bam), path(bai)
|
||||
tuple val(meta), path(bam)
|
||||
|
||||
output:
|
||||
tuple val(meta), path(sizes), path("*.bed12"), emit: bed12
|
||||
path "*.version.txt" , emit: version
|
||||
tuple val(meta), path("*.bed"), emit: bed
|
||||
path "*.version.txt" , emit: version
|
||||
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
bedtools \\
|
||||
bamtobed \\
|
||||
-bed12 \\
|
||||
-cigar \\
|
||||
-i ${bam[0]} \\
|
||||
| bedtools sort > ${meta.id}.bed12
|
||||
bedtools --version | sed -e "s/bedtools v//g" > bedtools.version.txt
|
||||
$options.args \\
|
||||
-i $bam \\
|
||||
| bedtools sort > ${prefix}.bed
|
||||
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -18,19 +18,15 @@ input:
|
|||
type: file
|
||||
description: Input BAM file
|
||||
pattern: "*.{bam}"
|
||||
- sizes:
|
||||
type: file
|
||||
description: File which defines the chromosome lengths for a given genome
|
||||
pattern: "*.{sizes}"
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- bed12:
|
||||
- bed:
|
||||
type: file
|
||||
description: Bed file with 12 columns containing all genomic intervals.
|
||||
description: Bed file containing genomic intervals.
|
||||
pattern: "*.{bed}"
|
||||
- version:
|
||||
type: file
|
||||
|
@ -38,3 +34,4 @@ output:
|
|||
pattern: "*.{version.txt}"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
||||
|
|
|
@ -2,34 +2,45 @@
|
|||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GRAPHMAP2_ALIGN {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
tag "$meta.id"
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::graphmap=0.6.3" : null)
|
||||
container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0"
|
||||
conda (params.enable_conda ? "bioconda::graphmap=0.6.3" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(fastq)
|
||||
path(fasta)
|
||||
path(index)
|
||||
tuple val(meta), path(reads)
|
||||
path fasta
|
||||
path index
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.sam"), emit: align_sam
|
||||
tuple val(meta), path("*.sam"), emit: sam
|
||||
path "*.version.txt" , emit: version
|
||||
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
graphmap2 \\
|
||||
align \\
|
||||
-t $task.cpus \\
|
||||
-r $fasta \\
|
||||
-i $index \\
|
||||
-d $fastq \\
|
||||
-o ${meta.id}.sam \\
|
||||
--extcigar
|
||||
-d $reads \\
|
||||
-o ${prefix}.sam \\
|
||||
$options.args
|
||||
|
||||
echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ tools:
|
|||
- graphmap2:
|
||||
description: |
|
||||
A versatile pairwise aligner for genomic and spliced nucleotide sequences.
|
||||
homepage: https://github.com/lh3/minimap2
|
||||
documentation: https://github.com/lh3/minimap2#uguide
|
||||
homepage: https://github.com/lbcb-sci/graphmap2
|
||||
documentation: https://github.com/lbcb-sci/graphmap2#graphmap2---a-highly-sensitive-and-accurate-mapper-for-long-error-prone-reads
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
@ -47,3 +47,4 @@ output:
|
|||
pattern: "*.{version.txt}"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
||||
|
|
|
@ -2,30 +2,38 @@
|
|||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GRAPHMAP2_INDEX {
|
||||
label 'process_medium'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:['']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::graphmap=0.6.3" : null)
|
||||
container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0"
|
||||
conda (params.enable_conda ? "bioconda::graphmap=0.6.3" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0"
|
||||
}
|
||||
|
||||
input:
|
||||
path(fasta)
|
||||
path fasta
|
||||
|
||||
output:
|
||||
path("*.gmidx") ,emit: index
|
||||
path "*.version.txt" ,emit: version
|
||||
path "*.gmidx" , emit: index
|
||||
path "*.version.txt", emit: version
|
||||
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
"""
|
||||
graphmap2 \\
|
||||
align \\
|
||||
-t $task.cpus \\
|
||||
-I \\
|
||||
$options.args \\
|
||||
-r $fasta
|
||||
echo \$(graphmap2 2>&1) > graphmap2.version.txt
|
||||
|
||||
echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -26,3 +26,4 @@ output:
|
|||
pattern: "*.{version.txt}"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
||||
|
|
|
@ -2,31 +2,37 @@
|
|||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
options = initOptions(params.options)
|
||||
|
||||
process MINIMAP2_INDEX {
|
||||
label 'process_medium'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['']) }
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:['']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::minimap2=2.17" : null)
|
||||
container "quay.io/biocontainers/minimap2:2.17--hed695b0_3"
|
||||
conda (params.enable_conda ? "bioconda::minimap2=2.17" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/minimap2:2.17--hed695b0_3"
|
||||
} else {
|
||||
container "quay.io/biocontainers/minimap2:2.17--hed695b0_3"
|
||||
}
|
||||
|
||||
input:
|
||||
path(fasta)
|
||||
path fasta
|
||||
|
||||
output:
|
||||
path("*.mmi") , emit: index
|
||||
path "*.version.txt" ,emit: version
|
||||
path "*.mmi" , emit: index
|
||||
path "*.version.txt", emit: version
|
||||
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
"""
|
||||
minimap2 \\
|
||||
-t $task.cpus \\
|
||||
-d ${fasta}.mmi \\
|
||||
-d ${fasta.baseName}.mmi \\
|
||||
$options.args \\
|
||||
$fasta
|
||||
ps
|
||||
minimap2 --version &> minimap2.version.txt
|
||||
|
||||
echo \$(minimap2 --version 2>&1) > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -26,3 +26,4 @@ output:
|
|||
pattern: "*.{version.txt}"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
options = initOptions(params.options)
|
||||
|
||||
process QCAT {
|
||||
tag "$meta.id"
|
||||
|
@ -11,34 +11,42 @@ process QCAT {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::qcat=1.1.0" : null)
|
||||
container "quay.io/biocontainers/qcat:1.1.0--py_0"
|
||||
conda (params.enable_conda ? "bioconda::qcat=1.1.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/qcat:1.1.0--py_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/qcat:1.1.0--py_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(input_path)
|
||||
val(barcode_kit)
|
||||
tuple val(meta), path(reads)
|
||||
val barcode_kit
|
||||
|
||||
output:
|
||||
tuple val(meta), path("fastq/*.fastq.gz") , emit: fastq
|
||||
path "*.version.txt" , emit: version
|
||||
tuple val(meta), path("fastq/*.fastq.gz"), emit: reads
|
||||
path "*.version.txt" , emit: version
|
||||
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
## Unzip fastq file
|
||||
## qcat doesnt support zipped files yet
|
||||
FILE=$input_path
|
||||
## qcat doesn't support zipped files yet
|
||||
FILE=$reads
|
||||
if [[ \$FILE == *.gz ]]
|
||||
then
|
||||
zcat $input_path > unzipped.fastq
|
||||
FILE=unzipped.fastq
|
||||
zcat $reads > unzipped.fastq
|
||||
FILE=unzipped.fastq
|
||||
fi
|
||||
qcat \\
|
||||
-f \$FILE \\
|
||||
-b ./fastq \\
|
||||
--kit $barcode_kit
|
||||
|
||||
## Zip fastq files (cannot find pigz command)
|
||||
qcat \\
|
||||
-f \$FILE \\
|
||||
-b ./fastq \\
|
||||
--kit $barcode_kit
|
||||
|
||||
## Zip fastq files
|
||||
gzip fastq/*
|
||||
qcat --version &> qcat.version.txt
|
||||
|
||||
echo \$(qcat --version 2>&1) | sed 's/^.*qcat //; s/ .*\$//' > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ input:
|
|||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- input_path:
|
||||
- reads:
|
||||
type: file
|
||||
description: |
|
||||
Non-demultiplexed Nanopore sequencing sample.
|
||||
Non-demultiplexed fastq files
|
||||
|
||||
output:
|
||||
- meta:
|
||||
|
@ -26,7 +26,7 @@ output:
|
|||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- fastq:
|
||||
- reads:
|
||||
type: file
|
||||
description: Demultiplexed fastq samples
|
||||
pattern: "*.fastq.gz"
|
||||
|
@ -36,3 +36,4 @@ output:
|
|||
pattern: "*.{version.txt}"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
||||
|
|
|
@ -146,9 +146,6 @@ params {
|
|||
test2_genome_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi"
|
||||
test2_genome_vcf_idx = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.idx"
|
||||
}
|
||||
'nanopore' {
|
||||
non_demultiplexed_fastq = "https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,7 @@ include { BEDTOOLS_BAMTOBED } from '../../../../software/bedtools/bamtobed/main.
|
|||
|
||||
workflow test_bedtools_bamtobed {
|
||||
input = [ [ id:'test'], //meta map
|
||||
file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['nanopore']['test_sorted_bam'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['nanopore']['test_sorted_bam_bai'], checkIfExists: true)
|
||||
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
|
||||
]
|
||||
|
||||
BEDTOOLS_BAMTOBED ( input )
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
- bedtools
|
||||
- bedtools/bamtobed
|
||||
files:
|
||||
- path: ./output/bedtools/test.bed12
|
||||
md5sum: d41d8cd98f00b204e9800998ecf8427e
|
||||
- path: ./output/bedtools/test.bed
|
||||
md5sum: 3c6b88e414debd889c10eb972180b687
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
- minimap2
|
||||
- minimap2/index
|
||||
files:
|
||||
- path: ./output/minimap2/genome.fasta.mmi
|
||||
- path: ./output/minimap2/genome.mmi
|
||||
md5sum: 72e450f12dc691e763c697463bdb1571
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { QCAT } from '../../../software/qcat/main.nf' addParams( options: [:] )
|
||||
include { QCAT } from '../../../software/qcat/main.nf' addParams( options: [:] )
|
||||
|
||||
workflow test_qcat {
|
||||
def input = []
|
||||
input = [ [ id:'test' ], // meta map
|
||||
[ file(params.test_data['homo_sapiens']['nanopore']['non_demultiplexed_fastq'], checkIfExists: true) ]
|
||||
[ file("https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz", checkIfExists: true) ]
|
||||
]
|
||||
barcode_kit = 'NBD103/NBD104'
|
||||
|
||||
QCAT ( input, barcode_kit )
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
files:
|
||||
- path: ./output/qcat/fastq/barcode06.fastq.gz
|
||||
- path: ./output/qcat/fastq/barcode12.fastq.gz
|
||||
- path: ./output/qcat/fastq/none.fastq.gz
|
||||
- path: ./output/qcat/fastq/none.fastq.gz
|
Loading…
Reference in a new issue