graph LR
Data_Management_Preprocessing["Data Management & Preprocessing"]
DeepSpot_Models["DeepSpot Models"]
Loss_Functions["Loss Functions"]
Image_Processing_Module["Image Processing Module"]
Core_Utilities["Core Utilities"]
Data_Management_Preprocessing -- "provides data to" --> DeepSpot_Models
DeepSpot_Models -- "uses" --> Loss_Functions
DeepSpot_Models -- "utilizes" --> Core_Utilities
Data_Management_Preprocessing -- "utilizes" --> Core_Utilities
Image_Processing_Module -- "utilizes" --> Data_Management_Preprocessing
Image_Processing_Module -- "provides predictions for" --> DeepSpot_Models
click Data_Management_Preprocessing href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/DeepSpot/Data Management & Preprocessing.md" "Details"
click DeepSpot_Models href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/DeepSpot/DeepSpot Models.md" "Details"
click Loss_Functions href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/DeepSpot/Loss Functions.md" "Details"
click Image_Processing_Module href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/DeepSpot/Image Processing Module.md" "Details"
click Core_Utilities href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/DeepSpot/Core Utilities.md" "Details"
The DeepSpot project is designed for spatial transcriptomics analysis, focusing on both cell and spot level predictions from image data. The main flow involves loading and preprocessing spatial transcriptomics data and image features, feeding this data into specialized neural network models (DeepCell and DeepSpot), training these models using various loss functions, and finally, using the trained models to predict spatial transcriptomics from new image inputs. Utility modules support data handling, image processing, and general system functionalities.
This component is responsible for loading, preprocessing, and batching both cell-specific and spot-specific spatial transcriptomics data and corresponding image features. It handles tasks such as spatial upsampling, smoothing, normalization, balancing indices, and computing neighbor contexts for the DeepSpot models.
Related Classes/Methods:
DeepSpot.deepspot.cell.dataloader.DeepCellDataLoader(22:208)DeepSpot.deepspot.cell.dataloader.DeepCellDataLoader:__init__(23:167)DeepSpot.deepspot.cell.dataloader.DeepCellDataLoader:__getitem__(180:208)DeepSpot.deepspot.cell.dataloader.DeepCellDataLoader:_load_patch(173:178)DeepSpot.deepspot.spot.dataloader.DeepSpotDataLoader(21:186)DeepSpot.deepspot.spot.dataloader.DeepSpotDataLoader:__init__(22:118)DeepSpot.deepspot.spot.dataloader.DeepSpotDataLoader:__getitem__(128:186)DeepSpot.deepspot.utils.utils_dataloader.load_data(136:178)DeepSpot.deepspot.utils.utils_dataloader.spatial_upsample_and_smooth(68:101)DeepSpot.deepspot.utils.utils_dataloader.get_balanced_index(20:26)DeepSpot.deepspot.utils.utils_dataloader.compute_neighbors(115:124)DeepSpot.deepspot.utils.utils_dataloader.add_zero_padding(104:112)DeepSpot.deepspot.utils.utils_dataloader.run_aestetik(40:65)DeepSpot.deepspot.utils.utils_dataloader.run_default(29:37)DeepSpot.deepspot.utils.utils_dataloader.load_multiple_pickles(127:128)DeepSpot.deepspot.utils.utils_dataloader.log1p_normalization(131:133)
This component encapsulates the core neural network architectures for both cell and spot prediction (DeepCell and DeepSpot models). It defines their structures, handles the forward passes for individual entities and their neighbors, and manages the training and validation lifecycles, including functionalities for visualizing training progress.
Related Classes/Methods:
DeepSpot.deepspot.cell.model.DeepCell(63:281)DeepSpot.deepspot.cell.model.DeepCell:__init__(64:128)DeepSpot.deepspot.cell.model.DeepCell:loop_step(144:162)DeepSpot.deepspot.cell.model.DeepCell:training_step(164:165)DeepSpot.deepspot.cell.model.DeepCell:validation_step(167:168)DeepSpot.deepspot.cell.model.DeepCell:_forward_cell(179:181)DeepSpot.deepspot.cell.model.DeepCell:_forward_cell_neighbors(183:188)DeepSpot.deepspot.cell.model.DeepCell:plot_loss(235:281)DeepSpot.deepspot.cell.model.Phi(36:46)DeepSpot.deepspot.cell.model.Rho(49:60)DeepSpot.deepspot.spot.model.DeepSpot(58:217)DeepSpot.deepspot.spot.model.DeepSpot:__init__(59:108)DeepSpot.deepspot.spot.model.DeepSpot:loop_step(128:146)DeepSpot.deepspot.spot.model.DeepSpot:training_step(148:149)DeepSpot.deepspot.spot.model.DeepSpot:validation_step(151:152)DeepSpot.deepspot.spot.model.DeepSpot:_forward_spot(163:165)DeepSpot.deepspot.spot.model.DeepSpot:_forward_spot_subspot(167:172)DeepSpot.deepspot.spot.model.DeepSpot:_forward_spot_neighbors(174:179)DeepSpot.deepspot.spot.model.DeepSpot:_forward_spot_subspot_neighbors(181:187)DeepSpot.deepspot.spot.model.Phi(31:41)DeepSpot.deepspot.spot.model.Rho(44:55)
This component provides a comprehensive suite of loss functions tailored for training both the DeepCell and DeepSpot models. These functions combine various metrics such as Mean Squared Error (MSE), Pearson correlation, L1, Huber, and Cosine similarity to accurately evaluate model predictions against ground truth.
Related Classes/Methods:
DeepSpot.deepspot.cell.loss:loss_mse_pearson_function(73:77)DeepSpot.deepspot.cell.loss:loss_mse_cosine_function(80:84)DeepSpot.deepspot.cell.loss:loss_l1_cosine_function(87:91)DeepSpot.deepspot.cell.loss:loss_huber_cosine_function(94:98)DeepSpot.deepspot.cell.loss.loss_cosine_function(4:6)DeepSpot.deepspot.cell.loss.loss_mse_function(40:42)DeepSpot.deepspot.cell.loss.loss_l1_function(45:48)DeepSpot.deepspot.cell.loss.loss_huber_function(51:63)DeepSpot.deepspot.spot.loss:loss_mse_pearson_function(31:35)DeepSpot.deepspot.spot.loss:loss_mse_cosine_function(38:42)DeepSpot.deepspot.spot.loss.loss_cosine_function(4:6)DeepSpot.deepspot.spot.loss.loss_mse_function(19:21)
This component provides utility functions specifically for image manipulation and processing, particularly for generating spatial transcriptomics predictions from raw image paths. It includes functionalities for obtaining morphology models, cropping and computing mini-tiles, and handling data format conversions necessary for model inference.
Related Classes/Methods:
DeepSpot.deepspot.utils.utils_image:get_morphology_model_and_preprocess(36:177)DeepSpot.deepspot.utils.utils_image:predict_spot_spatial_transcriptomics_from_image_path(241:292)DeepSpot.deepspot.utils.utils_image:predict_cell_spatial_transcriptomics_from_image_path(295:356)DeepSpot.deepspot.utils.utils_image.get_morphology_model_and_preprocess.MyModel(full file reference)DeepSpot.deepspot.utils.utils_image.crop_tile(190:198)DeepSpot.deepspot.utils.utils_image.compute_mini_tiles(201:234)DeepSpot.deepspot.utils.utils_image.detach_and_convert(237:238)
This component contains general-purpose helper functions that are not specific to data loading or image processing. Its primary responsibility is to provide common helper functionalities, such as fixing random seeds for reproducibility across the entire system.
Related Classes/Methods: