@@ -90,8 +90,11 @@ def load(
90
90
>>> import pertpy as pt
91
91
>>> haber_cells = pt.dt.haber_2017_regions()
92
92
>>> sccoda = pt.tl.Sccoda()
93
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
94
- sample_identifier="batch", covariate_obs=["condition"])
93
+ >>> mdata = sccoda.load(haber_cells,
94
+ >>> type="cell_level",
95
+ >>> generate_sample_level=True,
96
+ >>> cell_type_identifier="cell_label",
97
+ >>> sample_identifier="batch", covariate_obs=["condition"])
95
98
"""
96
99
if type == "cell_level" :
97
100
if generate_sample_level :
@@ -144,8 +147,12 @@ def prepare(
144
147
>>> import pertpy as pt
145
148
>>> haber_cells = pt.dt.haber_2017_regions()
146
149
>>> sccoda = pt.tl.Sccoda()
147
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
148
- sample_identifier="batch", covariate_obs=["condition"])
150
+ >>> mdata = sccoda.load(haber_cells,
151
+ >>> type="cell_level",
152
+ >>> generate_sample_level=True,
153
+ >>> cell_type_identifier="cell_label",
154
+ >>> sample_identifier="batch",
155
+ >>> covariate_obs=["condition"])
149
156
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
150
157
"""
151
158
if isinstance (data , MuData ):
@@ -193,10 +200,14 @@ def set_init_mcmc_states(self, rng_key: None, ref_index: np.ndarray, sample_adat
193
200
>>> import pertpy as pt
194
201
>>> haber_cells = pt.dt.haber_2017_regions()
195
202
>>> sccoda = pt.tl.Sccoda()
196
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
197
- sample_identifier="batch", covariate_obs=["condition"])
203
+ >>> mdata = sccoda.load(haber_cells,
204
+ >>> type="cell_level",
205
+ >>> generate_sample_level=True,
206
+ >>> cell_type_identifier="cell_label",
207
+ >>> sample_identifier="batch",
208
+ >>> covariate_obs=["condition"])
198
209
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
199
- >>> adata = sccoda.set_init_mcmc_states(rng_key=42, ref_index=0, sample_adata=mdata[' coda' ])
210
+ >>> adata = sccoda.set_init_mcmc_states(rng_key=42, ref_index=0, sample_adata=mdata[" coda" ])
200
211
"""
201
212
# data dimensions
202
213
N , D = sample_adata .obsm ["covariate_matrix" ].shape
@@ -312,8 +323,12 @@ def make_arviz( # type: ignore
312
323
>>> import pertpy as pt
313
324
>>> haber_cells = pt.dt.haber_2017_regions()
314
325
>>> sccoda = pt.tl.Sccoda()
315
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
316
- sample_identifier="batch", covariate_obs=["condition"])
326
+ >>> mdata = sccoda.load(haber_cells,
327
+ >>> type="cell_level",
328
+ >>> generate_sample_level=True,
329
+ >>> cell_type_identifier="cell_label",
330
+ >>> sample_identifier="batch",
331
+ >>> covariate_obs=["condition"])
317
332
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
318
333
>>> sccoda.run_nuts(mdata, num_warmup=100, num_samples=1000, rng_key=42)
319
334
>>> arviz_data = sccoda.make_arviz(mdata, num_prior_samples=100)
@@ -414,8 +429,12 @@ def run_nuts(
414
429
>>> import pertpy as pt
415
430
>>> haber_cells = pt.dt.haber_2017_regions()
416
431
>>> sccoda = pt.tl.Sccoda()
417
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
418
- sample_identifier="batch", covariate_obs=["condition"])
432
+ >>> mdata = sccoda.load(haber_cells,
433
+ >>> type="cell_level",
434
+ >>> generate_sample_level=True,
435
+ >>> cell_type_identifier="cell_label",
436
+ >>> sample_identifier="batch",
437
+ >>> covariate_obs=["condition"])
419
438
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
420
439
>>> sccoda.run_nuts(mdata, num_warmup=100, num_samples=1000, rng_key=42)
421
440
"""
@@ -429,8 +448,12 @@ def credible_effects(self, data: AnnData | MuData, modality_key: str = "coda", e
429
448
>>> import pertpy as pt
430
449
>>> haber_cells = pt.dt.haber_2017_regions()
431
450
>>> sccoda = pt.tl.Sccoda()
432
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
433
- sample_identifier="batch", covariate_obs=["condition"])
451
+ >>> mdata = sccoda.load(haber_cells,
452
+ >>> type="cell_level",
453
+ >>> generate_sample_level=True,
454
+ >>> cell_type_identifier="cell_label",
455
+ >>> sample_identifier="batch",
456
+ >>> covariate_obs=["condition"])
434
457
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
435
458
>>> sccoda.run_nuts(mdata, num_warmup=100, num_samples=1000, rng_key=42)
436
459
>>> credible_effects = sccoda.credible_effects(mdata)
@@ -445,8 +468,12 @@ def summary(self, data: AnnData | MuData, extended: bool = False, modality_key:
445
468
>>> import pertpy as pt
446
469
>>> haber_cells = pt.dt.haber_2017_regions()
447
470
>>> sccoda = pt.tl.Sccoda()
448
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
449
- sample_identifier="batch", covariate_obs=["condition"])
471
+ >>> mdata = sccoda.load(haber_cells,
472
+ >>> type="cell_level",
473
+ >>> generate_sample_level=True,
474
+ >>> cell_type_identifier="cell_label",
475
+ >>> sample_identifier="batch",
476
+ >>> covariate_obs=["condition"])
450
477
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
451
478
>>> sccoda.run_nuts(mdata, num_warmup=100, num_samples=1000, rng_key=42)
452
479
>>> sccoda.summary(mdata)
@@ -461,8 +488,12 @@ def set_fdr(self, data: AnnData | MuData, est_fdr: float, modality_key: str = "c
461
488
>>> import pertpy as pt
462
489
>>> haber_cells = pt.dt.haber_2017_regions()
463
490
>>> sccoda = pt.tl.Sccoda()
464
- >>> mdata = sccoda.load(haber_cells, type="cell_level", generate_sample_level=True, cell_type_identifier="cell_label", \
465
- sample_identifier="batch", covariate_obs=["condition"])
491
+ >>> mdata = sccoda.load(haber_cells,
492
+ >>> type="cell_level",
493
+ >>> generate_sample_level=True,
494
+ >>> cell_type_identifier="cell_label",
495
+ >>> sample_identifier="batch",
496
+ >>> covariate_obs=["condition"])
466
497
>>> mdata = sccoda.prepare(mdata, formula="condition", reference_cell_type="Endocrine")
467
498
>>> sccoda.run_nuts(mdata, num_warmup=100, num_samples=1000, rng_key=42)
468
499
>>> sccoda.set_fdr(mdata, est_fdr=0.4)
0 commit comments