pyXenium.gmi.ContourGmiConfig#

class ContourGmiConfig(contour_key='s1_s5_contours', contour_label_col='assigned_structure', positive_label='S1', negative_label='S5', contour_geojson=None, contour_pixel_size_um=0.2125, contour_id_key='name', feature_count=500, spatial_feature_count=100, min_cells_per_contour=20, min_library_size=1.0, min_feature_prevalence=0.05, layer=None, random_seed=1, coordinate_shuffle=False, exclude_coordinate_spatial_features=False, include_pathomics=False, inner_rim_um=20.0, outer_rim_um=30.0, rscript='Rscript', r_lib_path=None, install_gmi=True, force_reinstall_gmi=False, penalty='SCAD', lambda_min_ratio=0.02, n_lambda=100, eta=0.6, tune='EBIC', ebic_gamma=1.0, max_iter=50, spatial_cv_folds=0, bootstrap_repeats=0, bootstrap_fraction=0.8, run_label_permutation_control=False, run_coordinate_shuffle_control=False, run_spatial_feature_shuffle_control=False, run_within_label_heterogeneity=True, heterogeneity_min_contours=6, write_spatial_visualizations=True, visualization_genes=('NIBAN1', 'SORL1', 'CCND1'))#

Bases: object

Configuration for canonical contour-native GMI workflows.

Parameters:
  • contour_key (str)

  • contour_label_col (str)

  • positive_label (str)

  • negative_label (str)

  • contour_geojson (str | None)

  • contour_pixel_size_um (float)

  • contour_id_key (str)

  • feature_count (int)

  • spatial_feature_count (int)

  • min_cells_per_contour (int)

  • min_library_size (float)

  • min_feature_prevalence (float)

  • layer (str | None)

  • random_seed (int)

  • coordinate_shuffle (bool)

  • exclude_coordinate_spatial_features (bool)

  • include_pathomics (bool)

  • inner_rim_um (float)

  • outer_rim_um (float)

  • rscript (str)

  • r_lib_path (str | None)

  • install_gmi (bool)

  • force_reinstall_gmi (bool)

  • penalty (str)

  • lambda_min_ratio (float)

  • n_lambda (int)

  • eta (float)

  • tune (str)

  • ebic_gamma (float)

  • max_iter (int)

  • spatial_cv_folds (int)

  • bootstrap_repeats (int)

  • bootstrap_fraction (float)

  • run_label_permutation_control (bool)

  • run_coordinate_shuffle_control (bool)

  • run_spatial_feature_shuffle_control (bool)

  • run_within_label_heterogeneity (bool)

  • heterogeneity_min_contours (int)

  • write_spatial_visualizations (bool)

  • visualization_genes (tuple[str, ...])

__init__(contour_key='s1_s5_contours', contour_label_col='assigned_structure', positive_label='S1', negative_label='S5', contour_geojson=None, contour_pixel_size_um=0.2125, contour_id_key='name', feature_count=500, spatial_feature_count=100, min_cells_per_contour=20, min_library_size=1.0, min_feature_prevalence=0.05, layer=None, random_seed=1, coordinate_shuffle=False, exclude_coordinate_spatial_features=False, include_pathomics=False, inner_rim_um=20.0, outer_rim_um=30.0, rscript='Rscript', r_lib_path=None, install_gmi=True, force_reinstall_gmi=False, penalty='SCAD', lambda_min_ratio=0.02, n_lambda=100, eta=0.6, tune='EBIC', ebic_gamma=1.0, max_iter=50, spatial_cv_folds=0, bootstrap_repeats=0, bootstrap_fraction=0.8, run_label_permutation_control=False, run_coordinate_shuffle_control=False, run_spatial_feature_shuffle_control=False, run_within_label_heterogeneity=True, heterogeneity_min_contours=6, write_spatial_visualizations=True, visualization_genes=('NIBAN1', 'SORL1', 'CCND1'))#
Parameters:
  • contour_key (str)

  • contour_label_col (str)

  • positive_label (str)

  • negative_label (str)

  • contour_geojson (str | None)

  • contour_pixel_size_um (float)

  • contour_id_key (str)

  • feature_count (int)

  • spatial_feature_count (int)

  • min_cells_per_contour (int)

  • min_library_size (float)

  • min_feature_prevalence (float)

  • layer (str | None)

  • random_seed (int)

  • coordinate_shuffle (bool)

  • exclude_coordinate_spatial_features (bool)

  • include_pathomics (bool)

  • inner_rim_um (float)

  • outer_rim_um (float)

  • rscript (str)

  • r_lib_path (str | None)

  • install_gmi (bool)

  • force_reinstall_gmi (bool)

  • penalty (str)

  • lambda_min_ratio (float)

  • n_lambda (int)

  • eta (float)

  • tune (str)

  • ebic_gamma (float)

  • max_iter (int)

  • spatial_cv_folds (int)

  • bootstrap_repeats (int)

  • bootstrap_fraction (float)

  • run_label_permutation_control (bool)

  • run_coordinate_shuffle_control (bool)

  • run_spatial_feature_shuffle_control (bool)

  • run_within_label_heterogeneity (bool)

  • heterogeneity_min_contours (int)

  • write_spatial_visualizations (bool)

  • visualization_genes (tuple[str, ...])

Return type:

None

Methods

__init__([contour_key, contour_label_col, ...])

copy_with(**updates)

to_dict()

Attributes

contour_key: str = 's1_s5_contours'#
contour_label_col: str = 'assigned_structure'#
positive_label: str = 'S1'#
negative_label: str = 'S5'#
contour_geojson: str | None = None#
contour_pixel_size_um: float = 0.2125#
contour_id_key: str = 'name'#
feature_count: int = 500#
spatial_feature_count: int = 100#
min_cells_per_contour: int = 20#
min_library_size: float = 1.0#
min_feature_prevalence: float = 0.05#
layer: str | None = None#
random_seed: int = 1#
coordinate_shuffle: bool = False#
exclude_coordinate_spatial_features: bool = False#
include_pathomics: bool = False#
inner_rim_um: float = 20.0#
outer_rim_um: float = 30.0#
rscript: str = 'Rscript'#
r_lib_path: str | None = None#
install_gmi: bool = True#
force_reinstall_gmi: bool = False#
penalty: str = 'SCAD'#
lambda_min_ratio: float = 0.02#
n_lambda: int = 100#
eta: float = 0.6#
tune: str = 'EBIC'#
ebic_gamma: float = 1.0#
max_iter: int = 50#
spatial_cv_folds: int = 0#
bootstrap_repeats: int = 0#
bootstrap_fraction: float = 0.8#
run_label_permutation_control: bool = False#
run_coordinate_shuffle_control: bool = False#
run_spatial_feature_shuffle_control: bool = False#
run_within_label_heterogeneity: bool = True#
heterogeneity_min_contours: int = 6#
write_spatial_visualizations: bool = True#
visualization_genes: tuple[str, ...] = ('NIBAN1', 'SORL1', 'CCND1')#
to_dict()#
Return type:

dict[str, Any]

copy_with(**updates)#
Parameters:

updates (Any)

Return type:

ContourGmiConfig