spateo.external.CAST.utils¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Select cells by drawing a polygon on the plot. |
|
|
|
coords_tgt: coordinates of niche centroids (target cells). |
|
coords_tgt: coordinates of niche centroids (target cells). |
|
|
|
Module Contents¶
- spateo.external.CAST.utils.coords2adjacentmat(coords, output_mode='adjacent', strategy_t='convex')[source]¶
- spateo.external.CAST.utils.detect_highly_variable_genes(sdata, batch_key='batch', n_top_genes=4000, count_layer='count')[source]¶
- spateo.external.CAST.utils.extract_coords_exp(sdata, batch_key='batch', cols='spatial', count_layer='count', data_format='norm1e4', ifcombat=False, if_inte=False)[source]¶
- spateo.external.CAST.utils.Harmony_integration(sdata_inte, scaled_layer, use_highly_variable_t, batch_key, umap_n_neighbors, umap_n_pcs, min_dist, spread_t, source_sample_ctype_col, output_path, n_components=50, ifplot=True, ifcombat=False)[source]¶
- spateo.external.CAST.utils.sub_data_extract(sample_list, coords_raw, exps, nodenum_t=20000, if_non_zero_center_scale=True)[source]¶
- spateo.external.CAST.utils.preprocess_fast(sdata1, mode='customized', target_sum=10000.0, base=2, zero_center=True, regressout=False)[source]¶
- spateo.external.CAST.utils.cell_select(coords_t, s=0.5, c=None, output_path_t=None)[source]¶
Select cells by drawing a polygon on the plot. Click the “Finish Polygon” button to finish drawing the polygon. Click the “Clear Polygon” button to clear the polygon.
- spateo.external.CAST.utils.get_neighborhood_rad(coords_centroids, coords_candidate, radius_px, dist=None)[source]¶
- spateo.external.CAST.utils.delta_cell_cal(coords_tgt, coords_ref, ctype_tgt, ctype_ref, radius_px)[source]¶
coords_tgt: coordinates of niche centroids (target cells). coords_ref: coordinates of reference cells. ctype_tgt: cell type of niche centroids. ctype_ref: cell type of reference cells. radius_px: radius of neighborhood.
Output: return: delta_cell_tgt, delta_cell_ref, delta_cell.
e.g. coords_tgt = coords_final[‘injured’] coords_ref = coords_final[‘normal’] ctype_tgt = sdata.obs[‘Annotation’][right_idx] ctype_ref = sdata.obs[‘Annotation’][left_idx] radius_px = 1000 df_delta_cell_tgt,df_delta_cell_ref,df_delta_cell = delta_cell(coords_tgt,coords_ref,ctype_tgt,ctype_ref,radius_px)
- spateo.external.CAST.utils.delta_exp_cal(coords_tgt, coords_ref, exp_tgt, exp_ref, radius_px, valid_tgt_idx=None, valid_ref_idx=None)[source]¶
coords_tgt: coordinates of niche centroids (target cells). coords_ref: coordinates of reference cells. exp_tgt: gene expression of target cells. exp_ref: gene expression of reference cells. radius_px: radius of neighborhood.
Output: return: delta_exp_tgt, delta_exp_ref, delta_exp.
e.g.