A treeshape is an unlabelled phylogenetic tree and as such can be labelled to produce a phylogenetic tree. This function takes a treeshape and a set of labels and generates (permutes) all possible labellings, i.e., all phylogenetic trees which a treeshape represents.
Note that the star tree always allows only a single labelling, whereas any more resolved treeshape will have multiple labellings.
Here treeshapes are encoded in the same pseudo-Newick format as the permute_treeshapes function, e.g.:
(((3),1),(1,(2)));
(Where each pair of parentheses represents an internal node, each number the number of tips, each comma separates sets of tips, and the semicolon denotes the root clade.)