create genomescope2 module

This commit is contained in:
Mahesh Binzer-Panchal 2022-05-09 15:09:15 +00:00
parent 2061a41803
commit f65d896f57
6 changed files with 137 additions and 4 deletions

View file

@ -0,0 +1,42 @@
process GENOMESCOPE2 {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::genomescope2=2.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/genomescope2:2.0--py310r41hdfd78af_5':
'quay.io/biocontainers/genomescope2:2.0--py310r41hdfd78af_5' }"
input:
tuple val(meta), path(histogram)
output:
tuple val(meta), path("$prefix-linear_plot.png") , emit: linear_plot_png
tuple val(meta), path("$prefix-transformed_linear_plot.png"), emit: transformed_linear_plot_png
tuple val(meta), path("$prefix-log_plot.png") , emit: log_plot_png
tuple val(meta), path("$prefix-transformed_log_plot.png") , emit: transformed_log_plot_png
tuple val(meta), path("$prefix-model.txt") , emit: model
tuple val(meta), path("$prefix-summary.txt") , emit: summary
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
genomescope2 \\
--input $histogram \\
$args \\
--output . \\
--name_prefix $prefix
ls -l
cat <<-END_VERSIONS > versions.yml
'${task.process}':
genomescope2: \$( genomescope2 -v | sed 's/GenomeScope //' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,43 @@
name: "genomescope2"
description: Estimate genome heterozygosity, repeat content, and size from sequencing reads using a kmer-based statistical approach
keywords:
- "genome size"
- "genome heterozygosity"
- "repeat content"
tools:
- "genomescope2":
description: "Reference-free profiling of polyploid genomes"
homepage: "http://qb.cshl.edu/genomescope/genomescope2.0/"
documentation: "https://github.com/tbenavi1/genomescope2.0/blob/master/README.md"
tool_dev_url: "https://github.com/tbenavi1/genomescope2.0"
doi: "https://doi.org/10.1038/s41467-020-14998-3"
licence: "['Apache License, Version 2.0 (Apache-2.0)']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- histogram:
type: file
description: A K-mer histogram file
pattern: "*.hist"
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"
- linear_plot_png:
type: file
description: A genomescope2 linear plot in PNG format
pattern: "*.png"
authors:
- "@mahesh-panchal"

View file

@ -835,6 +835,10 @@ genmap/mappability:
- modules/genmap/mappability/**
- tests/modules/genmap/mappability/**
genomescope2:
- modules/genomescope2/**
- tests/modules/genomescope2/**
genrich:
- modules/genrich/**
- tests/modules/genrich/**
@ -1639,14 +1643,14 @@ samtools/bam2fq:
- modules/samtools/bam2fq/**
- tests/modules/samtools/bam2fq/**
samtools/convert:
- modules/samtools/convert/**
- tests/modules/samtools/convert/**
samtools/collatefastq:
- modules/samtools/collatefastq/**
- tests/modules/samtools/collatefastq/**
samtools/convert:
- modules/samtools/convert/**
- tests/modules/samtools/convert/**
samtools/depth:
- modules/samtools/depth/**
- tests/modules/samtools/depth/**

View file

@ -0,0 +1,19 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MERYL_COUNT } from '../../../modules/meryl/count/main.nf'
include { MERYL_HISTOGRAM } from '../../../modules/meryl/histogram/main.nf'
include { GENOMESCOPE2 } from '../../../modules/genomescope2/main.nf'
workflow test_genomescope2 {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
MERYL_COUNT ( input )
MERYL_HISTOGRAM ( MERYL_COUNT.out.meryl_db )
GENOMESCOPE2 ( MERYL_HISTOGRAM.out.hist )
}

View file

@ -0,0 +1,13 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: 'MERYL.*' {
ext.args = 'k=21'
}
withName: 'GENOMESCOPE2' {
ext.args = '-k 21 -p 1'
}
}

View file

@ -0,0 +1,12 @@
## TODO nf-core: Please run the following command to build this file:
# nf-core modules create-test-yml genomescope2
- name: "genomescope2"
command: nextflow run ./tests/modules/genomescope2 -entry test_genomescope2 -c ./tests/config/nextflow.config -c ./tests/modules/genomescope2/nextflow.config
tags:
- "genomescope2"
#
files:
- path: "output/genomescope2/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: output/genomescope2/versions.yml
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b