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.
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.
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) –
the execution of function fails (If) –
scaling is still reverted (the) –
- 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 (dict of dicts) –
reset (bool, default False) –
each key in specs (For) –
value is a dictionnary whose (the) –
are column names for the corresponding dataframe in (keys) –
If there is no such column in the dataframe (datasets.) –
: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
Module contents¶
Utilities