scPhyloX.tools.utils
Functions
|
Draw a scatter plot of the two sets of data and show their correlation coefficients |
|
calculate Colless' index |
|
calculate corrected Colless' index |
|
Extract generation with given cell name |
|
Extract cell id with given cell name |
|
Reconstruct phylogenetic tree of simulation data |
Module Contents
- corr_plot(x, y, ax, stats='pearson', r0_x=None, r0_y=None, r1_x=None, r1_y=None, line='fit', alternative='two-sided', fontsize=10)
Draw a scatter plot of the two sets of data and show their correlation coefficients
- Args:
- x:
data1
- y:
data2
- ax:
axes to draw scatter on
- stats:
pearson or spearman
- r0_x, r0_y, r1_x, r1_y:
locations to label the correlation coefficient and the p-value
- line:
fit or diag, fit for linear regression
- alternative:
greater, less or two-sided
- fontsize:
fontsize
- Return:
matplotlib.axes
- colless_index(tree)
calculate Colless’ index
- Args:
- tree:
Phylogenetic tree
- Return:
- float:
Colless’ index
- colless_index_corrected(tree)
calculate corrected Colless’ index
- Args:
- tree:
Phylogenetic tree
- Return:
- float:
corrected Colless’ index
- ext_gen(cell)
Extract generation with given cell name
- ext_cid(cell)
Extract cell id with given cell name
- reconstruct(lineage_info, sel_cells, file_name=None)
Reconstruct phylogenetic tree of simulation data
- Args:
- lineage_info:
system.lineage_info
- sel_cells:
cells to build phylogenetic tree
- file_name:
path to save tree. if None, just return
- Return:
text newick tree