tyssue.utils package#
Submodules#
tyssue.utils.decorators module#
tyssue.utils.testing module#
tyssue.utils.utils module#
- tyssue.utils.utils.ar_calculation(sheet, coords=['x', 'y'])[source]#
Calculates the aspect ratio of each face of the sheet
- Parameters
eptm (a
Sheet
object) –coords (list of str, optional, default ['x', 'y']) – the coordinates on which to compute the aspect ratio
- Returns
AR
- Return type
pandas series of aspect ratio for all faces.
Note
As is the case in ImageJ, the returned aspect ratio is always higher than 1
- tyssue.utils.utils.cell_centered_patch(eptm, cell, neighbour_order)[source]#
Return subsheet centered on cell with a distance of neighbour order around the cell
- Parameters
eptm (a
Epithelium
instance) –face (int, id of the center face) –
neighbour_order (int, number of neighbour around the center face) –
- Returns
patch
- Return type
an object of the same class as the input object
- tyssue.utils.utils.data_at_opposite(sheet, edge_data, free_value=None)[source]#
Returns a pd.DataFrame with the values of the input edge_data at the opposite edges. For free edges, optionaly replaces Nan values with free_value
- Parameters
sheet (a
Sheet
instance) –edge_data (dataframe contain value of edge) –
- Returns
opposite
- Return type
pandas series contain value of opposite edge
- tyssue.utils.utils.elem_centered_patch(eptm, elem_idx, neighbour_order, elem)[source]#
Return subeptm centered on the element (cell or face) with index elem_idx with neighbour_order neighbours around it.
- Parameters
eptm (a
Epithelim
instance) –index (int, id of the center element) –
neighbour_order (int,) – neighbourhood ‘degree’ around the center element
- Returns
patch
- Return type
an object with the same class as eptm
- tyssue.utils.utils.face_centered_patch(sheet, face, neighbour_order)[source]#
Return subsheet centered on face with a distance of neighbour order around the face
- Parameters
sheet (a
Sheet
object) –face (int, id of the center face) –
neighbour_order (int, number of neighbour around the center face) –
- Returns
patch
- Return type
an object of the same class as the input object
- tyssue.utils.utils.get_sub_eptm(eptm, edges, copy=False)[source]#
Define sub-epithelium corresponding to the edges.
- Parameters
eptm (a
Epithelium
instance) –edges (list of edges includes in the sub-epithelium) –
- Returns
sub_eptm
- Return type
a
Epithelium
instance
- tyssue.utils.utils.modify_segments(eptm, modifiers)[source]#
Modifies the datasets of a segmented epithelium according to the passed modifiers.
- Parameters
eptm (
tyssue.Epithelium
) –modifiers (nested dictionnary) –
Note
This functions assumes that the epithelium has a segment_index method as implemented in the
tyssue.Monolayer
.Example
>>> modifiers = { >>> 'apical' : { >>> 'edge': {'line_tension': 1.}, >>> 'face': {'prefered_area': 0.2}, >>> }, >>> 'basal' : { >>> 'edge': {'line_tension': 3.}, >>> 'face': {'prefered_area': 0.1}, >>> } >>> modify_segments(monolayer, modifiers) >>> monolayer.ver_df.loc[monolayer.apical_edges, >>> 'line_tension'].unique()[0] == 1. True
- tyssue.utils.utils.scaled_unscaled(func, scale, eptm, geom, args=(), kwargs={}, coords=None)[source]#
Scales the epithelium by an homotetic factor scale, applies the function func, and scales back to original size.
- Parameters
func (the function to apply to the scaled epithelium) –
scale (float, the scale to apply) –
eptm (a
Epithelium
instance) –geom (a
Geometry
class) –args (sequence, the arguments to pass to func) –
kwargs (dictionary, the keywords arguments) – to pass to func
coords (the coordinates on which the scaling applies) –
fails (If the execution of function) –
reverted (the scaling is still) –
- Returns
res
- Return type
the result of the function func
- tyssue.utils.utils.set_data_columns(datasets, specs, reset=False)[source]#
Sets the columns of the dataframes in the datasets dictionnary to the uniform values in the specs sub-dictionnaries.
- Parameters
datasets (dict of dataframes) –
specs (For each key in) –
reset (bool, default False) –
specs –
whose (the value is a dictionnary) –
in (keys are column names for the corresponding dataframe) –
dataframe (datasets. If there is no such column in the) –
:param : :param it is created. If the columns allready exists and reset is True: :param : :param the new value is used.:
- tyssue.utils.utils.single_cell(eptm, cell, copy=False)[source]#
Define epithelium instance for all element to a define cell.
- Parameters
eptm (a
Epithelium
instance) –cell (identifier of a cell) –
copy (bool, default False) –
- Returns
sub_etpm
- Return type
class:’Epithelium’ instance corresponding to the cell
tyssue.utils.widgets module#
Module contents#
Utilities