GENOMESCOPE
Reference-free profiling of polyploid genomes
URL: https://github.com/tbenavi1/genomescope2.0
Example
This wrapper can be used in the following way:
rule genomescope:
input:
hist="{sample}.hist",
output:
multiext(
"{sample}/",
"linear_plot.png",
"log_plot.png",
"model.txt",
"progress.txt",
"SIMULATED_testing.tsv",
"summary.txt",
"transformed_linear_plot.png",
"transformed_log_plot.png",
),
log:
"logs/genomescope/{sample}.log",
params:
extra="--kmer_length 32 --testing",
wrapper:
"v5.0.1/bio/genomescope"
Note that input, output and log file paths can be chosen freely.
When running with
snakemake --use-conda
the software dependencies will be automatically deployed into an isolated environment before execution.
Notes
The extra param allows for additional program arguments (kmer length -k/–kmer_length is mandatory).
Software dependencies
genomescope2=2.0.1
Input/Output
Input:
kmer histogram
Output:
inferred genome characteristics and plots
Code
__author__ = "Filipe G. Vieira"
__copyright__ = "Copyright 2022, Filipe G. Vieira"
__license__ = "MIT"
import os
from snakemake.shell import shell
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
out_basename = os.path.commonpath(snakemake.output)
shell("genomescope2 --input {snakemake.input} {extra} --output {out_basename} {log}")