Code Monkey home page Code Monkey logo

msa2pi's Introduction

MSA2pi

This is a simple software to calculate π value file from multiple sequence alignment fasta file.

Install

Make sure you have JDK>=1.8 and ant installed on your computer.

git clone https://github.com/baoxingsong/MSA2pi.git
cd MSA2pi
ant

You will get MSA2pi.jar

Usage

java -jar MSA2pi.jar -i inputFile [-r reference sequence name]

The input file should be in multiple fasta format and aligned with multiple sequence alignment application.

For DNA sequence, if your sequence used wide IUPAC code (https://www.bioinformatics.org/sms/iupac.html) 
and the reference sequence name is assigned in the parameter, 
those ambiguous letters could be changed to the reference letter at the same position. 
If the reference sequence name is no assigned, the ambiguous letters would be treated 
in the same way with INDEL (-).

Motivation

Nucleotide diversity, π, was defined as, the average number of nucleotide differences per site between two sequences. And it is a widely used measure for sequence conservation.

As the accumulation of our knowledge, we find it is controversial to calculate π value for INDELs. Especially when there are INDELs with positive overlap with each other, since we do not know the evolution process, it is not convincing to take each INDEL as a single variant. If we take the INDEL as missing value, and divide the total number of variants by the total sequence length, there would be bias. Since sequence_length*n*(n-1)/2 times of comparison have not been performed. And I did not find available application with detailed document about how to deal with INDELs for π value calculation, I decide to write this simple application.

For n sequences with length l, 1<=i<=l, we calculate total number of pair-wised variants at position i. We have the allele frequency fa,i for the allele a and total number of accession with no INDEL at position i, mi. Then Pi=sum(fa,i*(mi-fa,i)/2), Ni=mi*(mi-1)/2. And P=sum(Pi), N=sum(Ni).

π=P/N

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.