near-linear-cophenetic-distance
Calculating generalized Cophenetic Distances in near-linear time under any Lp norm.
https://github.com/sriram98v/near-linear-cophenetic-distance
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
Calculating generalized Cophenetic Distances in near-linear time under any Lp norm.
Basic Info
Statistics
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Near Linear Cophenetic Distance
This repository contains a rust crate to compute the cophenetic distance between two rooted phylogenetic trees in near-linear time.
Installation
To install you must first have cargo and rustup installed:
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installing the above command you can run the following to install nlcd:
bash
cargo install --git=https://github.com/sriram98v/near-linear-cophenetic-distance
Alternatively, you can install seq_class by cloning this repository and building it locally:
bash
git clone https://github.com/sriram98v/near-linear-cophenetic-distance
cd near-linear-cophenetic-distance
cargo install --path=./
Usage
Finding the Cophenetic distance between a pair of trees
To compute the cophenetic distance between a pair of trees, please create a single file with the extension .tre containing the two trees in Newick format (line-separated). The run the following command to compute the cophenetic distance with depth as the path function:
bash
nlcd dist -i <PATH TO .TRE FILE> -p <NORM>
Examples
An example input file can be found in the EXAMPLES directory. This file contains a pair of edge-weight phylogenetic trees over the same taxa. Below are the flags that can be used:
```bash
Usage: nlcd dist --norm
Options:
-p, --norm
To compute the cophenetic distance between the trees taking only topology into account, set weighted to false, which will set all edge-weights to 1. When method is set todepth, the depth of the vertex will be computed as the sum of all the edge-weights in the path from the vertex to the root. Similarly, When method is set toheight, the height of a vertex will be computed as the sum of all the edge-weights in the path from the vertex to the closest leaf. When method is set tosize```, the size of the vertex will be computed as the number of leaves in the subtree rooted at that vertex.
For example, the following command computes the distance between the pair of example trees by comparing the depth of the vertices under the first norm.
bash
nlcd dist -i ./EXAMPLES/trees.nwk -p 1 -m depth -w false
Similarly, the following command computes the distance between the pair of example trees by comparing the weighted distances of the vertices from the root vertex under the first norm.
bash
nlcd dist -i ./EXAMPLES/trees.nwk -p 1 -m depth -w true
In the case that the contributing function is externally computed, you can set the weight of the edge between a vertex and it's parent to be the value of the contributing function for that vertex and then run the folloing command.
bash
nlcd dist -i ./EXAMPLES/trees.nwk -p 1 -m local -w true
Note that when mode is set to local the weighted flag is treated true regardless of user input, and the weight of the edge leading to the root vertex is always zero.
Owner
- Login: sriram98v
- Kind: user
- Website: sriram98v.github.io/cv/
- Repositories: 1
- Profile: https://github.com/sriram98v
GitHub Events
Total
- Push event: 9
Last Year
- Push event: 9
Dependencies
- anstream 0.6.14
- anstyle 1.0.7
- anstyle-parse 0.2.4
- anstyle-query 1.1.0
- anstyle-wincon 3.0.3
- anyhow 1.0.86
- autocfg 1.3.0
- byteorder 1.5.0
- cfg-if 1.0.0
- clap 4.5.7
- clap_builder 4.5.7
- clap_lex 0.7.1
- colorchoice 1.0.1
- console 0.15.8
- crossbeam-deque 0.8.5
- crossbeam-epoch 0.9.18
- crossbeam-utils 0.8.20
- either 1.12.0
- encode_unicode 0.3.6
- fxhash 0.2.1
- getrandom 0.2.15
- indicatif 0.17.8
- instant 0.1.13
- is_terminal_polyfill 1.70.0
- itertools 0.11.0
- itertools 0.13.0
- lazy_static 1.4.0
- libc 0.2.155
- num 0.4.3
- num-bigint 0.4.5
- num-complex 0.4.6
- num-integer 0.1.46
- num-iter 0.1.45
- num-rational 0.4.2
- num-traits 0.2.19
- number_prefix 0.4.0
- portable-atomic 1.6.0
- ppv-lite86 0.2.17
- rand 0.8.5
- rand_chacha 0.3.1
- rand_core 0.6.4
- rayon 1.10.0
- rayon-core 1.12.1
- strsim 0.11.1
- unicode-width 0.1.13
- utf8parse 0.2.2
- vers-vecs 1.3.1
- wasi 0.11.0+wasi-snapshot-preview1
- windows-sys 0.52.0
- windows-targets 0.52.5
- windows_aarch64_gnullvm 0.52.5
- windows_aarch64_msvc 0.52.5
- windows_i686_gnu 0.52.5
- windows_i686_gnullvm 0.52.5
- windows_i686_msvc 0.52.5
- windows_x86_64_gnu 0.52.5
- windows_x86_64_gnullvm 0.52.5
- windows_x86_64_msvc 0.52.5
- contourpy ==1.2.1
- cycler ==0.12.1
- fonttools ==4.53.0
- kiwisolver ==1.4.5
- matplotlib ==3.9.0
- numpy ==2.0.0
- packaging ==24.1
- pillow ==10.3.0
- pyparsing ==3.1.2
- python-dateutil ==2.9.0.post0
- six ==1.16.0