Package: pankmer
Primary contact: Anthony Aylward,aaylward@salk.eduPanKmerk-mer based and reference-free pangenome analysis. See the quickstart below, or read thedocumentation.Repository structurebenchmark/Shell scripts defining benchmarking runsdocs/Source code and makefiles for Sphinx documentationsource/Documentation source code in ReStructuredText formatMakefileSphinx infrastructuremake.batSphinx infrastructurepankmer-manual.pdfUser manual generated fromsphinx-build -b latexpdfexample/Files for use in README examples, can probably remove thisrust/Cargo config and Rust source codesrc/Rust codeCargo.tomlCargo configsnakemake/Snakemake workflows, some of these are currently outdatedsrc/pankmer/Python source codetest/Python unit tests (run withpytest)LicensePanKmer is licensed under aSalk Institute BSD licenseInstallationIn a conda environmentFirst create an environment that includes all dependencies:conda create -c conda-forge -c bioconda -n pankmer cython \
  gff2bed more-itertools pybedtools python-newick pyfaidx \
  rust seaborn upsetplot urllib3Then install PanKmer withpip:conda activate pankmer
pip install pankmerWith pipPanKmer is built withRust,
so you will need toinstallit if you have not already done so. Then you can install PanKmer withpip:pip install pankmerCheck installationCheck that the installation was successful by running:pankmer --versionTutorialDownload example datasetThedownload-examplesubcommand will download a small example dataset of
Chr19 sequences fromS. polyrhiza.pankmer download-example -d .After running this command the directoryPanKmer_example_Sp_Chr19/will be present in the working directory. It contains FASTA files representing Chr19 from three genomes, and GFF files giving their gene annotations.ls PanKmer_example_Sp_Chr19/*PanKmer_example_Sp_Chr19/README.md

PanKmer_example_Sp_Chr19/Sp_Chr19_features:
Sp9509_oxford_v3_Chr19.gff3.gz Sp9512_a02_genes_Chr19.gff3.gz

PanKmer_example_Sp_Chr19/Sp_Chr19_genomes:
Sp7498_HiC_Chr19.fasta.gz Sp9509_oxford_v3_Chr19.fasta.gz Sp9512_a02_genome_Chr19.fasta.gzTo get started, navigate to the downloaded directory.cd PanKmer_example_Sp_Chr19/Build ak-mer indexThek-mer index is a table tracking presence or absence ofk-mers in the set of input genomes. To build an index, use theindexsubcommand and provide a directory containing the input genomes.pankmer index -g Sp_Chr19_genomes/ -o Sp_Chr19_index.tarAfter completion, the index will be present as a tar fileSp_Chr19_index.tar.tar -tvf Sp_Chr19_index.tarSp_Chr19_index/
Sp_Chr19_index/kmers.bgz
Sp_Chr19_index/metadata.json
Sp_Chr19_index/scores.bgzNoteThe input genomes argument proided with the-gflag can be a directory, a tar archive, or a space-separated list of FASTA files.If the output argument provided with the-oflag ends with.tar, then the index will be written as a tar archive. Otherwise it will be written as a directory.Create an adjacency matrixA useful application of thek-mer index is to generate an adjacency matrix. This is a table ofk-mer similarity values for each pair of genomes in the index. We can generate one using theadj-matrixsubcommand, which will produce a CSV or TSV file containing the matrix.pankmer adj-matrix -i Sp_Chr19_index.tar -o Sp_Chr19_adj_matrix.csv
pankmer adj-matrix -i Sp_Chr19_index.tar -o Sp_Chr19_adj_matrix.tsvNoteThe input index argument proided with the-iflag can be tar archive or a directory.Plot a clustered heatmapTo visualize the adjacency matrix, we can plot a clustered heatmap of the adjacency values. In this case we use the Jaccard similarity metric for pairwise comparisons between genomes:pankmer clustermap -i Sp_Chr19_adj_matrix.csv \
  -o Sp_Chr19_adj_matrix.svg \
  --metric jaccard \
  --width 6.5 \
  --height 6.5Generate a gene variability heatmapGenerate a heatmap showing variability of genes across genomes. The following command uses the--n-featuresoption to limit analysis to the first two genes from each input GFF3 file. The resulting image shows the level of variability observed across genes from each genome.pankmer anchor-heatmap -i Sp_Chr19_index.tar \
  -a Sp_Chr19_genomes/Sp9509_oxford_v3_Chr19.fasta.gz Sp_Chr19_genomes/Sp9512_a02_genome_Chr19.fasta.gz \
  -f Sp_Chr19_features/Sp9509_oxford_v3_Chr19.gff3.gz Sp_Chr19_features/Sp9512_a02_genes_Chr19.gff3.gz \
  -o Sp_Chr19_gene_var.png \
  --n-features 2 \
  --height 3Pangenome datasetsThepankmer download-examplesubcommand can be used to download genomes from several publicly available pangenome datasets. See the help text:pankmerdownload-example--helpusage: pankmer download-example [-h] [-d <dir/>] [-s {Spolyrhiza,Slycopersicum,Zmays,Hsapiens,Bsubtilis,Athaliana}] [-n <int>]

options:
  -h, --help            show this help message and exit
  -d <dir/>, --dir <dir/>
                        destination directory for example data
  -s {Spolyrhiza,Slycopersicum,Zmays,Hsapiens,Bsubtilis,Athaliana}, --species {Spolyrhiza,Slycopersicum,Zmays,Hsapiens,Bsubtilis,Athaliana}
                        download publicly available genomes. Species: max_samples. Spolyrhiza: 3, Slycopersicum: 46, Zmays: 54, Hsapiens: 94,    Bsubtilis: 164, Athaliana: 1135
  -n <int>, --n-samples <int>
                        number of samples to download, must be less than species max [1]The-s/--speciesoption selects the species, and the-n/--n-samplesoption selects the number of samples to download. The maximum number of samples for each species is:SpeciesMax samplesS. polyrhiza3S. lycopersicum46Z. mays54H. sapiens94B. subtilis164A. thaliana1135See below a description of each pangenome datasetS. lycopersicum46Solanum lycopersicumgenomes from theSolOmics database. See also:Nature article.Z. mays54Zea maysgenomes from thedownloads pageofMaizeGDB.H. sapiens94Homo sapienshaplotypes from Year 1 of theHuman Pangenome Reference Consortium/Human Pangenome Project. Download details found at theHPRC/HPP github repository.Nature articleB. subtilis164B. subtilisgenomes from NCBI.A. thaliana1135A. thalianapseudo-genomes from thedata centerof1001 GenomesS. polyrhizaA collection of 3Spirodela polyrhizaclones Sp7498, Sp9509, Sp9512, from the following sources: Sp7498 and Sp9509 sequences were sourced from the following references found athttp://spirodelagenome.org:Sp9509_oxford_v3
NCBI: GCA_900492545.1
CoGe: id51364
This genome was generated with Oxford Nanopore and polished with Illumina, scaffolded against the previous Illumina-based genome Sp9509v3 and validated with BioNano optical maps and multi-color FISH (mcFISH).

Hoang PNT, Michael TP, Gilbert S, Chu P, Motley TS, Appenroth KJ, Schubert I, Lam E. Generating a high-confidence reference genome map of the Greater Duckweed by integration of cytogenomic, optical mapping and Oxford Nanopore technologies. Plant J. 2018 Jul 28.

Sp7498_HiC
CoGe: 55877
This assembly was generated using Oxford Nanopore long reads and Illumina-based HiC scaffolding.

Harkess A, McGlaughlin F, Bilkey N, Elliott K, Emenecker R, Mattoon E, Miller K, Vierstra R, Meyers BC, Michael TP. High contiguity Spirodela polyrhiza genomes reveal conserved chromosomal structure. Submitted.Sp9512 sequence was sourced from research data for the following in-progress publication:Pasaribu B, Acosta K, Aylward A, Abramson BW, Colt K, Hartwick NT, Liang Y, Shanklin J, Michael TP, Lam E Genomics of turions from the Greater Duckweed reveal pathways for tissue dormancy and reemergence strategy of an aquatic plant.Sp9512 can be downloaded fromMichael lab AWS storage.