Skip to main content

A simple package for calculating pairwise SNP distances

Project description


Travis-CI Build Status


This is a Python3 version of pairsnp written with the help of Simon Frost

git clone
cd pairsnp-python
pip3 install .

Quick Start

The python version can be run from the python interpreter as

from pairsnp import calculate_snp_matrix, calculate_distance_matrix

sparse_matrix, consensus, seq_names = calculate_snp_matrix(
d = calculate_distance_matrix(sparse_matrix, consensus, "dist", False)

alternatively if installed using pip it can be used at the command line as

pairsnp -f /path/to/msa.fasta -o /path/to/output.csv

additional options include

Program to calculate pairwise SNP distance and similarity matrices.

optional arguments:
  -h, --help            show this help message and exit
  -t {sim,dist}, --type {sim,dist}
                        either sim (similarity) or dist (distance) (default).
  -n, --inc_n           flag to indicate differences to gaps should be
                        location of a multiple sequence alignment. Currently
                        only DNA alignments are supported.
  -z, --zipped          Alignment is gzipped.
  -c, --csv             Output csv-delimited table (default tsv).
  -o OUTPUT, --out OUTPUT
                        location of output file.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pairsnp, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size pairsnp-0.0.7-py3-none-any.whl (5.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pairsnp-0.0.7.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page