Git Product home page Git Product logo

fifteen's Introduction

fifteen

shields.io shields.io

(DBA table_five)

Experimental library for quick quintet tallying, useful when you have a lot of quintets that somehow you don't want to count yourself.

Usage

Binary wheels are provided on PyPI for Python starting from 3.7, but note that PyPy is not supported (yet).

python3 -m pip install table-five

API

TreeSet

A treeset is an efficient (i.e., fast parsing) list of tree topologies. The construction is $O(k n \lg n)$ where $k$ is the number of trees and $n$ the number of taxa. The log factor is due to the LCA data structure initialization.

from table_five import TreeSet
trees = TreeSet("path_to_newline_delimited_newicks.tre")

Quintet Counting

The major API is tally_single_quintet returning a list of length 15 containing the empirical counts of the 15 ADR unrooted quintet topology among the tree-set in $O(k)$ time:

# get counts of the ADR unrooted quintet topologies on taxa '1','2','3','4','5'. Taxa order matters.
treeset.tally_single_quintet(('1','2','3','4','5'))
# obviously you might want to convert it to numpy arrays

# normalize by the number of genes in the tree-set
new_tree_dist = np.asarray(treeset.tally_single_quintet(q_taxa)) / len(treeset)

Development and Building

After installing the Rust toolchain and Maturin, see the following commands:

# build the library
maturin build
# installing it locally
maturin develop

See the Maturin documentation for more details.

fifteen's People

Contributors

runeblaze avatar

Watchers

 avatar

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.