Make UniFrac accessible to everyone.
Go to releases and download the relevant zip file.
Unzip the file and run the relevant executable from the terminal (see instructions below).
None.
If your operating system and CPU architecture are not listeted in the releases, please let me know by opening an issue and I will do my best to add it.
Calculating UniFrac:
frcfrc -t my_genomes.tree -i my_abundances.tsv -o distances.txt
Creating a tree (optional):
trtr -k 21 -o my_genomes.tree species_1.fa species_2.fa species_3.fa
-- or --
trtr -k 21 -o my_genomes.tree "species_*.fa"
Consult the wiki for more details.
The output is the lower triangle of the distance matrix.
Example:
import numpy as np
def load_frcfrc_distances(file:str, num_samples:int):
distances = [float(x) for x in open(file)]
mat = np.zeros([num_samples,num_samples])
pos = np.tril_indices(num_samples,-1)
mat[pos] = distances # Lower triangle.
mat[pos[::-1]] = distances # Upper triangle.
return matSee the testdata directory for tests of this implementation.