Merge pull request #1641 from mahesh-panchal/genomescope2

Genomescope2 module
This commit is contained in:
Mahesh Binzer-Panchal 2022-05-13 11:37:49 +02:00 committed by GitHub
commit 4acbf9d356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 169 additions and 4 deletions

View file

@ -0,0 +1,40 @@
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("*_linear_plot.png") , emit: linear_plot_png
tuple val(meta), path("*_transformed_linear_plot.png"), emit: transformed_linear_plot_png
tuple val(meta), path("*_log_plot.png") , emit: log_plot_png
tuple val(meta), path("*_transformed_log_plot.png") , emit: transformed_log_plot_png
tuple val(meta), path("*_model.txt") , emit: model
tuple val(meta), path("*_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
cat <<-END_VERSIONS > versions.yml
'${task.process}':
genomescope2: \$( genomescope2 -v | sed 's/GenomeScope //' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,67 @@
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: "*_linear_plot.png"
- linear_plot_png:
type: file
description: A genomescope2 linear plot in PNG format
pattern: "*_linear_plot.png"
- transformed_linear_plot_png:
type: file
description: A genomescope2 transformed linear plot in PNG format
pattern: "*_transformed_linear_plot.png"
- log_plot_png:
type: file
description: A genomescope2 log plot in PNG format
pattern: "*_log_plot.png"
- transformed_log_plot_png:
type: file
description: A genomescope2 transformed log plot in PNG format
pattern: "*_transformed_log_plot.png"
- model:
type: file
description: Genomescope2 model fit summary
pattern: "*_model.txt"
- summary:
type: file
description: Genomescope2 histogram summary
pattern: "*_summary.txt"
authors:
- "@mahesh-panchal"

View file

@ -839,6 +839,10 @@ genmap/mappability:
- modules/genmap/mappability/** - modules/genmap/mappability/**
- tests/modules/genmap/mappability/** - tests/modules/genmap/mappability/**
genomescope2:
- modules/genomescope2/**
- tests/modules/genomescope2/**
genrich: genrich:
- modules/genrich/** - modules/genrich/**
- tests/modules/genrich/** - tests/modules/genrich/**
@ -1647,14 +1651,14 @@ samtools/bam2fq:
- modules/samtools/bam2fq/** - modules/samtools/bam2fq/**
- tests/modules/samtools/bam2fq/** - tests/modules/samtools/bam2fq/**
samtools/convert:
- modules/samtools/convert/**
- tests/modules/samtools/convert/**
samtools/collatefastq: samtools/collatefastq:
- modules/samtools/collatefastq/** - modules/samtools/collatefastq/**
- tests/modules/samtools/collatefastq/** - tests/modules/samtools/collatefastq/**
samtools/convert:
- modules/samtools/convert/**
- tests/modules/samtools/convert/**
samtools/depth: samtools/depth:
- modules/samtools/depth/** - modules/samtools/depth/**
- tests/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['bacteroides_fragilis']['illumina']['test1_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,22 @@
- name: genomescope2 test_genomescope2
command: nextflow run tests/modules/genomescope2 -entry test_genomescope2 -c tests/config/nextflow.config
tags:
- genomescope2
files:
- path: output/genomescope2/test_linear_plot.png
md5sum: 94c165c5028156299a1d4d05766cac51
- path: output/genomescope2/test_log_plot.png
md5sum: 9d25ca463d92a0c73a893da7fd3979ba
- path: output/genomescope2/test_model.txt
md5sum: 3caf62f715f64a2f2b8fdff5d079cb84
- path: output/genomescope2/test_summary.txt
md5sum: 7452860e2cea99b85f3ff60daeac77f5
- path: output/genomescope2/test_transformed_linear_plot.png
md5sum: 99a64c1c18d8670f64cb863d4334abbb
- path: output/genomescope2/test_transformed_log_plot.png
md5sum: b4e029c9fb9987ca33b17392a691c1b4
- path: output/genomescope2/versions.yml
md5sum: 18afeb26f62a47f680b2bb3e27da9cbc
- path: output/meryl/test.hist
md5sum: f75362ab9cd70d96621b3690e952085f
- path: output/meryl/versions.yml