Skip to content

Builder paradigm for constructing CellArrDataset#60

Draft
jkanche wants to merge 34 commits into
masterfrom
builder-paradigm
Draft

Builder paradigm for constructing CellArrDataset#60
jkanche wants to merge 34 commits into
masterfrom
builder-paradigm

Conversation

@jkanche

@jkanche jkanche commented Nov 27, 2024

Copy link
Copy Markdown
Member

For simple builds,

Simple usage

builder = CellArrDatasetBuilder("path/to/output")
builder.add_data(adata1, "sample1")
builder.add_data(adata2, "sample2")
dataset = builder.build()

With more options

config = BuilderConfig(
    output_path="path/to/output",
    matrix_name="normalized_counts",
    matrix_dtype=np.float32,
    num_threads=4
)

builder = CellArrDatasetBuilder(config)

Add data with metadata

builder.add_data(
    adata1, 
    "sample1",
    sample_metadata={
        "condition": "treatment",
        "batch": "1"
    },
    cell_metadata=cell_meta_df1
)

Set gene metadata

builder.set_gene_metadata(gene_annotations_df)

Build the dataset

dataset = builder.build()

jkanche and others added 30 commits November 21, 2024 18:05
…uerying; updating tests and documentation as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant