A simple snakemake workflow comparing three genomes.
Run it like so:
snakemake -j 4 --use-conda
Information and links
This repo provides a snakemake workflow that uses sourmash to compare three genomes and generate a similarity matrix. All of the necessary software is installed by conda .
The snakemake workflow is described in the Snakefile .
The required software is listed in binder/environment.yml .
Workflow diagram
Code Snippets
2 3 4 5 6 7 8 9 10 11 12 13 14 15 | args = commandArgs(trailingOnly=TRUE) cat(args, sep="\n") input_file <- args[1] cat(input_file) output_format = "html_document" if (length(args)==3) { output_format = args[2] } rmarkdown::render(input_file, output_format=output_format) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(ggplot2) ## plotting! may not be needed. library(pheatmap) ## for heatmap generation library(ggplotify) ## convert pheatmap to ggplot2 compatibility library(viridis) ## color palette stuff. args <- commandArgs(trailingOnly=TRUE) cat(args) mat_csv <- args[1] out_fig <- args[2] # read matrix CSV file, as output by sourmash compare --csv sourmash_comp_matrix <- read.csv(mat_csv) # Label the rows rownames(sourmash_comp_matrix) <- colnames(sourmash_comp_matrix) # make heatmap! heatmap_gg <- as.ggplot(pheatmap(sourmash_comp_matrix)) ggsave(out_fig) #, device="png") |
23 24 25 | shell: """ curl -JL {params.url} -o {output} """ |
34 35 36 37 | shell: """ sourmash sketch dna -p k=31 {input.genome_file} -o {output.sketch} \ --name-from-first """ |
47 48 49 | shell: """ sourmash compare {input.sketches} -o {output.matrix} --csv {output.csv} """ |
58 59 60 | shell: """ sourmash plot {input} --labels """ |
68 69 70 | shell: """ Rscript plot-compare.R {input} {output} """ |
79 80 81 | shell: """ Rscript knit-Rmd.R {input.Rmd} html_document """ |
Support
Do you know this workflow well? If so, you can
request seller status , and start supporting this workflow.
Created: 1yr ago
Updated: 1yr ago
Maitainers:
public
URL:
https://github.com/ngs-docs/2023-ggg298-sourmash-compare
Name:
2023-ggg298-sourmash-compare
Version:
v0.1
Downloaded:
0
Copyright:
Public Domain
License:
BSD 3-Clause "New" or "Revised" License
Keywords:
- Future updates
Related Workflows

ENCODE pipeline for histone marks developed for the psychENCODE project
psychip pipeline is an improved version of the ENCODE pipeline for histone marks developed for the psychENCODE project.
The o...

Near-real time tracking of SARS-CoV-2 in Connecticut
Repository containing scripts to perform near-real time tracking of SARS-CoV-2 in Connecticut using genomic data. This pipeli...

snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...

ATLAS - Three commands to start analyzing your metagenome data
Metagenome-atlas is a easy-to-use metagenomic pipeline based on snakemake. It handles all steps from QC, Assembly, Binning, t...
raw sequence reads
Genome assembly
Annotation track
checkm2
gunc
prodigal
snakemake-wrapper-utils
MEGAHIT
Atlas
BBMap
Biopython
BioRuby
Bwa-mem2
cd-hit
CheckM
DAS
Diamond
eggNOG-mapper v2
MetaBAT 2
Minimap2
MMseqs
MultiQC
Pandas
Picard
pyfastx
SAMtools
SemiBin
Snakemake
SPAdes
SqueezeMeta
TADpole
VAMB
CONCOCT
ete3
gtdbtk
h5py
networkx
numpy
plotly
psutil
utils
metagenomics

RNA-seq workflow using STAR and DESeq2
This workflow performs a differential gene expression analysis with STAR and Deseq2. The usage of this workflow is described ...

This Snakemake pipeline implements the GATK best-practices workflow
This Snakemake pipeline implements the GATK best-practices workflow for calling small germline variants. The usage of thi...