group_cell_shapes#
Workflow for grouping cell shapes.
Working location structure:
(name)
├── analysis
│ ├── analysis.CELL_SHAPES_DATA
│ │ └── (name)_(key).CELL_SHAPES_DATA.csv
│ └── analysis.CELL_SHAPES_MODELS
│ └── (name)_(key).CELL_SHAPES_MODELS.pkl
├── data
│ └── data.LOCATIONS
│ └── (name)_(key)_(seed).LOCATIONS.tar.xz
└── groups
└── groups.CELL_SHAPES
├── (name).feature_components.csv
├── (name).feature_correlations.(key).(region).csv
├── (name).feature_correlations.(key).(mode).(property).(region).csv
├── (name).feature_distributions.(feature).json
├── (name).mode_correlations.csv
├── (name).population_counts.(time).csv
├── (name).population_stats.json
├── (name).shape_average.(key).(projection).json
├── (name).shape_contours.(key).(seed).(time).(region).(projection).json
├── (name).shape_errors.json
├── (name).shape_modes.(key).(region).(mode).(projection).json
├── (name).shape_samples.json
└── (name).variance_explained.csv
Different groups use inputs from data.LOCATIONS, analysis.CELL_SHAPES_DATA, and analysis.CELL_SHAPES_MODELS. Grouped data are saved to groups.CELL_SHAPES.
Different groups can be visualized using the corresponding plotting workflow or loaded into alternative tools.
Flows
Main group cell shapes flow. |
|
Group cell shapes subflow for feature components. |
|
Group cell shapes subflow for feature correlations. |
|
Group cell shapes subflow for feature distributions. |
|
Group cell shapes subflow for mode correlations. |
|
Group cell shapes subflow for population counts. |
|
Group cell shapes subflow for population stats. |
|
Group cell shapes subflow for shape average. |
|
Group cell shapes subflow for shape contours. |
|
Group cell shapes subflow for shape errors. |
|
Group cell shapes subflow for shape modes. |
|
Group cell shapes subflow for shape samples. |
|
Group cell shapes subflow for variance explained. |
- run_flow(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfig) None [source]#
Main group cell shapes flow.
Calls the following subflows, if the group is specified:
- run_flow_group_feature_components(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigFeatureComponents) None [source]#
Group cell shapes subflow for feature components.
- run_flow_group_feature_correlations(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigFeatureCorrelations) None [source]#
Group cell shapes subflow for feature correlations.
- run_flow_group_feature_distributions(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigFeatureDistributions) None [source]#
Group cell shapes subflow for feature distributions.
- run_flow_group_mode_correlations(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigModeCorrelations) None [source]#
Group cell shapes subflow for mode correlations.
- run_flow_group_population_counts(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigPopulationCounts) None [source]#
Group cell shapes subflow for population counts.
- run_flow_group_population_stats(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigPopulationStats) None [source]#
Group cell shapes subflow for population stats.
- run_flow_group_shape_average(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigShapeAverage) None [source]#
Group cell shapes subflow for shape average.
Find the cell closest to the average shape. Extract original mesh slice and extent projections. Created reconstructed mesh and extract mesh slice and extent projections.
- run_flow_group_shape_contours(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigShapeContours) None [source]#
Group cell shapes subflow for shape contours.
- run_flow_group_shape_errors(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigShapeErrors) None [source]#
Group cell shapes subflow for shape errors.
- run_flow_group_shape_modes(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigShapeModes) None [source]#
Group cell shapes subflow for shape modes.
Extract shape modes from PCAs as dictionaries of svg paths for each map point and projection. Consolidate shape modes from keys into single json.
- run_flow_group_shape_samples(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigShapeSamples) None [source]#
Group cell shapes subflow for shape samples.
Extract sample cell shapes from specified simulations. Construct wireframes from the cell shape mesh.
- run_flow_group_variance_explained(context: ContextConfig, series: SeriesConfig, parameters: ParametersConfigVarianceExplained) None [source]#
Group cell shapes subflow for variance explained.
Configs
Context configuration for group cell shapes flow. |
|
Parameter configuration for group cell shapes flow. |
|
Parameter configuration for group cell shapes subflow - feature components. |
|
Parameter configuration for group cell shapes subflow - feature correlations. |
|
Parameter configuration for group cell shapes subflow - feature distributions. |
|
Parameter configuration for group cell shapes subflow - mode correlations. |
|
Parameter configuration for group cell shapes subflow - population counts. |
|
Parameter configuration for group cell shapes subflow - population stats. |
|
Parameter configuration for group cell shapes subflow - shape average. |
|
Parameter configuration for group cell shapes subflow - shape contours. |
|
Parameter configuration for group cell shapes subflow - shape errors. |
|
Parameter configuration for group cell shapes subflow - shape modes. |
|
Parameter configuration for group cell shapes subflow - shape samples. |
|
Parameter configuration for group cell shapes subflow - variance explained. |
|
Series configuration for group cell shapes flow. |
- class ContextConfig[source]#
Context configuration for group cell shapes flow.
- working_location: str#
Location for input and output files (local path or S3 bucket).
- class ParametersConfig[source]#
Parameter configuration for group cell shapes flow.
- groups: list[str]#
List of cell shapes groups.
- feature_components: ParametersConfigFeatureComponents = ParametersConfigFeatureComponents(features=['volume', 'height', 'area', 'axis_major_length', 'axis_minor_length', 'eccentricity', 'orientation', 'perimeter', 'extent', 'solidity'], regions=['DEFAULT'], components=8, reference_metrics=None, reference_properties=None)#
Parameters for group feature components subflow.
- feature_correlations: ParametersConfigFeatureCorrelations = ParametersConfigFeatureCorrelations(properties=['volume', 'height', 'area', 'axis_major_length', 'axis_minor_length', 'eccentricity', 'perimeter'], regions=['DEFAULT'], components=8, include_bins=False, limits={'volume.DEFAULT': [500, 4000], 'volume.NUCLEUS': [0, 1500], 'height.DEFAULT': [0, 20], 'height.NUCLEUS': [0, 20], 'area.DEFAULT': [0, 1000], 'area.NUCLEUS': [0, 250], 'axis_major_length.DEFAULT': [0, 100], 'axis_major_length.NUCLEUS': [0, 50], 'axis_minor_length.DEFAULT': [0, 50], 'axis_minor_length.NUCLEUS': [0, 20], 'eccentricity.DEFAULT': [0, 1], 'eccentricity.NUCLEUS': [0, 1], 'perimeter.DEFAULT': [0, 250], 'perimeter.NUCLEUS': [0, 100], 'PC1': [-60, 60], 'PC2': [-50, 50], 'PC3': [-50, 50], 'PC4': [-50, 50], 'PC5': [-40, 40], 'PC6': [-40, 40], 'PC7': [-50, 50], 'PC8': [-50, 50]})#
Parameters for group feature correlations subflow.
- feature_distributions: ParametersConfigFeatureDistributions = ParametersConfigFeatureDistributions(reference_metrics=None, reference_properties=None, reference_coefficients=None, reference_model=None, properties=['volume', 'height'], regions=['DEFAULT'], components=8, bounds={'volume.DEFAULT': [0, 6000], 'volume.NUCLEUS': [0, 2000], 'height.DEFAULT': [0, 21], 'height.NUCLEUS': [0, 21], 'area.DEFAULT': [0, 2500], 'area.NUCLEUS': [0, 1000], 'perimeter.DEFAULT': [0, 2000], 'perimeter.NUCLEUS': [0, 700], 'axis_major_length.DEFAULT': [0, 300], 'axis_major_length.NUCLEUS': [0, 150], 'axis_minor_length.DEFAULT': [0, 150], 'axis_minor_length.NUCLEUS': [0, 100], 'eccentricity.DEFAULT': [0, 1], 'eccentricity.NUCLEUS': [0, 1], 'orientation.DEFAULT': [-2, 2], 'orientation.NUCLEUS': [-2, 2], 'extent.DEFAULT': [0, 1], 'extent.NUCLEUS': [0, 1], 'solidity.DEFAULT': [0, 1], 'solidity.NUCLEUS': [0, 1], 'PC1': [-50, 50], 'PC2': [-50, 50], 'PC3': [-50, 50], 'PC4': [-50, 50], 'PC5': [-50, 50], 'PC6': [-50, 50], 'PC7': [-50, 50], 'PC8': [-50, 50]}, bandwidth={'volume.DEFAULT': 100, 'volume.NUCLEUS': 50, 'height.DEFAULT': 1, 'height.NUCLEUS': 1, 'area.DEFAULT': 50, 'area.NUCLEUS': 10, 'perimeter.DEFAULT': 50, 'perimeter.NUCLEUS': 10, 'axis_major_length.DEFAULT': 10, 'axis_major_length.NUCLEUS': 5, 'axis_minor_length.DEFAULT': 5, 'axis_minor_length.NUCLEUS': 2, 'eccentricity.DEFAULT': 0.01, 'eccentricity.NUCLEUS': 0.01, 'orientation.DEFAULT': 0.05, 'orientation.NUCLEUS': 0.05, 'extent.DEFAULT': 0.01, 'extent.NUCLEUS': 0.01, 'solidity.DEFAULT': 0.01, 'solidity.NUCLEUS': 0.01, 'PC1': 5, 'PC2': 5, 'PC3': 5, 'PC4': 5, 'PC5': 5, 'PC6': 5, 'PC7': 5, 'PC8': 5})#
Parameters for group feature distributions subflow.
- mode_correlations: ParametersConfigModeCorrelations = ParametersConfigModeCorrelations(reference_model=None, reference_data=None, regions=['DEFAULT'], components=8)#
Parameters for group mode correlations subflow.
- population_counts: ParametersConfigPopulationCounts = ParametersConfigPopulationCounts(regions=['DEFAULT'], seeds=[0], time=0)#
Parameters for group population counts subflow.
- population_stats: ParametersConfigPopulationStats = ParametersConfigPopulationStats(regions=['DEFAULT'])#
Parameters for group population stats subflow.
- shape_average: ParametersConfigShapeAverage = ParametersConfigShapeAverage(regions=['DEFAULT'], components=8, order=16, scale=1, projections=['top', 'side1', 'side2'])#
Parameters for group shape average subflow.
- shape_contours: ParametersConfigShapeContours = ParametersConfigShapeContours(regions=['DEFAULT'], seed=0, time=0, ds=None, dt=None, projection='top', box=(1, 1, 1), slice_index=None)#
Parameters for group shape contours subflow.
- shape_errors: ParametersConfigShapeErrors = ParametersConfigShapeErrors(regions=['DEFAULT'])#
Parameters for group shape errors subflow.
- shape_modes: ParametersConfigShapeModes = ParametersConfigShapeModes(regions=['DEFAULT'], components=8, order=16, delta=0.5, projections=['top', 'side1', 'side2'])#
Parameters for group shape modes subflow.
- shape_samples: ParametersConfigShapeSamples = ParametersConfigShapeSamples(regions=['DEFAULT'], seed=0, tick=0, indices=[0])#
Parameters for group shape samples subflow.
- variance_explained: ParametersConfigVarianceExplained = ParametersConfigVarianceExplained(regions=['DEFAULT'], components=8)#
Parameters for group variance explained subflow.
- class ParametersConfigFeatureComponents[source]#
Parameter configuration for group cell shapes subflow - feature components.
- features: list[str]#
List of shape features.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components.
- reference_metrics: str | None = None#
Full key for reference metrics data.
- reference_properties: str | None = None#
Full key for reference properties data.
- class ParametersConfigFeatureCorrelations[source]#
Parameter configuration for group cell shapes subflow - feature correlations.
- properties: list[str]#
List of shape properties.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components (i.e. shape modes).
- include_bins: bool = False#
True if correlations are binned, False otherwise
- limits: dict[str, list]#
Limits for scaling feature correlations bins.
- class ParametersConfigFeatureDistributions[source]#
Parameter configuration for group cell shapes subflow - feature distributions.
- reference_metrics: str | None = None#
Full key for reference metrics data.
- reference_properties: str | None = None#
Full key for reference properties data.
- reference_coefficients: str | None = None#
Full key for reference coefficients data.
- reference_model: str | None = None#
Full key for reference PCA model.
- properties: list[str]#
List of shape properties.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components (i.e. shape modes).
- bounds: dict[str, list]#
Bounds for feature distributions.
- bandwidth: dict[str, float]#
Bandwidths for feature distributions.
- class ParametersConfigModeCorrelations[source]#
Parameter configuration for group cell shapes subflow - mode correlations.
- reference_model: str | None = None#
Full key for reference PCA model.
- reference_data: str | None = None#
Full key for reference coefficients data.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components (i.e. shape modes).
- class ParametersConfigPopulationCounts[source]#
Parameter configuration for group cell shapes subflow - population counts.
- regions: list[str]#
List of subcellular regions.
- seeds: list[int]#
Simulation seed(s) to use for grouping population counts.
- time: int = 0#
Simulation time (in hours) to use for grouping population counts.
- class ParametersConfigPopulationStats[source]#
Parameter configuration for group cell shapes subflow - population stats.
- regions: list[str]#
List of subcellular regions.
- class ParametersConfigShapeAverage[source]#
Parameter configuration for group cell shapes subflow - shape average.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components (i.e. shape modes).
- order: int = 16#
Order of the spherical harmonics coefficient parametrization.
- scale: float = 1#
Scaling for spherical harmonics reconstruction mesh.
- projections: list[str]#
List of shape projections.
- class ParametersConfigShapeContours[source]#
Parameter configuration for group cell shapes subflow - shape contours.
- regions: list[Optional[str]]#
List of subcellular regions.
- seed: int = 0#
Simulation random seed to use for grouping shape contours.
- time: int = 0#
Simulation time (in hours) to use for grouping shape contours.
- ds: float | None = None#
Spatial scaling in units/um.
- dt: float | None = None#
Temporal scaling in hours/tick.
- projection: str = 'top'#
Selected shape projection.
- box: tuple[int, int, int]#
Size of projection bounding box.
- slice_index: int | None = None#
Slice index along the shape projection axis.
- class ParametersConfigShapeErrors[source]#
Parameter configuration for group cell shapes subflow - shape errors.
- regions: list[str]#
List of subcellular regions.
- class ParametersConfigShapeModes[source]#
Parameter configuration for group cell shapes subflow - shape modes.
- regions: list[str]#
List of subcellular regions.
- components: int = 8#
Number of principal components (i.e. shape modes).
- order: int = 16#
Order of the spherical harmonics coefficient parametrization.
- delta: float = 0.5#
Increment for shape mode map points.
- projections: list[str]#
List of shape projections.
- class ParametersConfigShapeSamples[source]#
Parameter configuration for group cell shapes subflow - shape samples.
- regions: list[str]#
List of subcellular regions.
- seed: int = 0#
Simulation random seed to use for grouping shape samples.
- tick: int = 0#
Simulation tick to use for grouping shape samples.
- indices: list[int]#
Cell indices for shape samples.