Giter Club home page Giter Club logo

snp-dists's Introduction

snpdist

Convert a FASTA alignment to SNP distance matrix

Quick Start

% cat test/good.aln

>seq1
AGTCAGTC
>seq2
AGGCAGTC
>seq3
AGTGAGTA
>seq4
TGTTAGAC

% snp-dists test/good.aln > distances.tab

Read 4 sequences of length 8

% cat distances.tab

snp-dists 0.2   seq1    seq2    seq3    seq4
seq1            0       1       2       3
seq2            1       0       3       4
seq3            2       3       0       4
seq4            3       4       4       0

Installation

Homebrew

brew tap tseemann/bioinformatics-linux
brew install snp-dists

From source

snp-dists is written in C to the C99 standard and only depends on libz. Ensure you have a standard development environment installed (e.g. gcc, automake, autoconf, libtool).

git clone https://github.com/tseemann/snp-dists.git
cd snp-dists
autoreconf -i -f
./configure
make
sudo make install

Docker

Install Docker. To build the container from scratch:

git clone https://github.com/tseemann/snp-dists.git
cd snp-dists
docker build .

Alternatively you can pull in a prebuilt container from docker hub.

docker pull tseemann/snpdists

To use it you would use a command such as this (substituting in your directories), where your files are assumed to be stored in /home/ubuntu/data:

docker run --rm -it -v /home/ubuntu/data:/data tseemann/snpdists tseemann/snpdists 

Debian/Ubuntu

To install on a modern Debian or Ubuntu based system, run the commands below as root:

apt-get update -qq && apt-get install -y build-essential git zlib1g-dev automake autoconf libtool check pkg-config
git clone https://github.com/tseemann/snp-dists.git
cd snp-dists && autoreconf -i -f && ./configure && make && make install
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

RHEL/Centos

To install on a modern RHEL or Centos based system, run the commands below as root:

yum groupinstall 'Development Tools' 
yum install git check
git clone https://github.com/tseemann/snp-dists.git
cd snp-dists && autoreconf -i -f && ./configure && make && make install
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Options

snp-dists -h (help)

SYNOPSIS
  Pairwise SNP distance matrix from a FASTA alignment
USAGE
  snp-dists [options] alignment.fasta > matrix.tsv
OPTIONS
  -h    Show this help
  -v    Print version and exit
  -q    Quiet mode; do not print progress information
  -c    Output CSV instead of TSV
  -b    Blank top left corner cell instead of 'snp-dists 0.2'
URL
  https://github.com/tseemann/snp-dists

snp-dists -v (version)

Prints the name and version separated by a space in standard Unix fashion.

snp-dists 0.2

snp-dists -q (quiet mode)

Don't print informational messages, only errors.

snp-dists -c good.aln (CSV instead of TSV)

snp-dists 0.2,seq1,seq2,seq3,seq4
seq1,0,1,2,3
seq2,1,0,3,4
seq3,2,3,0,4
seq4,3,4,4,0

snp-dists -b good.aln (Omit the toolname/version)

        seq1    seq2    seq3    seq4
seq1    0       1       2       3
seq2    1       0       3       4
seq3    2       3       0       4
seq4    3       4       4       0

Issues

File problems here: https://github.com/tseemann/snp-dists/issues

License

GPLv3

Authors

  • Torsten Seemann
  • Andrew J Page

snp-dists's People

Contributors

admiralenola avatar andrewjpage avatar kloetzl avatar tseemann avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

lancetxiao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.