---
# System prepended metadata

title: SnakeMakeDemo

---

# SnakeMakeDemo
* Michael Maniscalco
* 20230128
_________________





### Install mambaforge which is a faster package manager that has less issues
```shell    
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh


```

* Create environment with sourmash installed

```shell=
mamba create -n sourmash_dev tox-conda rust git compilers pandoc python=3.8


conda activate demo_mamba_snakemake
```


* Install snakemake via mamba
* Install sourmash
```shell
mamba install snakemake

mamba install sourmash
```


### download files

```shell
curl -L -O "https://osf.io/download/5hp68/GCF_000017325.1.fna.gz"
curl -L -O  "https://osf.io/download/y7kf8/GCF_000020225.1.fna.gz"
curl -L -O https://osf.io/download/m5672/GCF_000021665.1.fna.gz
```

### A first, simple snakemake workflow
Here's a simple, useful snakemake workflow:
```shell

rule compare_genomes:
    message: "compare all input genomes using sourmash"
    shell: """
        sourmash sketch dna -p k=31 genomes/*.fna.gz --name-from-first 

        sourmash compare GCF_000021665.1.fna.gz.sig \
            GCF_000017325.1.fna.gz.sig GCF_000020225.1.fna.gz.sig \
            -o compare.mat

        sourmash plot compare.mat
    """
    
```







