Upgraded qc module - #297
Conversation
Review notes and proposed refactor:
|
Current (qc/__init__.py) |
Proposed home |
|---|---|
qc_segmentation's scalar metrics (assigned-transcript %, mean cell area, transcripts/genes per cell) |
DatasetCollection.calc_qc_metrics() — writes columns to self.obs, one row per dataset |
gene_specific_metrics_df |
DatasetCollection — new mod["qc_by_gene"] modality, mirroring how calc_signature builds a dataset×gene modality |
New ROI-level QC (xenium_qc_ROI) |
NeighborhoodCollection.calc_qc_metrics() (or similar), reusing calc_transcript_assignment/calc_population instead of a bespoke sjoin |
classify_cells, orthogonal_expression_calc |
DatasetCollection — a cross-row comparison method, since it's inherently about comparing multiple segmentation runs |
_process_xenium_technology / _process_merscope_technology / _process_custom_technology |
Become private per-row loaders called internally by the calc_* methods above |
One real prerequisite: DatasetCollection doesn't currently have a data_dir/technology concept per row the way NeighborhoodCollection does — that'd need to be added before calc_qc_metrics() could load raw files itself. Not a blocker, just the first piece of plumbing.
Looking forward to discussing.
Additional Ideas
- Similarly to breaking down the unassigned transcript proportion into neighborhoods - we can break it down per gene and save this in the DatasetCollection under the gene obs
- we can potentially calculate local proportion of unassigned transcripts per cell and then bin by cluster. This would also be useful for understanding the relative proximity of cells.
No description provided.