MVP Specification for Splitting AnnData Based on Cell IDs from a CAS JSON File
Objective
To create a function that splits an AnnData object into multiple subsets based on cell IDs provided in a CAS JSON file. The resulting subsets should retain the integrity of the original data structure, including all relevant annotations.
Requirements
Input Data:
An AnnData object containing single-cell RNA sequencing data.
A CAS JSON file containing the cell IDs for each subset in its annotations field.
Output:
Multiple AnnData objects, each corresponding to a set of cell IDs specified in the CAS JSON file.
MVP Specification for Splitting
AnnData
Based on Cell IDs from a CAS JSON FileObjective
To create a function that splits an
AnnData
object into multiple subsets based on cell IDs provided in a CAS JSON file. The resulting subsets should retain the integrity of the original data structure, including all relevant annotations.Requirements
Input Data:
AnnData
object containing single-cell RNA sequencing data.annotations
field.Output:
AnnData
objects, each corresponding to a set of cell IDs specified in the CAS JSON file.JSON File Structure
The CAS JSON file should follow this structure:
Function Specification
split_anndata
adata
: The inputAnnData
object.json_file
: Path to the CAS JSON file containing cell ID annotations.AnnData
files.Steps
AnnData
object.cell_label
andcell_ids
.AnnData
object to include only the cells listed incell_ids
.AnnData
object for the subset.AnnData
objects to files