Expression patterns
- simtissue.control_expression.create_fix_profile(dict_profile={'typeA': [120, 0], 'typeB': [0, 10]}, cell_type_distribution={'typeA': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108], 'typeB': [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109]})
Associate each cell index to a fixed RNA profile
- Parameters:
dict_profile (dict) – dictionary defining the RNA profile of each cell type e.g. {‘typeA’: [120, 0], ‘typeB’: [0, 10]}
cell_type_distribution (dict) – dictionary of the cell type distribution e.g. {‘typeA’: list(range(0, 110, 2)), ‘typeB’: list(range(1, 110, 2))}
- Returns:
dict_cell_type_label_rna - {cell_type : {cell_id : expression vector}
dico_cell_index - {cell_id : {type: cell_type, rnaseq : expression vector}}
- simtissue.control_expression.simulate_arbritrary_expression(dict_profile: dict, cell_type_distribution: dict, mask_cyto: ndarray, genes_list_to_simulate: list, image_name: str = 'img0')
- This function simulate the expression of a list of genes in a mask of cytoplasm.
The rna position are sample from a uniform spatial distribution in the cytoplasm.
- Parameters:
dict_profile (dict) – dictionary of the expression profile of each cell type e.g. {‘typeA’: [120, 0], ‘typeB’: [0, 10]}
cell_type_distribution (dict) – dictionary of the cell type distribution e.g. {‘typeA’: list(range(0, 110, 2)), ‘typeB’: list(range(1, 110, 2))}
mask_cyto (np.ndarray) – cytoplasm mask
genes_list_to_simulate – list of genes to simulate e.g. [‘gene1’, ‘gene2’]
image_name – name of the image to add in annData
- Returns:
anndata object with the simulated expression profile and coordinates
- Rtype anndata:
anndata object
- simtissue.control_expression.filter_simulation(spots_position: list, max_dist: float = 3, dict_scale: dict = {'x': 1, 'y': 1, 'z': 1})
This function Merge overlapping spots as a single spot
- Parameters:
spots_position (list) – list of spots position
max_dist (int) – max distance between spots to merge in the scale of dict_scale
dict_scale
- Returns:
list of spots position with merged spots
- simtissue.control_expression.sim_spots_from_ref_anndata(ref_anndata, cell_mask, selected_gene, image_name='', annotation_column='cell_ID', remove_neighbors=True, max_dist=0.3, dict_scale={'x': 0.103, 'y': 0.103, 'z': 0.3}, random_indice: list = None, scaling_factor=3)
This function simulate the expression of a list of genes in a mask of cytoplasm. It sample each RNA profile from a reference anndata object. The RNA molecule are then sampled from a uniform spatial distribution in each cell
- Parameters:
ref_anndata (anndata object) – andata object with the reference expression profile to sample
cell_mask (np.ndarray) – cell mask
selected_gene (list) – list of genes to simulate e.g. [‘gene1’, ‘gene2’] from the reference anndata
image_name (str) – name of the image to add in annData
annotation_column (str) – column name of the cell type in the reference anndata
remove_neighbors (bool) – if True remove the RNA molecules that are too close
max_dist (int) – max distance between spots to merge if remove_neighbors is True
dict_scale (dict) – scale of the image in z,y,x in µm
random_indice (list) – if not None, list of cell index to sample from the reference anndata
- Returns: