Coder Social home page Coder Social logo

phylo2vec_cpp's Introduction

Phylo2Vec: a vector representation for binary trees

Installation

Prerequisites:

  • C++14
  • GoogleTest 1.11.0: sudo apt-get install libgtest-dev
  • clang-format: sudo apt install clang-format
  • cmake 3.22.1: sudo apt-get install cmake
  • cxxopts 3.1.1:
    git clone https://github.com/jarro2783/cxxopts.git
    cd cxxopts
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    

Compile and build from scratch:

mkdir build
cd build
cmake ..
make

Or use the executable. To get information about all arguments:

./phylo2vec -h

Arguments:

  -h, --help            Show help
      --toNewick arg    Convert to Newick format. Example input: 0 1 4
      --toVector arg    Convert to integer vector. Example input:
                        "(((2,1)4,0)5,3)6;"
      --with_mapping    For Newicks that do not only contain digits, to use with toVector. Example input: "(((((((tip_0:1.44,tip_1:1.44)8042:0.46,(tip_2:1.5,tip_3:1.5)8043:0.4)8044:0.3,(tip_4:1.51,tip_5:1.51)8045:0.69)8046:0.4,tip_6:2.6)8047:1.05,tip_7:3.65)8048:0.5,(((tip_8:0.72,tip_9:0.72)8049:0.28,tip_10:1)8050:1.56,tip_11:2.56)8051:1.59)8052:1.96,tip_12:6.11)8053:0;"
      --num_leaves arg  Number of leaves (optional, but recommended when
                        using toVector)

Example usage of toNewick:

phylo2vec --toNewick 0 1 4

Example usage of toVector:

phylo2vec --toVector "(((2,1)4,0)5,3)6;" --num_leaves 4

Example usage of toVector:

./phylo2vec --with_mapping --toVector "(((((((tip_0:1.44,tip_1:1.44)8042:0.46,(tip_2:1.5,tip_3:1.5)8043:0.4)8044:0.3,(tip_4:1.51,tip_5:1.51)8045:0.69)8046:0.4,tip_6:2.6)8047:1.05,tip_7:3.65)8048:0.5,(((tip_8:0.72,tip_9:0.72)8049:0.28,tip_10:1)8050:1.56,tip_11:2.56)8051:1.59)8052:1.96,tip_12:6.11)8053:0;"

Python version:

Citation and other work

Note

  • At least half of this repo was coded on a Samsung A40 using JDoodle, that should probably deserve a star :)

phylo2vec_cpp's People

Contributors

neclow avatar

Stargazers

Prince Ravi Leow avatar Luiz Max Carvalho avatar

Watchers

Luiz Max Carvalho avatar  avatar Prince Ravi Leow 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.