Borrowing Detection (phylogeny)¶
-
class
lingpy.compare.phylogeny.PhyBo(dataset, tree=None, paps='pap', ref='cogid', tree_calc='neighbor', output_dir=None, **keywords)¶ Basic class for calculations using the TreBor method.
Parameters: dataset : string
Name of the dataset that shall be analyzed.
tree : {None, string}
Name of the tree file.
paps : string (default=”pap”)
Name of the column that stores the specific cognate IDs consisting of an arbitrary integer key and a key for the concept.
ref : string (default=”cogid”)
Name of the column that stores the general cognate ids (the “reference” of the analysis).
tree_calc : {‘neighbor’,’upgma’} (default=’neighbor’)
Select the algorithm to be used for the tree calculation if no tree is passed with the file.
missing : int (default=-1)
Specify how missing data should be handled. If set to -1, missing data can account for both presence or absence of a cognate set in the given language. If set to 0, missing data is treated as absence.
degree : int (default=100)
The degree which is chosen for the projection of the tree layout.
Methods
analyze([runs, mixed, output_gml, tar, ...])Carry out a full analysis using various parameters. get_AVSD(glm, **keywords)Function retrieves all pap s for ancestor languages in a given tree. get_CVSD()Calculate the Contemporary Vocabulary Size Distribution (CVSD). get_GLS([mode, ratio, restriction, ...])Create gain-loss-scenarios for all non-singleton paps in the data. get_IVSD([output_gml, output_plot, tar, ...])Calculate VSD on the basis of each item. get_MLN(glm[, threshold, method])Compute an Minimal Lateral Network for a given model. get_MSN([glm, fileformat, external_edges, ...])Plot the Minimal Spatial Network. get_PDC(glm, **keywords)Calculate Patchily Distributed Cognates. get_edge(glm, nodeA, nodeB[, entries, msn])Return the edge data for a given gain-loss model. get_stats(glm[, subset, filename])Calculate basic statistics for a given gain-loss model. plot_MLN([glm, fileformat, threshold, ...])Plot the MLN with help of Matplotlib. plot_MSN([glm, fileformat, threshold, ...])Plot a minimal spatial network. plot_concept_evolution(glm[, concept, ...])Plot the evolution of specific concepts along the reference tree. plot_two_concepts(concept, cogA, cogB[, ...])Plot the evolution of two concepts in space. Inherited Methods
pickle([filename])Store the QLCParser instance in a pickle file. get_entries(entry)Return all entries matching the given entry-type as a two-dimensional list. add_entries(entry, source, function[, override])Add new entry-types to the word list by modifying given ones. calculate(data[, taxa, concepts, ref])Function calculates specific data. export(fileformat[, sections, entries, ...])Export the wordlist to specific fileformats. get_dict([col, row, entry])Function returns dictionaries of the cells matched by the indices. get_etymdict([ref, entry, modify_ref])Return an etymological dictionary representation of the word list. get_list([row, col, entry, flat])Function returns lists of rows and columns specified by their name. get_paps([ref, entry, missing, modify_ref])Function returns a list of present-absent-patterns of a given word list. output(fileformat, **keywords)Write wordlist to file. renumber(source[, target, override])Renumber a given set of string identifiers by replacing the ids by integers.




