UNPKG

phylojs

Version:

A simple typescript library for phylogenetic trees

31 lines (30 loc) 1.6 kB
import { Node, Tree } from '../../'; /** * Writes tree in .newick format. Undefined branch lengths set to 0. * @param {tree} tree The tree to write * @param {annotationWriter} string Function parsing node annotations to string. Defaults to empty string - no annotation case. Can be user Defined or use in-build beastAnnotations or nhxAnnotations * @returns {string} */ export declare function writeNewick(tree: Tree, annotationWriter?: (annotation: typeof Node.prototype.annotation) => string): string; /** * Recurses through tree, writing building up nwk string as it foes * @param {node} Node * @param {annotationWriter} string Function parsing Node.annotation to string. Defaults to empty string, not writing annotations. Can be user Defined or use in-build beastAnnotations or nhxAnnotations * @returns {string} */ export declare function newickRecurse(node: Node, annotationWriter?: (annotation: typeof Node.prototype.annotation) => string): string; /** * Writes node annotations to a string in the syle of BEAST. * Eg: [&Type=A,Cols={Red,Blue}] * @param {annotation} typeof Node.prototype.annotation * @returns {string} */ export declare function beastAnnotation(annotation: typeof Node.prototype.annotation): string; /** * Writes node annotations to a string in the syle of NHX. * Eg: [&&NHX:Type=A:Col=Red]. NHX does not appear to support * array date for annotations. Please get in touch if it does! * @param {annotation} typeof Node.prototype.annotation * @returns {string} */ export declare function nhxAnnotation(annotation: typeof Node.prototype.annotation): string;