metrics.analysis.simulation module

class Simulation(simulation_file: str)[source]

Bases: object

Container for simulated tumor object data.

file

Path and file name for the simulation file.

path

Directory to the folder of simulation file.

key

File name without extension or seed.

seed

Seed of the simulation.

extension

Extension of the simulation file.

timepoints

Time point(s) (in days) in the simulation file.

max_radius

Maximum radius of the simulation.

static get_feature_list() List[metrics.feature.feature.Feature][source]

Return a list of valid Feature objects.

Returns

List of Feature objects.

static get_feature_object(feature_name: str) Union[metrics.feature.continuous_feature.ContinuousFeature, metrics.feature.discrete_feature.DiscreteFeature][source]

Return feature object valid for statistics calculation.

Parameters

feature_name – Name of feature.

Returns

Feature object.

static get_szudzik_pair(u: int, v: int) float[source]

Convert positions with positive or negative UV coordinates into a coordinate ID with signed Szudzik pairing function. A pairing function on a set associates each pair of numbers with a unique number through mathematical functions.

Parameters
  • u – U coordinate of the position.

  • v – V coordinate of the position.

Returns

The unique ID of the position coordinate.

load_simulation(suffix: str = '') dict[source]

Load simulation file into memory.

Parameters

suffix – Suffix of the file.

Returns

Loaded simulation file.

parse_config() None[source]

Parse out attributes from loaded simulation file.

parse_file() None[source]

Parse out attributes from file name.

parse_timepoint(timepoint: float) pandas.core.frame.DataFrame[source]

Parse data from simulation.

Parameters

timepoint – Time point to parse simulation.

Returns

Dataframe with simulation data.