GithubHelp home page GithubHelp logo

adelq / dnds Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 8.0 15 KB

Calculate dN/dS ratio precisely (Ka/Ks) using a codon-by-codon counting method.

License: MIT License

Python 100.00%

dnds's People

Contributors

adelq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dnds's Issues

incorrect dN/dS computations?

Sorry for reporting this. I've noticed your code. And it seems that this is not a conventional way of computing dN/dS based on counting. Probably you are not using this code at the moment, but I just want to warn you and people who might use this code.

The classical and improved method of computing dN/dS based on counts are described in the 1986 paper by Nei Gojobori or here. What you are computing looks more like p_N/p_S, which is fine, as long as people are aware that it is another estimate, with different properties. Also, I am not sure that you are correcting for:

  1. different trajectories for multinucleotide substitutions (i.e. TTT -> TCT -> TCC and TTT -> TTC -> TCC)
  2. stop codons; substitutions involving stop codon should not be considered (for computing N and for mutation trajectories).

There is a reference implementation in C available in PAML (function DistanceMatNG86), it might be a good idea to compare your implementation with it.

Again, sorry for intruding. It's just a friendly message, so you are aware.

Gaps and table 11 for genetic code.

Hi - nice to see a python implementation!

Are you able to modify this to specify the genetic code (11 for bacteria) and to take multiple sequence alignments with gaps and Ns and calculate all dnds Vs a reference sequence?

Regards,
Liam

Are you reporting dN/dS or pN/pS?

I have been using this helpful blog post to learn about dN/dS ratios.

http://bioinformatics.cvr.ac.uk/blog/calculating-dnds-for-ngs-datasets/

However, following through their example with your code there was a discrepancy.

According to the scheme set out in that blog post, you are reporting the pN/pS. Following onto the Nei & Gojobori, 1986 paper, which the blog post authors reference, I think the part you omitted was the conversion to per site results according to Jukes & Cantor 1967.

When I add in the below, I get the same result as the blog post authors for their sequence (0.1247)

pn = non_subs / non_sites
ps = syn_subs / syn_sites
dn = -(3 / 4) * log(1 - (4 * pn / 3))
ds = -(3 / 4) * log(1 - (4 * ps / 3))

What are your thoughts on that discrepancy?

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.