pertpy 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pertpy/__init__.py +1 -1
- pertpy/data/_dataloader.py +2 -2
- pertpy/data/_datasets.py +62 -62
- pertpy/metadata/_cell_line.py +9 -3
- pertpy/metadata/_drug.py +4 -2
- pertpy/preprocessing/_guide_rna.py +17 -10
- pertpy/preprocessing/_guide_rna_mixture.py +9 -3
- pertpy/tools/__init__.py +12 -2
- pertpy/tools/_augur.py +37 -14
- pertpy/tools/_coda/_sccoda.py +68 -101
- pertpy/tools/_coda/_tasccoda.py +103 -85
- pertpy/tools/_mixscape.py +48 -39
- pertpy/tools/_perturbation_space/_comparison.py +3 -3
- pertpy/tools/_perturbation_space/_discriminator_classifiers.py +261 -353
- pertpy/tools/_perturbation_space/_perturbation_space.py +22 -14
- pertpy/tools/_perturbation_space/_simple.py +12 -6
- pertpy/tools/_scgen/_scgenvae.py +2 -1
- pertpy/tools/core.py +18 -0
- {pertpy-1.0.1.dist-info → pertpy-1.0.3.dist-info}/METADATA +14 -2
- {pertpy-1.0.1.dist-info → pertpy-1.0.3.dist-info}/RECORD +22 -21
- {pertpy-1.0.1.dist-info → pertpy-1.0.3.dist-info}/WHEEL +0 -0
- {pertpy-1.0.1.dist-info → pertpy-1.0.3.dist-info}/licenses/LICENSE +0 -0
pertpy/__init__.py
CHANGED
pertpy/data/_dataloader.py
CHANGED
@@ -17,7 +17,7 @@ def _download( # pragma: no cover
|
|
17
17
|
url: str,
|
18
18
|
output_file_name: str | None = None,
|
19
19
|
output_path: str | Path | None = None,
|
20
|
-
block_size: int =
|
20
|
+
block_size: int = 8192,
|
21
21
|
overwrite: bool = False,
|
22
22
|
is_zip: bool = False,
|
23
23
|
timeout: int = 30,
|
@@ -74,7 +74,7 @@ def _download( # pragma: no cover
|
|
74
74
|
response.raise_for_status()
|
75
75
|
total = int(response.headers.get("content-length", 0))
|
76
76
|
|
77
|
-
with Progress(refresh_per_second=
|
77
|
+
with Progress(refresh_per_second=3) as progress:
|
78
78
|
task = progress.add_task("[red]Downloading...", total=total)
|
79
79
|
with Path(temp_file_name).open("wb") as file:
|
80
80
|
for data in response.iter_content(block_size):
|
pertpy/data/_datasets.py
CHANGED
@@ -43,7 +43,7 @@ def papalexi_2021() -> MuData: # pragma: no cover
|
|
43
43
|
output_file_path = settings.datasetdir / output_file_name
|
44
44
|
if not Path(output_file_path).exists():
|
45
45
|
_download(
|
46
|
-
url="https://
|
46
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/papalexi_2021.h5mu",
|
47
47
|
output_file_name=output_file_name,
|
48
48
|
output_path=settings.datasetdir,
|
49
49
|
is_zip=False,
|
@@ -68,7 +68,7 @@ def sc_sim_augur() -> AnnData: # pragma: no cover
|
|
68
68
|
output_file_path = settings.datasetdir / output_file_name
|
69
69
|
if not Path(output_file_path).exists():
|
70
70
|
_download(
|
71
|
-
url="https://
|
71
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/sc_sim_augur.h5ad",
|
72
72
|
output_file_name=output_file_name,
|
73
73
|
output_path=settings.datasetdir,
|
74
74
|
is_zip=False,
|
@@ -98,7 +98,7 @@ def bhattacherjee() -> AnnData: # pragma: no cover
|
|
98
98
|
output_file_path = settings.datasetdir / output_file_name
|
99
99
|
if not Path(output_file_path).exists():
|
100
100
|
_download(
|
101
|
-
url="https://
|
101
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/bhattacher_rna.h5ad",
|
102
102
|
output_file_name=output_file_name,
|
103
103
|
output_path=settings.datasetdir,
|
104
104
|
is_zip=False,
|
@@ -123,7 +123,7 @@ def sciplex3_raw() -> AnnData: # pragma: no cover
|
|
123
123
|
output_file_path = settings.datasetdir / output_file_name
|
124
124
|
if not Path(output_file_path).exists():
|
125
125
|
_download(
|
126
|
-
url="https://
|
126
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/sciplex3.h5ad",
|
127
127
|
output_file_name=output_file_name,
|
128
128
|
output_path=settings.datasetdir,
|
129
129
|
is_zip=False,
|
@@ -141,7 +141,7 @@ def tasccoda_example() -> AnnData: # pragma: no cover
|
|
141
141
|
The full dataset containing the actual count data can be obtained via smillie_2019().
|
142
142
|
|
143
143
|
References:
|
144
|
-
Smillie, Christopher S et al.
|
144
|
+
Smillie, Christopher S et al. "Intra- and Inter-cellular Rewiring of the Human Colon during Ulcerative Colitis."
|
145
145
|
Cell vol. 178,3 (2019): 714-730.e22. doi:10.1016/j.cell.2019.06.029
|
146
146
|
|
147
147
|
Returns:
|
@@ -151,7 +151,7 @@ def tasccoda_example() -> AnnData: # pragma: no cover
|
|
151
151
|
output_file_path = settings.datasetdir / output_file_name
|
152
152
|
if not Path(output_file_path).exists():
|
153
153
|
_download(
|
154
|
-
url="https://
|
154
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/tasccoda_smillie.h5ad",
|
155
155
|
output_file_name=output_file_name,
|
156
156
|
output_path=settings.datasetdir,
|
157
157
|
is_zip=False,
|
@@ -180,7 +180,7 @@ def frangieh_2021() -> AnnData: # pragma: no cover
|
|
180
180
|
output_file_path = settings.datasetdir / output_file_name
|
181
181
|
if not Path(output_file_path).exists():
|
182
182
|
_download(
|
183
|
-
url="https://
|
183
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/frangieh_2021.h5ad",
|
184
184
|
output_file_name=output_file_name,
|
185
185
|
output_path=settings.datasetdir,
|
186
186
|
is_zip=False,
|
@@ -209,7 +209,7 @@ def frangieh_2021_raw() -> AnnData: # pragma: no cover
|
|
209
209
|
output_file_path = settings.datasetdir / output_file_name
|
210
210
|
if not Path(output_file_path).exists():
|
211
211
|
_download(
|
212
|
-
url="https://
|
212
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/frangieh_2021_raw.h5ad",
|
213
213
|
output_file_name=output_file_name,
|
214
214
|
output_path=settings.datasetdir,
|
215
215
|
is_zip=False,
|
@@ -238,7 +238,7 @@ def dixit_2016_raw() -> AnnData: # pragma: no cover
|
|
238
238
|
output_file_path = settings.datasetdir / output_file_name
|
239
239
|
if not Path(output_file_path).exists():
|
240
240
|
_download(
|
241
|
-
url="https://
|
241
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/dixit_2016_raw.h5ad",
|
242
242
|
output_file_name=output_file_name,
|
243
243
|
output_path=settings.datasetdir,
|
244
244
|
is_zip=False,
|
@@ -267,7 +267,7 @@ def dixit_2016() -> AnnData: # pragma: no cover
|
|
267
267
|
output_file_path = settings.datasetdir / output_file_name
|
268
268
|
if not Path(output_file_path).exists():
|
269
269
|
_download(
|
270
|
-
url="https://
|
270
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/dixit_2016.h5ad",
|
271
271
|
output_file_name=output_file_name,
|
272
272
|
output_path=settings.datasetdir,
|
273
273
|
is_zip=False,
|
@@ -284,8 +284,8 @@ def norman_2019() -> AnnData: # pragma: no cover
|
|
284
284
|
overexpressing genes alone or in combination
|
285
285
|
|
286
286
|
References:
|
287
|
-
Norman, Thomas M et al.
|
288
|
-
single-cell phenotypes
|
287
|
+
Norman, Thomas M et al. "Exploring genetic interaction manifolds constructed from rich
|
288
|
+
single-cell phenotypes." Science (New York, N.Y.) vol. 365,6455 (2019): 786-793.
|
289
289
|
doi:10.1126/science.aax4438
|
290
290
|
|
291
291
|
Returns:
|
@@ -295,7 +295,7 @@ def norman_2019() -> AnnData: # pragma: no cover
|
|
295
295
|
output_file_path = settings.datasetdir / output_file_name
|
296
296
|
if not Path(output_file_path).exists():
|
297
297
|
_download(
|
298
|
-
url="https://
|
298
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/norman_2019.h5ad",
|
299
299
|
output_file_name=output_file_name,
|
300
300
|
output_path=settings.datasetdir,
|
301
301
|
is_zip=False,
|
@@ -312,8 +312,8 @@ def norman_2019_raw() -> AnnData: # pragma: no cover
|
|
312
312
|
overexpressing genes alone or in combination
|
313
313
|
|
314
314
|
References:
|
315
|
-
Norman, Thomas M et al.
|
316
|
-
single-cell phenotypes
|
315
|
+
Norman, Thomas M et al. "Exploring genetic interaction manifolds constructed from rich
|
316
|
+
single-cell phenotypes." Science (New York, N.Y.) vol. 365,6455 (2019): 786-793.
|
317
317
|
doi:10.1126/science.aax4438
|
318
318
|
|
319
319
|
Returns:
|
@@ -323,7 +323,7 @@ def norman_2019_raw() -> AnnData: # pragma: no cover
|
|
323
323
|
output_file_path = settings.datasetdir / output_file_name
|
324
324
|
if not Path(output_file_path).exists():
|
325
325
|
_download(
|
326
|
-
url="https://
|
326
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/norman_2019_raw.h5ad",
|
327
327
|
output_file_name=output_file_name,
|
328
328
|
output_path=settings.datasetdir,
|
329
329
|
is_zip=False,
|
@@ -346,7 +346,7 @@ def dialogue_example() -> AnnData: # pragma: no cover
|
|
346
346
|
output_file_path = settings.datasetdir / output_file_name
|
347
347
|
if not Path(output_file_path).exists():
|
348
348
|
_download(
|
349
|
-
url="https://
|
349
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/dialogue_example.h5ad",
|
350
350
|
output_file_name=output_file_name,
|
351
351
|
output_path=settings.datasetdir,
|
352
352
|
is_zip=False,
|
@@ -368,7 +368,7 @@ def distance_example() -> AnnData: # pragma: no cover
|
|
368
368
|
output_file_path = settings.datasetdir / output_file_name
|
369
369
|
if not Path(output_file_path).exists():
|
370
370
|
_download(
|
371
|
-
url="https://
|
371
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/distances_example_data.h5ad",
|
372
372
|
output_file_name=output_file_name,
|
373
373
|
output_path=settings.datasetdir,
|
374
374
|
is_zip=False,
|
@@ -399,7 +399,7 @@ def kang_2018() -> AnnData: # pragma: no cover
|
|
399
399
|
output_file_path = settings.datasetdir / output_file_name
|
400
400
|
if not Path(output_file_path).exists():
|
401
401
|
_download(
|
402
|
-
url="https://
|
402
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/kang_2018.h5ad",
|
403
403
|
output_file_name=output_file_name,
|
404
404
|
output_path=settings.datasetdir,
|
405
405
|
is_zip=False,
|
@@ -428,7 +428,7 @@ def stephenson_2021_subsampled() -> AnnData: # pragma: no cover
|
|
428
428
|
output_file_path = settings.datasetdir / output_file_name
|
429
429
|
if not Path(output_file_path).exists():
|
430
430
|
_download(
|
431
|
-
url="https://
|
431
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/stephenson_2021_subsampled.h5ad",
|
432
432
|
output_file_name=output_file_name,
|
433
433
|
output_path=settings.datasetdir,
|
434
434
|
is_zip=False,
|
@@ -445,7 +445,7 @@ def haber_2017_regions() -> AnnData: # pragma: no cover
|
|
445
445
|
Some of the cells were also subject to Salmonella or Heligmosomoides polygyrus infection (day 3 and day 10).
|
446
446
|
|
447
447
|
References:
|
448
|
-
Haber, Adam L. et al.
|
448
|
+
Haber, Adam L. et al. "A single-cell survey of the small intestinal epithelium" Nature vol. 551 (2017): 333-339
|
449
449
|
doi:10.1038/nature24489
|
450
450
|
|
451
451
|
Returns:
|
@@ -455,7 +455,7 @@ def haber_2017_regions() -> AnnData: # pragma: no cover
|
|
455
455
|
output_file_path = settings.datasetdir / output_file_name
|
456
456
|
if not Path(output_file_path).exists():
|
457
457
|
_download(
|
458
|
-
url="https://
|
458
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/haber_2017_regions.h5ad",
|
459
459
|
output_file_name=output_file_name,
|
460
460
|
output_path=settings.datasetdir,
|
461
461
|
is_zip=False,
|
@@ -482,7 +482,7 @@ def adamson_2016_pilot() -> AnnData: # pragma: no cover
|
|
482
482
|
output_file_path = settings.datasetdir / output_file_name
|
483
483
|
if not Path(output_file_path).exists():
|
484
484
|
_download(
|
485
|
-
url="https://
|
485
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/adamson_2016_pilot.h5ad",
|
486
486
|
output_file_name=output_file_name,
|
487
487
|
output_path=settings.datasetdir,
|
488
488
|
is_zip=False,
|
@@ -513,7 +513,7 @@ def adamson_2016_upr_epistasis() -> AnnData: # pragma: no cover
|
|
513
513
|
output_file_path = settings.datasetdir / output_file_name
|
514
514
|
if not Path(output_file_path).exists():
|
515
515
|
_download(
|
516
|
-
url="https://
|
516
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/adamson_2016_upr_epistasis.h5ad",
|
517
517
|
output_file_name=output_file_name,
|
518
518
|
output_path=settings.datasetdir,
|
519
519
|
is_zip=False,
|
@@ -542,7 +542,7 @@ def adamson_2016_upr_perturb_seq() -> AnnData: # pragma: no cover
|
|
542
542
|
output_file_path = settings.datasetdir / output_file_name
|
543
543
|
if not Path(output_file_path).exists():
|
544
544
|
_download(
|
545
|
-
url="https://
|
545
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/adamson_2016_upr_perturb_seq.h5ad",
|
546
546
|
output_file_name=output_file_name,
|
547
547
|
output_path=settings.datasetdir,
|
548
548
|
is_zip=False,
|
@@ -569,7 +569,7 @@ def aissa_2021() -> AnnData: # pragma: no cover
|
|
569
569
|
output_file_path = settings.datasetdir / output_file_name
|
570
570
|
if not Path(output_file_path).exists():
|
571
571
|
_download(
|
572
|
-
url="https://
|
572
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/aissa_2021.h5ad",
|
573
573
|
output_file_name=output_file_name,
|
574
574
|
output_path=settings.datasetdir,
|
575
575
|
is_zip=False,
|
@@ -598,7 +598,7 @@ def chang_2021() -> AnnData: # pragma: no cover
|
|
598
598
|
output_file_path = settings.datasetdir / output_file_name
|
599
599
|
if not Path(output_file_path).exists():
|
600
600
|
_download(
|
601
|
-
url="https://
|
601
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/chang_2021.h5ad",
|
602
602
|
output_file_name=output_file_name,
|
603
603
|
output_path=settings.datasetdir,
|
604
604
|
is_zip=False,
|
@@ -629,7 +629,7 @@ def datlinger_2017() -> AnnData: # pragma: no cover
|
|
629
629
|
output_file_path = settings.datasetdir / output_file_name
|
630
630
|
if not Path(output_file_path).exists():
|
631
631
|
_download(
|
632
|
-
url="https://
|
632
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/datlinger_2017.h5ad",
|
633
633
|
output_file_name=output_file_name,
|
634
634
|
output_path=settings.datasetdir,
|
635
635
|
is_zip=False,
|
@@ -659,7 +659,7 @@ def datlinger_2021() -> AnnData: # pragma: no cover
|
|
659
659
|
output_file_path = settings.datasetdir / output_file_name
|
660
660
|
if not Path(output_file_path).exists():
|
661
661
|
_download(
|
662
|
-
url="https://
|
662
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/datlinger_2021.h5ad",
|
663
663
|
output_file_name=output_file_name,
|
664
664
|
output_path=settings.datasetdir,
|
665
665
|
is_zip=False,
|
@@ -690,7 +690,7 @@ def frangieh_2021_protein() -> AnnData: # pragma: no cover
|
|
690
690
|
output_file_path = settings.datasetdir / output_file_name
|
691
691
|
if not Path(output_file_path).exists():
|
692
692
|
_download(
|
693
|
-
url="https://
|
693
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/frangieh_2021_protein.h5ad",
|
694
694
|
output_file_name=output_file_name,
|
695
695
|
output_path=settings.datasetdir,
|
696
696
|
is_zip=False,
|
@@ -721,7 +721,7 @@ def frangieh_2021_rna() -> AnnData: # pragma: no cover
|
|
721
721
|
output_file_path = settings.datasetdir / output_file_name
|
722
722
|
if not Path(output_file_path).exists():
|
723
723
|
_download(
|
724
|
-
url="https://
|
724
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/frangieh_2021_rna.h5ad",
|
725
725
|
output_file_name=output_file_name,
|
726
726
|
output_path=settings.datasetdir,
|
727
727
|
is_zip=False,
|
@@ -749,7 +749,7 @@ def gasperini_2019_atscale() -> AnnData: # pragma: no cover
|
|
749
749
|
output_file_path = settings.datasetdir / output_file_name
|
750
750
|
if not Path(output_file_path).exists():
|
751
751
|
_download(
|
752
|
-
url="https://
|
752
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/gasperini_2019_atscale.h5ad",
|
753
753
|
output_file_name=output_file_name,
|
754
754
|
output_path=settings.datasetdir,
|
755
755
|
is_zip=False,
|
@@ -778,7 +778,7 @@ def gasperini_2019_highmoi() -> AnnData: # pragma: no cover
|
|
778
778
|
output_file_path = settings.datasetdir / output_file_name
|
779
779
|
if not Path(output_file_path).exists():
|
780
780
|
_download(
|
781
|
-
url="https://
|
781
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/gasperini_2019_highmoi.h5ad",
|
782
782
|
output_file_name=output_file_name,
|
783
783
|
output_path=settings.datasetdir,
|
784
784
|
is_zip=False,
|
@@ -807,7 +807,7 @@ def gasperini_2019_lowmoi() -> AnnData: # pragma: no cover
|
|
807
807
|
output_file_path = settings.datasetdir / output_file_name
|
808
808
|
if not Path(output_file_path).exists():
|
809
809
|
_download(
|
810
|
-
url="https://
|
810
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/gasperini_2019_lowmoi.h5ad",
|
811
811
|
output_file_name=output_file_name,
|
812
812
|
output_path=settings.datasetdir,
|
813
813
|
is_zip=False,
|
@@ -835,7 +835,7 @@ def gehring_2019() -> AnnData: # pragma: no cover
|
|
835
835
|
output_file_path = settings.datasetdir / output_file_name
|
836
836
|
if not Path(output_file_path).exists():
|
837
837
|
_download(
|
838
|
-
url="https://
|
838
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/gehring_2019.h5ad",
|
839
839
|
output_file_name=output_file_name,
|
840
840
|
output_path=settings.datasetdir,
|
841
841
|
is_zip=False,
|
@@ -864,7 +864,7 @@ def mcfarland_2020() -> AnnData: # pragma: no cover
|
|
864
864
|
output_file_path = settings.datasetdir / output_file_name
|
865
865
|
if not Path(output_file_path).exists():
|
866
866
|
_download(
|
867
|
-
url="https://
|
867
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/mcfarland_2020.h5ad",
|
868
868
|
output_file_name=output_file_name,
|
869
869
|
output_path=settings.datasetdir,
|
870
870
|
is_zip=False,
|
@@ -893,7 +893,7 @@ def replogle_2022_k562_essential() -> AnnData: # pragma: no cover
|
|
893
893
|
output_file_path = settings.datasetdir / output_file_name
|
894
894
|
if not Path(output_file_path).exists():
|
895
895
|
_download(
|
896
|
-
url="https://
|
896
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/gasperini_2019_atscale.h5ad",
|
897
897
|
output_file_name=output_file_name,
|
898
898
|
output_path=settings.datasetdir,
|
899
899
|
is_zip=False,
|
@@ -924,7 +924,7 @@ def replogle_2022_k562_gwps() -> AnnData: # pragma: no cover
|
|
924
924
|
output_file_path = settings.datasetdir / output_file_name
|
925
925
|
if not Path(output_file_path).exists():
|
926
926
|
_download(
|
927
|
-
url="https://
|
927
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/replogle_2022_k562_gwps.h5ad",
|
928
928
|
output_file_name=output_file_name,
|
929
929
|
output_path=settings.datasetdir,
|
930
930
|
is_zip=False,
|
@@ -954,7 +954,7 @@ def replogle_2022_rpe1() -> AnnData: # pragma: no cover
|
|
954
954
|
output_file_path = settings.datasetdir / output_file_name
|
955
955
|
if not Path(output_file_path).exists():
|
956
956
|
_download(
|
957
|
-
url="https://
|
957
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/replogle_2022_rpe1.h5ad",
|
958
958
|
output_file_name=output_file_name,
|
959
959
|
output_path=settings.datasetdir,
|
960
960
|
is_zip=False,
|
@@ -985,7 +985,7 @@ def schiebinger_2019_16day() -> AnnData: # pragma: no cover
|
|
985
985
|
output_file_path = settings.datasetdir / output_file_name
|
986
986
|
if not Path(output_file_path).exists():
|
987
987
|
_download(
|
988
|
-
url="https://
|
988
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/schiebinger_2019_16day.h5ad",
|
989
989
|
output_file_name=output_file_name,
|
990
990
|
output_path=settings.datasetdir,
|
991
991
|
is_zip=False,
|
@@ -1014,7 +1014,7 @@ def schiebinger_2019_18day() -> AnnData: # pragma: no cover
|
|
1014
1014
|
output_file_path = settings.datasetdir / output_file_name
|
1015
1015
|
if not Path(output_file_path).exists():
|
1016
1016
|
_download(
|
1017
|
-
url="https://
|
1017
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/Schiebinger_2019_18day.h5ad",
|
1018
1018
|
output_file_name=output_file_name,
|
1019
1019
|
output_path=settings.datasetdir,
|
1020
1020
|
is_zip=False,
|
@@ -1043,7 +1043,7 @@ def schraivogel_2020_tap_screen_chr11() -> AnnData: # pragma: no cover
|
|
1043
1043
|
output_file_path = settings.datasetdir / output_file_name
|
1044
1044
|
if not Path(output_file_path).exists():
|
1045
1045
|
_download(
|
1046
|
-
url="https://
|
1046
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/schraivogel_2020_tap_screen_chr11.h5ad",
|
1047
1047
|
output_file_name=output_file_name,
|
1048
1048
|
output_path=settings.datasetdir,
|
1049
1049
|
is_zip=False,
|
@@ -1072,7 +1072,7 @@ def schraivogel_2020_tap_screen_chr8() -> AnnData: # pragma: no cover
|
|
1072
1072
|
output_file_path = settings.datasetdir / output_file_name
|
1073
1073
|
if not Path(output_file_path).exists():
|
1074
1074
|
_download(
|
1075
|
-
url="https://
|
1075
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/schraivogel_2020_tap_screen_chr8.h5ad",
|
1076
1076
|
output_file_name=output_file_name,
|
1077
1077
|
output_path=settings.datasetdir,
|
1078
1078
|
is_zip=False,
|
@@ -1102,7 +1102,7 @@ def shifrut_2018() -> AnnData: # pragma: no cover
|
|
1102
1102
|
output_file_path = settings.datasetdir / output_file_name
|
1103
1103
|
if not Path(output_file_path).exists():
|
1104
1104
|
_download(
|
1105
|
-
url="https://
|
1105
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/shifrut_2018.h5ad",
|
1106
1106
|
output_file_name=output_file_name,
|
1107
1107
|
output_path=settings.datasetdir,
|
1108
1108
|
is_zip=False,
|
@@ -1133,7 +1133,7 @@ def srivatsan_2020_sciplex2() -> AnnData: # pragma: no cover
|
|
1133
1133
|
output_file_path = settings.datasetdir / output_file_name
|
1134
1134
|
if not Path(output_file_path).exists():
|
1135
1135
|
_download(
|
1136
|
-
url="https://
|
1136
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/srivatsan_2020_sciplex2.h5ad",
|
1137
1137
|
output_file_name=output_file_name,
|
1138
1138
|
output_path=settings.datasetdir,
|
1139
1139
|
is_zip=False,
|
@@ -1162,7 +1162,7 @@ def srivatsan_2020_sciplex3() -> AnnData: # pragma: no cover
|
|
1162
1162
|
output_file_path = settings.datasetdir / output_file_name
|
1163
1163
|
if not Path(output_file_path).exists():
|
1164
1164
|
_download(
|
1165
|
-
url="https://
|
1165
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/srivatsan_2020_sciplex3.h5ad",
|
1166
1166
|
output_file_name=output_file_name,
|
1167
1167
|
output_path=settings.datasetdir,
|
1168
1168
|
is_zip=False,
|
@@ -1194,7 +1194,7 @@ def srivatsan_2020_sciplex4() -> AnnData: # pragma: no cover
|
|
1194
1194
|
output_file_path = settings.datasetdir / output_file_name
|
1195
1195
|
if not Path(output_file_path).exists():
|
1196
1196
|
_download(
|
1197
|
-
url="https://
|
1197
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/srivatsan_2020_sciplex4.h5ad",
|
1198
1198
|
output_file_name=output_file_name,
|
1199
1199
|
output_path=settings.datasetdir,
|
1200
1200
|
is_zip=False,
|
@@ -1226,7 +1226,7 @@ def tian_2019_day7neuron() -> AnnData: # pragma: no cover
|
|
1226
1226
|
output_file_path = settings.datasetdir / output_file_name
|
1227
1227
|
if not Path(output_file_path).exists():
|
1228
1228
|
_download(
|
1229
|
-
url="https://
|
1229
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/tian_2019_day7neuron.h5ad",
|
1230
1230
|
output_file_name=output_file_name,
|
1231
1231
|
output_path=settings.datasetdir,
|
1232
1232
|
is_zip=False,
|
@@ -1258,7 +1258,7 @@ def tian_2019_ipsc() -> AnnData: # pragma: no cover
|
|
1258
1258
|
output_file_path = settings.datasetdir / output_file_name
|
1259
1259
|
if not Path(output_file_path).exists():
|
1260
1260
|
_download(
|
1261
|
-
url="https://
|
1261
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/tian_2019_iPad.h5ad",
|
1262
1262
|
output_file_name=output_file_name,
|
1263
1263
|
output_path=settings.datasetdir,
|
1264
1264
|
is_zip=False,
|
@@ -1288,7 +1288,7 @@ def tian_2021_crispra() -> AnnData: # pragma: no cover
|
|
1288
1288
|
output_file_path = settings.datasetdir / output_file_name
|
1289
1289
|
if not Path(output_file_path).exists():
|
1290
1290
|
_download(
|
1291
|
-
url="https://
|
1291
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/tian_2021_crispra.h5ad",
|
1292
1292
|
output_file_name=output_file_name,
|
1293
1293
|
output_path=settings.datasetdir,
|
1294
1294
|
is_zip=False,
|
@@ -1318,7 +1318,7 @@ def tian_2021_crispri() -> AnnData: # pragma: no cover
|
|
1318
1318
|
output_file_path = settings.datasetdir / output_file_name
|
1319
1319
|
if not Path(output_file_path).exists():
|
1320
1320
|
_download(
|
1321
|
-
url="https://
|
1321
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/tian_2021_crispri.h5ad",
|
1322
1322
|
output_file_name=output_file_name,
|
1323
1323
|
output_path=settings.datasetdir,
|
1324
1324
|
is_zip=False,
|
@@ -1345,7 +1345,7 @@ def weinreb_2020() -> AnnData: # pragma: no cover
|
|
1345
1345
|
output_file_path = settings.datasetdir / output_file_name
|
1346
1346
|
if not Path(output_file_path).exists():
|
1347
1347
|
_download(
|
1348
|
-
url="https://
|
1348
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/weinreb_2020.h5ad",
|
1349
1349
|
output_file_name=output_file_name,
|
1350
1350
|
output_path=settings.datasetdir,
|
1351
1351
|
is_zip=False,
|
@@ -1373,7 +1373,7 @@ def xie_2017() -> AnnData: # pragma: no cover
|
|
1373
1373
|
output_file_path = settings.datasetdir / output_file_name
|
1374
1374
|
if not Path(output_file_path).exists():
|
1375
1375
|
_download(
|
1376
|
-
url="https://
|
1376
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/xie_2017.h5ad",
|
1377
1377
|
output_file_name=output_file_name,
|
1378
1378
|
output_path=settings.datasetdir,
|
1379
1379
|
is_zip=False,
|
@@ -1403,7 +1403,7 @@ def zhao_2021() -> AnnData: # pragma: no cover
|
|
1403
1403
|
output_file_path = settings.datasetdir / output_file_name
|
1404
1404
|
if not Path(output_file_path).exists():
|
1405
1405
|
_download(
|
1406
|
-
url="https://
|
1406
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/zhaoSims2021.h5ad",
|
1407
1407
|
output_file_name=output_file_name,
|
1408
1408
|
output_path=settings.datasetdir,
|
1409
1409
|
is_zip=False,
|
@@ -1428,7 +1428,7 @@ def cinemaot_example() -> AnnData: # pragma: no cover:
|
|
1428
1428
|
output_file_path = settings.datasetdir / output_file_name
|
1429
1429
|
if not Path(output_file_path).exists():
|
1430
1430
|
_download(
|
1431
|
-
url="https://
|
1431
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/cinemaot_example.h5ad",
|
1432
1432
|
output_file_name=output_file_name,
|
1433
1433
|
output_path=settings.datasetdir,
|
1434
1434
|
is_zip=False,
|
@@ -1456,7 +1456,7 @@ def dong_2023() -> AnnData: # pragma: no cover
|
|
1456
1456
|
output_file_path = settings.datasetdir / output_file_name
|
1457
1457
|
if not Path(output_file_path).exists():
|
1458
1458
|
_download(
|
1459
|
-
url="https://
|
1459
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/dong_2023.h5ad",
|
1460
1460
|
output_file_name=output_file_name,
|
1461
1461
|
output_path=settings.datasetdir,
|
1462
1462
|
is_zip=False,
|
@@ -1472,7 +1472,7 @@ def smillie_2019() -> AnnData: # pragma: no cover
|
|
1472
1472
|
The resulting AnnData when preparing this dataset for processing with tascCODA is available via tasccoda_example().
|
1473
1473
|
|
1474
1474
|
References:
|
1475
|
-
Smillie, Christopher S et al.
|
1475
|
+
Smillie, Christopher S et al. "Intra- and Inter-cellular Rewiring of the Human Colon during Ulcerative Colitis."
|
1476
1476
|
Cell vol. 178,3 (2019): 714-730.e22. doi:10.1016/j.cell.2019.06.029
|
1477
1477
|
|
1478
1478
|
Returns:
|
@@ -1482,7 +1482,7 @@ def smillie_2019() -> AnnData: # pragma: no cover
|
|
1482
1482
|
output_file_path = settings.datasetdir / Path(output_file_name).with_suffix("")
|
1483
1483
|
if not Path(output_file_path).exists():
|
1484
1484
|
_download(
|
1485
|
-
url="https://
|
1485
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/smillie_2019.h5ad.zip",
|
1486
1486
|
output_file_name=output_file_name,
|
1487
1487
|
output_path=settings.datasetdir,
|
1488
1488
|
is_zip=True,
|
@@ -1507,7 +1507,7 @@ def combosciplex() -> AnnData: # pragma: no cover
|
|
1507
1507
|
output_file_path = settings.datasetdir / output_file_name
|
1508
1508
|
if not Path(output_file_path).exists():
|
1509
1509
|
_download(
|
1510
|
-
url="https://
|
1510
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/combosciplex.h5ad",
|
1511
1511
|
output_file_name=output_file_name,
|
1512
1512
|
output_path=settings.datasetdir,
|
1513
1513
|
is_zip=False,
|
@@ -1532,7 +1532,7 @@ def sciplex_gxe1() -> AnnData: # pragma: no cover
|
|
1532
1532
|
output_file_path = settings.datasetdir / output_file_name
|
1533
1533
|
if not Path(output_file_path).exists():
|
1534
1534
|
_download(
|
1535
|
-
url="https://
|
1535
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/sciPlexGxE_1_GSM7056148.h5ad",
|
1536
1536
|
output_file_name=output_file_name,
|
1537
1537
|
output_path=settings.datasetdir,
|
1538
1538
|
is_zip=False,
|
@@ -1564,7 +1564,7 @@ def zhang_2021() -> AnnData: # pragma: no cover
|
|
1564
1564
|
output_file_path = settings.datasetdir / output_file_name
|
1565
1565
|
if not Path(output_file_path).exists():
|
1566
1566
|
_download(
|
1567
|
-
url="https://
|
1567
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/zhang_2021.h5ad",
|
1568
1568
|
output_file_name=output_file_name,
|
1569
1569
|
output_path=settings.datasetdir,
|
1570
1570
|
is_zip=False,
|
@@ -1590,7 +1590,7 @@ def hagai_2018() -> AnnData: # pragma: no cover
|
|
1590
1590
|
output_file_path = settings.datasetdir / output_file_name
|
1591
1591
|
if not Path(output_file_path).exists():
|
1592
1592
|
_download(
|
1593
|
-
url="https://
|
1593
|
+
url="https://scverse-exampledata.s3.eu-west-1.amazonaws.com/pertpy/hagai_2018.h5ad",
|
1594
1594
|
output_file_name=output_file_name,
|
1595
1595
|
output_path=settings.datasetdir,
|
1596
1596
|
is_zip=False,
|
pertpy/metadata/_cell_line.py
CHANGED
@@ -195,7 +195,9 @@ class CellLine(MetaData):
|
|
195
195
|
block_size=4096,
|
196
196
|
is_zip=False,
|
197
197
|
)
|
198
|
-
df = pd.read_csv(
|
198
|
+
df = pd.read_csv(
|
199
|
+
drug_response_prism_file_path, index_col=0, usecols=["broad_id", "depmap_id", "name", "ic50", "ec50", "auc"]
|
200
|
+
)
|
199
201
|
df = df.dropna(subset=["depmap_id", "name"])
|
200
202
|
df = df.groupby(["depmap_id", "name"]).mean().reset_index()
|
201
203
|
self.drug_response_prism = df
|
@@ -568,7 +570,9 @@ class CellLine(MetaData):
|
|
568
570
|
verbosity=verbosity,
|
569
571
|
)
|
570
572
|
|
571
|
-
|
573
|
+
if adata.obs.index.name is None:
|
574
|
+
adata.obs.index.name = "original_index"
|
575
|
+
old_index_name = adata.obs.index.name
|
572
576
|
adata.obs = (
|
573
577
|
adata.obs.reset_index()
|
574
578
|
.set_index([query_id, query_perturbation])
|
@@ -635,7 +639,9 @@ class CellLine(MetaData):
|
|
635
639
|
verbosity=verbosity,
|
636
640
|
)
|
637
641
|
|
638
|
-
|
642
|
+
if adata.obs.index.name is None:
|
643
|
+
adata.obs.index.name = "original_index"
|
644
|
+
old_index_name = adata.obs.index.name
|
639
645
|
adata.obs = (
|
640
646
|
adata.obs.reset_index()
|
641
647
|
.set_index([query_id, "perturbation_lower"])
|
pertpy/metadata/_drug.py
CHANGED
@@ -14,12 +14,14 @@ from ._look_up import LookUp
|
|
14
14
|
from ._metadata import MetaData
|
15
15
|
|
16
16
|
if TYPE_CHECKING:
|
17
|
+
from collections.abc import Mapping
|
18
|
+
|
17
19
|
from anndata import AnnData
|
18
20
|
|
19
21
|
|
20
22
|
def _download_drug_annotation(
|
21
23
|
source: Literal["chembl", "dgidb", "pharmgkb"] = "chembl",
|
22
|
-
) -> pd.DataFrame |
|
24
|
+
) -> pd.DataFrame | Mapping[str, Mapping[str, list[str]]]:
|
23
25
|
if source == "chembl":
|
24
26
|
# Prepared in https://github.com/theislab/pertpy-datasets/blob/main/chembl_data.ipynb
|
25
27
|
chembl_path = Path(settings.cachedir) / "chembl.json"
|
@@ -232,7 +234,7 @@ class Drug(MetaData):
|
|
232
234
|
self.set()
|
233
235
|
return self.dataframe
|
234
236
|
|
235
|
-
def dict(self) ->
|
237
|
+
def dict(self) -> Mapping[str, list[str]] | Mapping[str, Mapping[str, list[str]]]:
|
236
238
|
if not self.loaded:
|
237
239
|
self.set()
|
238
240
|
return self.dictionary
|