dots_coords_calculations

pysmFISH.dots_coords_calculations.all_dots_removal(combination, all_removed)[source]

Function to remove the overlapping dots.

combination: dict
Dictionary containing hybridization, gene, registation data of the current hybridization and the registerd coords of the selected peaks for the current gene.
all_removed: dict
Dictionary with the coords of the dots that need to be removed or will be kept for all the images
all_coords_cleaned: set
Set containing the coords of the dots after removal of the overlapping ones. No image pos info is kept.
removed_coords: set
Set containing the coords of the dots removed. No image pos info is kept.
all_coords: set
Set containing the coords of all the aligned dots before removal of the overlapping ones. No image pos info is kept.
pysmFISH.dots_coords_calculations.catch_duplicated_dots(combination, image_list, overlapping_percentage, image_size, pxl)[source]

Function used to identify dots that need to be removed or kept in the overlapping region between two images. The overlapping used is calculated according to the stitching information.

combination: dict
Dictionary containing hybridization, gene, registation data of the current hybridization and the registerd coords of the selected peaks for the current gene.
image_list: tuple
Tuple with the index of the the images with ooverlap
overlapping_percentage: float
Percentage of overlap extracted from the Experimental_metadata.yaml.
image_size: int
Size of the image (consider a square image).
pxl: int
Radius of pixel used to create the nhood.
overlapping_result_dict: dict
Dictionary with the coords of the dots that need to be removed or will be kept for the selected pair of images.
pysmFISH.dots_coords_calculations.dots_removing(overlapping_list, pxl)[source]

Function used to identify matching dots that are present in overlapping imaging areas.

overlapping_list: list
List with the coords of the dots located in the overlapping region.
pxl: int
Radius of pixel used to create the nhood.
removed_dots: set
Set with the coords of the removed dots.
single_dots: set
Set with the coords of dots in the overlpping region that do not overlap with any other dot.
pysmFISH.dots_coords_calculations.function_to_run_dots_removal_parallel(combination, overlapping_percentage, image_size, pxl)[source]

Function to run the overlapping dots removal in parallel

combination: dict
Dictionary containing hybridization, gene, registation data of the current hybridization and the registerd coords of the selected peaks for the current gene.
overlapping_percentage: float
Percentage of overlap extracted from the Experimental_metadata.yaml
image_size: int
Size of the image (consider a square image)
plx: int
Radius of pixel used to create the nhood.
all_coords_cleaned_dict: dict
Dictionary with the dots coords of the processed gene before and after removal plus the coords of the removed dots.
pysmFISH.dots_coords_calculations.hood_creation(coords, pxl)[source]

Function that creates the neighborood of coords that are considered same RNA molecule. It is the region used to eliminate overlapping dots.

coords: np.array
Array of the [r,c] of the dots.
pxl: int
Radius of pixel used to create the nhood.
hood: set
Set with the coords of the neighborhood of the selected dot.
pysmFISH.dots_coords_calculations.overlapping_images_grid(micData)[source]

Function used to generate all possible overlapping images (neighborhood).

micData: dict
Dictionary extracted from the reg_data and containing the infomation regarding tiles organization
all_nhood: list
List with all the overlapping tiles combinations
pysmFISH.dots_coords_calculations.processing_combinations(hybridizations, aligned_peaks_dict)[source]

Function used to create a list of tuples containing the pair hybridization and gene (Ex. (Hybridization1, Gfap)) that will be used to process the dots removal in parallel.

hybridizations: list
List of the hybridization to process (ex. [Hybridization1, Hybridization2]).
aligned_peaks_dict: dict
Dictionary containing only the coords of the selected peaks after registration (still with pos information).
combinations: list
List containing the pairs hybridization and gene (Ex. (Hybridization1, Gfap))
pysmFISH.dots_coords_calculations.register_dots_coords(reg_data, hybridization, gene, all_raw_counts)[source]

Function to register the coords of the dots according to the new coords of the corner of the images calculated after registration of the stitched images.

reg_data: dict
Dictionary containing the coords and the joining data calculated after the registration.
hybridization: str
Name of the hybridization processed (Ex. Hybridization2)
gene: str
Processed gene name (Ex. Gfap)
all_raw_counts: dict
Dictionary with all the raw counting from all the hybridizations
all_raw_counts: dict
Dictionary with all the raw counting from all the hybridizations. Added a subgroup containing the aligned coords.