scPhyloX.tools
Submodules
Attributes
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 |
|
Calculate tumor cell number with given width, height and scale |
|
Calculate LP distance with given mutation character matrix |
|
Calculate LR distance with given mutation character matrix |
|
calculate LR distance for SMALT-fly dataset |
|
calculate LP distance for SMALT-fly dataset |
|
Package 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
- population_size
- cell_number_calc(w, l, r, coef=100000000.0)
Calculate tumor cell number with given width, height and scale
- Args:
- w:
width
- l:
heigth
- r:
scale
- coef:
cell density
- Return:
- float:
cell number
- tumor_data
- tumor_size
- get_branchlen(seqtab: numpy.ndarray = None, sys=None)
Calculate LP distance with given mutation character matrix
- Args:
- seqtab:
mutation character matrix
- sys:
Gillespie simulator with results
- Return:
- np.array:
LP distance
- get_mutnum(seqtab=None, sys=None, filter_trunk=True)
Calculate LR distance with given mutation character matrix
- Args:
- seqtab:
mutation character matrix
- sys:
Gillespie simulator with results
- filter_trunk:
Filter trunk mutations
- Return:
- np.array:
LR distance
- mutnum_fly(seqs, ref)
calculate LR distance for SMALT-fly dataset
- Args:
- seqs:
DNA muataion character matrix
- ref:
reference seuence
- Return:
- np.array:
LR distance
- branchlen_fly(seqs, ref, rs=1)
calculate LP distance for SMALT-fly dataset
- Args:
- seqs:
DNA muataion character matrix
- ref:
reference seuence
- rs:
resampling ratio
- Return:
- np.array:
LP distance
- polar_plot(tree, ax=None, arc=350, start=0, root_distance=0.1, label_leaf=True, patch_leaf=True, wedge=True, pad_label=0, pad_patch=0, pad_wedge=0, externals=[], lw=1)