Giter Site home page Giter Site logo

petrie's Introduction

Petrie

petrie

vulnerabilities coverage

a Graph-based phylogenetic tree, implemented in Javascript.

Phylogeny and Taxonomy

Whether your purposes are phylogenetic or taxonomic in nature doesn't matter. That is, whether you are making a evolutional tree, or a species classification tree. Your source of graph data will determine the utility.

Graph

Implementation

todo

Nepenthes Example

I chose Nepenthes, because I grow them at home! This project is part of a bigger one related to carnivorous plants and terraria that I'm breaking apart.

I'm a hobbiest, so if youre actually in a scientific field and have favorite phylogenetic database, data structure, protocol to share this kind of data, or other research I know nothing about!, I'd love to hear about it in the issues.

Getting started

Install package.

yarn add petrie

Import module.

import Tree from 'petrie';

Create a cached tree from the ICPS Carnivorous Plant Names Database.

Create a cached tree using NCBS.

Creating your own tree.

Import your data.

import data from './data'; // default export location

Initialize a new Tree instance.

const tree = new Tree(data);

Searching.

tree.find('nepenthes');

tree.find('nepenthes a');

Taxonomy

const ampullaria = tree.find('nepenthes ampullaria')[0];

ampullaria.name // binomial name
ampullaria.domain
ampullaria.order
ampullaria.species

ampullaria.divisions // synonymous with Species.prototype.children
ampullaria.order.divisions

// using HAMT methods to determine parents and children
ampullaria.children
const nepenthes = tree.find('nepenthes')[0]
ampullaria.isParent(nepenthes);
// false
nepenthes.isParent(ampullaria);
// true

Phylogeny

const nepenthes
ampullaria.geneticDistance();

HAMT

Using HAMT means that we have an entire tree-searching algorithm at our hands. Let's use it to create a binomial name searching autocomplete.

Graphing

D3 is an optional dependency to try to keep this project footprint small, and because not everybody needs graphing. If you like other chart libraries, please feel free to let me know in the issues.

import d3 from 'd3';

Contributing

Issues and pull requests are very welcome!

Tests

yarn test

License

MIT

petrie's People

Stargazers

 avatar

petrie's Issues

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.