From 53e09eace6a282f8f13d44fdedbc74ecf1ea6b11 Mon Sep 17 00:00:00 2001 From: maestro-jk Date: Wed, 27 Nov 2024 15:32:40 +0100 Subject: [PATCH] solving some reprod issues, some wip, --- .gitignore | 2 + Makefile | 1 + README.md | 8 +- config.yaml | 186 +-- .../update_lamin_or_cellxgene.ipynb | 1112 ----------------- scprint/__init__.py | 2 +- scprint/model/model.py | 13 +- scprint/tasks/cell_emb.py | 4 +- uv.lock | 134 +- 9 files changed, 244 insertions(+), 1218 deletions(-) delete mode 100644 notebooks/additional/update_lamin_or_cellxgene.ipynb diff --git a/.gitignore b/.gitignore index e40fc6f..98b7eaa 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,5 @@ file.txt tests/data/step_0__predict_part_0_0.h5ad data/human_dcm_hcm_nf/ data/geneformertest.csv +clf_omni.pkl +metrics__step0.json diff --git a/Makefile b/Makefile index 4e97138..38c8408 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ release: ## Create a new tag for release. @read -p "Version? (provide the next x.y.z semver) : " TAG @echo "$${TAG}" > scprint/VERSION @sed -i 's/^version = .*/version = "'$${TAG}'"/' pyproject.toml + @sed -i 's/__version__ = .*/__version__ = "'$${TAG}'"/' scprint/__init__.py @$(ENV_PREFIX)gitchangelog > HISTORY.md @git add scprint/VERSION HISTORY.md pyproject.toml @git commit -m "release: version $${TAG} 🚀" diff --git a/README.md b/README.md index 9dfa658..767d6a6 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,11 @@ To use scPRINT, you will need to use [lamin.ai](https://lamin.ai/). This is need To start you will need to do: ```bash -conda create -n python==3.10 #scprint might work with python >3.10, but it is not tested +uv venv -n python==3.10 #scprint might work with python >3.10, but it is not tested #one of -pip install scprint # OR -pip install scprint[dev] # for the dev dependencies (building etc..) OR -pip install scprint[flash] # to use flashattention2 with triton: only if you have a compatible gpu (e.g. not available for apple GPUs for now, see https://github.com/triton-lang/triton?tab=readme-ov-file#compatibility) +uv pip install scprint # OR +uv pip install scprint[dev] # for the dev dependencies (building etc..) OR +uv pip install scprint[flash] # to use flashattention2 with triton: only if you have a compatible gpu (e.g. not available for apple GPUs for now, see https://github.com/triton-lang/triton?tab=readme-ov-file#compatibility) #OR pip install scPRINT[dev,flash] lamin init --storage ./testdb --name test --schema bionty diff --git a/config.yaml b/config.yaml index ae15ef3..4330d32 100644 --- a/config.yaml +++ b/config.yaml @@ -8,70 +8,70 @@ trainer: precision: 16 logger: false callbacks: - - class_path: scprint.trainer.TrainingMode - init_args: - do_denoise: true - noise: - - 0.3 - do_cce: true - cce_sim: 0.5 - do_ecs: true - ecs_threshold: 0.3 - ecs_scale: 1.0 - do_mvc: false - do_adv_cls: false - do_next_tp: false - class_scale: 1.0 - mask_ratio: - - 0.15 - - 0.3 - log_grad: false - - class_path: lightning.pytorch.callbacks.StochasticWeightAveraging - init_args: - swa_lrs: 0.01 - swa_epoch_start: 0.8 - annealing_epochs: 10 - annealing_strategy: cos - avg_fn: null - device: cpu - - class_path: lightning.pytorch.callbacks.ModelCheckpoint - init_args: - dirpath: null - filename: null - monitor: val_loss - verbose: false - save_last: null - save_top_k: -1 - save_weights_only: false - mode: min - auto_insert_metric_name: true - every_n_train_steps: null - train_time_interval: null - every_n_epochs: null - save_on_train_epoch_end: null - - class_path: lightning.pytorch.callbacks.EarlyStopping - init_args: - monitor: val_loss - min_delta: 0.0 - patience: 10 - verbose: false - mode: min - strict: true - check_finite: true - stopping_threshold: null - divergence_threshold: null - check_on_train_epoch_end: null - log_rank_zero_only: false - - class_path: lightning.pytorch.callbacks.LearningRateMonitor - init_args: - logging_interval: step - log_momentum: false + - class_path: scprint.trainer.TrainingMode + init_args: + do_denoise: true + noise: + - 0.3 + do_cce: true + cce_sim: 0.5 + do_ecs: true + ecs_threshold: 0.3 + ecs_scale: 1.0 + do_mvc: false + do_adv_cls: false + do_next_tp: false + class_scale: 1.0 + mask_ratio: + - 0.15 + - 0.3 + log_grad: false + - class_path: lightning.pytorch.callbacks.StochasticWeightAveraging + init_args: + swa_lrs: 0.01 + swa_epoch_start: 0.8 + annealing_epochs: 10 + annealing_strategy: cos + avg_fn: null + device: cpu + - class_path: lightning.pytorch.callbacks.ModelCheckpoint + init_args: + dirpath: null + filename: null + monitor: val_loss + verbose: false + save_last: null + save_top_k: -1 + save_weights_only: false + mode: min + auto_insert_metric_name: true + every_n_train_steps: null + train_time_interval: null + every_n_epochs: null + save_on_train_epoch_end: null + - class_path: lightning.pytorch.callbacks.EarlyStopping + init_args: + monitor: val_loss + min_delta: 0.0 + patience: 10 + verbose: false + mode: min + strict: true + check_finite: true + stopping_threshold: null + divergence_threshold: null + check_on_train_epoch_end: null + log_rank_zero_only: false + - class_path: lightning.pytorch.callbacks.LearningRateMonitor + init_args: + logging_interval: step + log_momentum: false fast_dev_run: false max_epochs: null min_epochs: null max_steps: -1 min_steps: null - max_time: '{''hours'': 12}' + max_time: "{'hours': 12}" limit_train_batches: null limit_val_batches: null limit_test_batches: null @@ -112,10 +112,10 @@ model: n_input_bins: 0 mvc_decoder: inner product pred_embedding: - - cell_type_ontology_term_id - - disease_ontology_term_id - - self_reported_ethnicity_ontology_term_id - - sex_ontology_term_id + - cell_type_ontology_term_id + - disease_ontology_term_id + - self_reported_ethnicity_ontology_term_id + - sex_ontology_term_id cell_emb_style: cls lr: 0.001 residual_in_fp32: true @@ -128,47 +128,47 @@ model: fused_mlp: false fused_bias_fc: false sequence_parallel: false - drop_path_rate: 0.02 - weight_init: '' + drop_path_rate: 0 + weight_init: "" data: mdataset: null collection_name: preprocessed dataset organisms: - - NCBITaxon:9606 + - NCBITaxon:9606 weight_scaler: 30 label_to_weight: - - cell_type_ontology_term_id - - disease_ontology_term_id - - assay_ontology_term_id - - self_reported_ethnicity_ontology_term_id - - sex_ontology_term_id - - organism_ontology_term_id + - cell_type_ontology_term_id + - disease_ontology_term_id + - assay_ontology_term_id + - self_reported_ethnicity_ontology_term_id + - sex_ontology_term_id + - organism_ontology_term_id label_to_pred: - - cell_type_ontology_term_id - - disease_ontology_term_id - - assay_ontology_term_id - - self_reported_ethnicity_ontology_term_id - - sex_ontology_term_id - - organism_ontology_term_id + - cell_type_ontology_term_id + - disease_ontology_term_id + - assay_ontology_term_id + - self_reported_ethnicity_ontology_term_id + - sex_ontology_term_id + - organism_ontology_term_id validation_split: 0.2 test_split: 0.0 use_default_col: true all_clss: - - cell_type_ontology_term_id - - disease_ontology_term_id - - assay_ontology_term_id - - self_reported_ethnicity_ontology_term_id - - sex_ontology_term_id - - organism_ontology_term_id - - heat_diff - - total_counts - - nnz - - dpt_group + - cell_type_ontology_term_id + - disease_ontology_term_id + - assay_ontology_term_id + - self_reported_ethnicity_ontology_term_id + - sex_ontology_term_id + - organism_ontology_term_id + - heat_diff + - total_counts + - nnz + - dpt_group hierarchical_labels: - - cell_type_ontology_term_id - - disease_ontology_term_id - - assay_ontology_term_id - - self_reported_ethnicity_ontology_term_id + - cell_type_ontology_term_id + - disease_ontology_term_id + - assay_ontology_term_id + - self_reported_ethnicity_ontology_term_id how: most expr organism_name: organism_ontology_term_id max_len: 1000 @@ -188,7 +188,7 @@ data: generator: null prefetch_factor: null persistent_workers: false - pin_memory_device: '' + pin_memory_device: "" set_float32_matmul_precision: true project: scprint_test ckpt_path: null diff --git a/notebooks/additional/update_lamin_or_cellxgene.ipynb b/notebooks/additional/update_lamin_or_cellxgene.ipynb deleted file mode 100644 index dbbc44e..0000000 --- a/notebooks/additional/update_lamin_or_cellxgene.ipynb +++ /dev/null @@ -1,1112 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# update lamindb and bionty..." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[92m→\u001b[0m connected lamindb: jkobject/scprint\n", - "\u001b[0m" - ] - } - ], - "source": [ - "! lamin load scprint" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[36;1mOperations to perform:\u001b[0m\n", - "\u001b[1m Apply all migrations: \u001b[0mbionty, lnschema_core\n", - "Running pre-migrate handlers for application lnschema_core\n", - "Running pre-migrate handlers for application bionty\n", - "\u001b[36;1mRunning migrations:\u001b[0m\n", - " Applying lnschema_core.0065_remove_collection_feature_sets_and_more...\u001b[32;1m OK (1.386s)\u001b[0m\n", - " Applying lnschema_core.0066_alter_artifact__feature_values_and_more...\u001b[32;1m OK (3.067s)\u001b[0m\n", - " Applying bionty.0038_alter_artifactcellline_created_by_and_more...\u001b[32;1m OK (4.517s)\u001b[0m\n", - " Applying bionty.0039_alter_cellline_source_alter_cellmarker_source_and_more...\u001b[32;1m OK (1.847s)\u001b[0m\n", - "Running post-migrate handlers for application lnschema_core\n", - "Running post-migrate handlers for application bionty\n" - ] - } - ], - "source": [ - "! lamin migrate deploy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# we will check it works and reset the bionty sources" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[92m→\u001b[0m connected lamindb: jkobject/scprint\n" - ] - } - ], - "source": [ - "import lamindb as ln\n", - "import bionty as bt\n", - "from scdataloader.utils import populate_my_ontology\n", - "%load_ext autoreload\n", - "%autoreload 2\n" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(ln.Artifact.filter())" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "bt.base.reset_sources()" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m please reload your instance to reflect the updates!\n" - ] - } - ], - "source": [ - "bt.core.sync_all_sources_to_latest()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# load them in my personnal ontology" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "metadata": {}, - "outputs": [], - "source": [ - "bt.DevelopmentalStage.artifacts.through.objects.all().delete()\n", - "bt.DevelopmentalStage.filter().delete()" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "metadata": {}, - "outputs": [ - { - "ename": "FileNotFoundError", - "evalue": "[Errno 2] No such file or directory: '/home/ml4ig1/.lamin/bionty/versions/.lamindb_current_sources.yaml'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[41], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m#bt.Tissue.import_from_source() \u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mbt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDevelopmentalStage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimport_from_source\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m \n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/models.py:266\u001b[0m, in \u001b[0;36mBioRecord.import_from_source\u001b[0;34m(cls, source, ontology_ids, organism, ignore_conflicts, update)\u001b[0m\n\u001b[1;32m 263\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcore\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_add_ontology\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m add_ontology_from_df, check_source_in_db\n\u001b[1;32m 265\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(\u001b[38;5;28mcls\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124montology_id\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[0;32m--> 266\u001b[0m \u001b[43madd_ontology_from_df\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 267\u001b[0m \u001b[43m \u001b[49m\u001b[43mregistry\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 268\u001b[0m \u001b[43m \u001b[49m\u001b[43montology_ids\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43montology_ids\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 269\u001b[0m \u001b[43m \u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 270\u001b[0m \u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 271\u001b[0m \u001b[43m \u001b[49m\u001b[43mignore_conflicts\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mignore_conflicts\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 272\u001b[0m \u001b[43m \u001b[49m\u001b[43mupdate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mupdate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 273\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 274\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 275\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mlamindb\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mln\u001b[39;00m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/core/_add_ontology.py:146\u001b[0m, in \u001b[0;36madd_ontology_from_df\u001b[0;34m(registry, ontology_ids, organism, source, ignore_conflicts, update)\u001b[0m\n\u001b[1;32m 142\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mlamindb\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mln\u001b[39;00m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mbionty\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_bionty\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_source_record\n\u001b[0;32m--> 146\u001b[0m public \u001b[38;5;241m=\u001b[39m \u001b[43mregistry\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpublic\u001b[49m\u001b[43m(\u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 147\u001b[0m df \u001b[38;5;241m=\u001b[39m prepare_dataframe(public\u001b[38;5;241m.\u001b[39mdf())\n\u001b[1;32m 149\u001b[0m \u001b[38;5;66;03m# TODO: consider StaticReference\u001b[39;00m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/models.py:394\u001b[0m, in \u001b[0;36mBioRecord.public\u001b[0;34m(cls, organism, source)\u001b[0m\n\u001b[1;32m 391\u001b[0m version \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 393\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 394\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mbionty_base\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 395\u001b[0m \u001b[43m \u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mversion\u001b[49m\n\u001b[1;32m 396\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 397\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (\u001b[38;5;167;01mAttributeError\u001b[39;00m, \u001b[38;5;167;01mValueError\u001b[39;00m):\n\u001b[1;32m 398\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m source \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/entities/_developmentalstage.py:26\u001b[0m, in \u001b[0;36mDevelopmentalStage.__init__\u001b[0;34m(self, organism, source, version, **kwargs)\u001b[0m\n\u001b[1;32m 19\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 21\u001b[0m organism: Optional[Literal[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhuman\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmouse\u001b[39m\u001b[38;5;124m\"\u001b[39m]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[1;32m 25\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m---> 26\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[1;32m 27\u001b[0m \u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 28\u001b[0m \u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mversion\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 29\u001b[0m \u001b[43m \u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 30\u001b[0m \u001b[43m \u001b[49m\u001b[43minclude_id_prefixes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhsapdv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mHsapDv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmmusdv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mMmusDv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 31\u001b[0m \u001b[43m \u001b[49m\u001b[43minclude_rel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mpart_of\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 32\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 33\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_public_ontology.py:56\u001b[0m, in \u001b[0;36mPublicOntology.__init__\u001b[0;34m(self, source, version, organism, include_id_prefixes, include_rel)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 48\u001b[0m source: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 53\u001b[0m include_rel: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 54\u001b[0m ):\n\u001b[1;32m 55\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 56\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fetch_sources\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 58\u001b[0m \u001b[38;5;66;03m# match user input organism, source and version with currently used sources\u001b[39;00m\n\u001b[1;32m 59\u001b[0m current \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_match_sources(\n\u001b[1;32m 60\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_sources,\n\u001b[1;32m 61\u001b[0m source\u001b[38;5;241m=\u001b[39msource,\n\u001b[1;32m 62\u001b[0m version\u001b[38;5;241m=\u001b[39mversion,\n\u001b[1;32m 63\u001b[0m organism\u001b[38;5;241m=\u001b[39morganism,\n\u001b[1;32m 64\u001b[0m )\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_public_ontology.py:177\u001b[0m, in \u001b[0;36mPublicOntology._fetch_sources\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_subset_to_entity\u001b[39m(df: pd\u001b[38;5;241m.\u001b[39mDataFrame, key: \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\u001b[38;5;241m.\u001b[39mloc[[key]] \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(df\u001b[38;5;241m.\u001b[39mloc[key], pd\u001b[38;5;241m.\u001b[39mSeries) \u001b[38;5;28;01melse\u001b[39;00m df\u001b[38;5;241m.\u001b[39mloc[key]\n\u001b[1;32m 176\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_sources \u001b[38;5;241m=\u001b[39m _subset_to_entity(\n\u001b[0;32m--> 177\u001b[0m \u001b[43mdisplay_currently_used_sources\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\n\u001b[1;32m 178\u001b[0m )\n\u001b[1;32m 180\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_all_sources \u001b[38;5;241m=\u001b[39m _subset_to_entity(\n\u001b[1;32m 181\u001b[0m display_available_sources(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\n\u001b[1;32m 182\u001b[0m )\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_display_sources.py:38\u001b[0m, in \u001b[0;36mdisplay_currently_used_sources\u001b[0;34m()\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Displays all currently used sources.\u001b[39;00m\n\u001b[1;32m 25\u001b[0m \n\u001b[1;32m 26\u001b[0m \u001b[38;5;124;03mActive version is unique for entity + organism.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[38;5;124;03m >>> bt.display_currently_used_sources()\u001b[39;00m\n\u001b[1;32m 31\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 32\u001b[0m VERSIONS_FILE_PATH \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 33\u001b[0m settings\u001b[38;5;241m.\u001b[39mlamindb_sources\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m LAMINDB_INSTANCE_LOADED()\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m settings\u001b[38;5;241m.\u001b[39mcurrent_sources\n\u001b[1;32m 36\u001b[0m )\n\u001b[0;32m---> 38\u001b[0m versions \u001b[38;5;241m=\u001b[39m \u001b[43mload_yaml\u001b[49m\u001b[43m(\u001b[49m\u001b[43mVERSIONS_FILE_PATH\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresolve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 40\u001b[0m df_rows \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m bionty_class, bionty_class_data \u001b[38;5;129;01min\u001b[39;00m versions\u001b[38;5;241m.\u001b[39mitems():\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/dev/_io.py:15\u001b[0m, in \u001b[0;36mload_yaml\u001b[0;34m(filename, convert_dates)\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_yaml\u001b[39m(\n\u001b[1;32m 13\u001b[0m filename: Union[\u001b[38;5;28mstr\u001b[39m, Path], convert_dates: \u001b[38;5;28mbool\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 14\u001b[0m ): \u001b[38;5;66;03m# pragma: no cover\u001b[39;00m\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m 16\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m yaml\u001b[38;5;241m.\u001b[39msafe_load(f)\n", - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/home/ml4ig1/.lamin/bionty/versions/.lamindb_current_sources.yaml'" - ] - } - ], - "source": [ - "#bt.Tissue.import_from_source() \n", - "bt.DevelopmentalStage.import_from_source() " - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "ename": "FileNotFoundError", - "evalue": "[Errno 2] No such file or directory: '/home/ml4ig1/.lamin/bionty/versions/.lamindb_current_sources.yaml'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[19], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mbt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDevelopmentalStage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpublic\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mdf()\u001b[38;5;241m.\u001b[39mloc[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mHsapDv:0000144\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mparents\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/models.py:394\u001b[0m, in \u001b[0;36mBioRecord.public\u001b[0;34m(cls, organism, source)\u001b[0m\n\u001b[1;32m 391\u001b[0m version \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 393\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 394\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mbionty_base\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 395\u001b[0m \u001b[43m \u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mversion\u001b[49m\n\u001b[1;32m 396\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 397\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (\u001b[38;5;167;01mAttributeError\u001b[39;00m, \u001b[38;5;167;01mValueError\u001b[39;00m):\n\u001b[1;32m 398\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m source \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/entities/_developmentalstage.py:26\u001b[0m, in \u001b[0;36mDevelopmentalStage.__init__\u001b[0;34m(self, organism, source, version, **kwargs)\u001b[0m\n\u001b[1;32m 19\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 21\u001b[0m organism: Optional[Literal[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhuman\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmouse\u001b[39m\u001b[38;5;124m\"\u001b[39m]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[1;32m 25\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m---> 26\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[1;32m 27\u001b[0m \u001b[43m \u001b[49m\u001b[43msource\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 28\u001b[0m \u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mversion\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 29\u001b[0m \u001b[43m \u001b[49m\u001b[43morganism\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43morganism\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 30\u001b[0m \u001b[43m \u001b[49m\u001b[43minclude_id_prefixes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhsapdv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mHsapDv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmmusdv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mMmusDv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 31\u001b[0m \u001b[43m \u001b[49m\u001b[43minclude_rel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mpart_of\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 32\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 33\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_public_ontology.py:56\u001b[0m, in \u001b[0;36mPublicOntology.__init__\u001b[0;34m(self, source, version, organism, include_id_prefixes, include_rel)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 48\u001b[0m source: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 53\u001b[0m include_rel: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 54\u001b[0m ):\n\u001b[1;32m 55\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 56\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fetch_sources\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 58\u001b[0m \u001b[38;5;66;03m# match user input organism, source and version with currently used sources\u001b[39;00m\n\u001b[1;32m 59\u001b[0m current \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_match_sources(\n\u001b[1;32m 60\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_sources,\n\u001b[1;32m 61\u001b[0m source\u001b[38;5;241m=\u001b[39msource,\n\u001b[1;32m 62\u001b[0m version\u001b[38;5;241m=\u001b[39mversion,\n\u001b[1;32m 63\u001b[0m organism\u001b[38;5;241m=\u001b[39morganism,\n\u001b[1;32m 64\u001b[0m )\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_public_ontology.py:177\u001b[0m, in \u001b[0;36mPublicOntology._fetch_sources\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_subset_to_entity\u001b[39m(df: pd\u001b[38;5;241m.\u001b[39mDataFrame, key: \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\u001b[38;5;241m.\u001b[39mloc[[key]] \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(df\u001b[38;5;241m.\u001b[39mloc[key], pd\u001b[38;5;241m.\u001b[39mSeries) \u001b[38;5;28;01melse\u001b[39;00m df\u001b[38;5;241m.\u001b[39mloc[key]\n\u001b[1;32m 176\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_sources \u001b[38;5;241m=\u001b[39m _subset_to_entity(\n\u001b[0;32m--> 177\u001b[0m \u001b[43mdisplay_currently_used_sources\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\n\u001b[1;32m 178\u001b[0m )\n\u001b[1;32m 180\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_all_sources \u001b[38;5;241m=\u001b[39m _subset_to_entity(\n\u001b[1;32m 181\u001b[0m display_available_sources(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\n\u001b[1;32m 182\u001b[0m )\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/_display_sources.py:38\u001b[0m, in \u001b[0;36mdisplay_currently_used_sources\u001b[0;34m()\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Displays all currently used sources.\u001b[39;00m\n\u001b[1;32m 25\u001b[0m \n\u001b[1;32m 26\u001b[0m \u001b[38;5;124;03mActive version is unique for entity + organism.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[38;5;124;03m >>> bt.display_currently_used_sources()\u001b[39;00m\n\u001b[1;32m 31\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 32\u001b[0m VERSIONS_FILE_PATH \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 33\u001b[0m settings\u001b[38;5;241m.\u001b[39mlamindb_sources\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m LAMINDB_INSTANCE_LOADED()\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m settings\u001b[38;5;241m.\u001b[39mcurrent_sources\n\u001b[1;32m 36\u001b[0m )\n\u001b[0;32m---> 38\u001b[0m versions \u001b[38;5;241m=\u001b[39m \u001b[43mload_yaml\u001b[49m\u001b[43m(\u001b[49m\u001b[43mVERSIONS_FILE_PATH\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresolve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 40\u001b[0m df_rows \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m bionty_class, bionty_class_data \u001b[38;5;129;01min\u001b[39;00m versions\u001b[38;5;241m.\u001b[39mitems():\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/bionty/base/dev/_io.py:15\u001b[0m, in \u001b[0;36mload_yaml\u001b[0;34m(filename, convert_dates)\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_yaml\u001b[39m(\n\u001b[1;32m 13\u001b[0m filename: Union[\u001b[38;5;28mstr\u001b[39m, Path], convert_dates: \u001b[38;5;28mbool\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 14\u001b[0m ): \u001b[38;5;66;03m# pragma: no cover\u001b[39;00m\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m 16\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m yaml\u001b[38;5;241m.\u001b[39msafe_load(f)\n", - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/home/ml4ig1/.lamin/bionty/versions/.lamindb_current_sources.yaml'" - ] - } - ], - "source": [ - "bt.DevelopmentalStage.public().df().loc[\"HsapDv:0000144\"].parents" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# we have a match between the sources" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [ - { - "ename": "KeyError", - "evalue": "'HsapDv:0000144'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/indexes/base.py:3805\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 3804\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 3805\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcasted_key\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3806\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n", - "File \u001b[0;32mindex.pyx:167\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mindex.pyx:196\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mpandas/_libs/hashtable_class_helper.pxi:7081\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mpandas/_libs/hashtable_class_helper.pxi:7089\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n", - "\u001b[0;31mKeyError\u001b[0m: 'HsapDv:0000144'", - "\nThe above exception was the direct cause of the following exception:\n", - "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[20], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mbt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDevelopmentalStage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfilter\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdf\u001b[49m\u001b[43m(\u001b[49m\u001b[43minclude\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mparents__ontology_id\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_index\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43montology_id\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mHsapDv:0000144\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241m.\u001b[39mparents__ontology_id\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/indexing.py:1191\u001b[0m, in \u001b[0;36m_LocationIndexer.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1189\u001b[0m maybe_callable \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mapply_if_callable(key, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mobj)\n\u001b[1;32m 1190\u001b[0m maybe_callable \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_deprecated_callable_usage(key, maybe_callable)\n\u001b[0;32m-> 1191\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_getitem_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmaybe_callable\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/indexing.py:1431\u001b[0m, in \u001b[0;36m_LocIndexer._getitem_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1429\u001b[0m \u001b[38;5;66;03m# fall thru to straight lookup\u001b[39;00m\n\u001b[1;32m 1430\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_validate_key(key, axis)\n\u001b[0;32m-> 1431\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_label\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/indexing.py:1381\u001b[0m, in \u001b[0;36m_LocIndexer._get_label\u001b[0;34m(self, label, axis)\u001b[0m\n\u001b[1;32m 1379\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_get_label\u001b[39m(\u001b[38;5;28mself\u001b[39m, label, axis: AxisInt):\n\u001b[1;32m 1380\u001b[0m \u001b[38;5;66;03m# GH#5567 this will fail if the label is not present in the axis.\u001b[39;00m\n\u001b[0;32m-> 1381\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mxs\u001b[49m\u001b[43m(\u001b[49m\u001b[43mlabel\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/generic.py:4301\u001b[0m, in \u001b[0;36mNDFrame.xs\u001b[0;34m(self, key, axis, level, drop_level)\u001b[0m\n\u001b[1;32m 4299\u001b[0m new_index \u001b[38;5;241m=\u001b[39m index[loc]\n\u001b[1;32m 4300\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 4301\u001b[0m loc \u001b[38;5;241m=\u001b[39m \u001b[43mindex\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4303\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(loc, np\u001b[38;5;241m.\u001b[39mndarray):\n\u001b[1;32m 4304\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m loc\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m np\u001b[38;5;241m.\u001b[39mbool_:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/pandas/core/indexes/base.py:3812\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 3807\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(casted_key, \u001b[38;5;28mslice\u001b[39m) \u001b[38;5;129;01mor\u001b[39;00m (\n\u001b[1;32m 3808\u001b[0m \u001b[38;5;28misinstance\u001b[39m(casted_key, abc\u001b[38;5;241m.\u001b[39mIterable)\n\u001b[1;32m 3809\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28many\u001b[39m(\u001b[38;5;28misinstance\u001b[39m(x, \u001b[38;5;28mslice\u001b[39m) \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m casted_key)\n\u001b[1;32m 3810\u001b[0m ):\n\u001b[1;32m 3811\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidIndexError(key)\n\u001b[0;32m-> 3812\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[1;32m 3813\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 3814\u001b[0m \u001b[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001b[39;00m\n\u001b[1;32m 3815\u001b[0m \u001b[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001b[39;00m\n\u001b[1;32m 3816\u001b[0m \u001b[38;5;66;03m# the TypeError.\u001b[39;00m\n\u001b[1;32m 3817\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_indexing_error(key)\n", - "\u001b[0;31mKeyError\u001b[0m: 'HsapDv:0000144'" - ] - } - ], - "source": [ - "bt.DevelopmentalStage.filter().df(include=[\"parents__ontology_id\"]).set_index(\"ontology_id\").loc[\"HsapDv:0000144\"].parents__ontology_id" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [], - "source": [ - "source = bt.PublicSource.filter(organism=\"mouse\", name=\"mmusdv\").last()" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [], - "source": [ - "bt.DevelopmentalStage.import_from_source(source=source)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "# delete all old artifacts\n", - "bt.Tissue.artifacts.through.objects.all().delete()\n", - "bt.Tissue.filter().delete()\n", - "bt.Disease.artifacts.through.objects.all().delete()\n", - "bt.Disease.filter().delete()\n", - "bt.CellType.artifacts.through.objects.all().delete()\n", - "bt.CellType.filter().delete()\n", - "bt.ExperimentalFactor.artifacts.through.objects.all().delete()\n", - "bt.ExperimentalFactor.filter().delete()\n", - "bt.Ethnicity.artifacts.through.objects.all().delete()\n", - "bt.Ethnicity.filter().delete()" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[92m→\u001b[0m returning existing Organism record with same name: 'unknown'\n", - "\u001b[92m→\u001b[0m returning existing Phenotype record with same name: 'unknown'\n", - "\u001b[93m!\u001b[0m record with similar name exists! did you mean to load it?\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
uidnameontology_idabbrsynonymsdescriptionmoleculeinstrumentmeasurementsource_idrun_idcreated_by_idupdated_at
id
2107363btPuBBfever of unknown originEFO:0003952NoneUnknown Origin Fever|Unknown Origin FeversFever In Which The Etiology Cannot Be Ascertai...NoneNoneNone78None12024-09-12 12:22:42.173128+00:00
\n", - "
" - ], - "text/plain": [ - " uid name ontology_id abbr \\\n", - "id \n", - "21073 63btPuBB fever of unknown origin EFO:0003952 None \n", - "\n", - " synonyms \\\n", - "id \n", - "21073 Unknown Origin Fever|Unknown Origin Fevers \n", - "\n", - " description molecule instrument \\\n", - "id \n", - "21073 Fever In Which The Etiology Cannot Be Ascertai... None None \n", - "\n", - " measurement source_id run_id created_by_id \\\n", - "id \n", - "21073 None 78 None 1 \n", - "\n", - " updated_at \n", - "id \n", - "21073 2024-09-12 12:22:42.173128+00:00 " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m DevelopmentalStage records from source (hsapdv, 2024-05-28) are already in the database!\n", - " → pass `update=True` to update the records\n", - "\u001b[93m!\u001b[0m DevelopmentalStage records from source (mmusdv, 2024-05-28) are already in the database!\n", - " → pass `update=True` to update the records\n", - "\u001b[92m→\u001b[0m returning existing DevelopmentalStage record with same name: 'unknown'\n", - "\u001b[93m!\u001b[0m records with similar names exist! did you mean to load one of them?\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
uidnameontology_idabbrsynonymsdescriptionsource_idrun_idcreated_by_idupdated_at
id
270757CKxLDluobsolete congenital abnormalityMONDO:0000839Nonecongenital abnormality|congenital anatomic Abn...Obsolete. Any Abnormality, Anatomical Or Bioch...69None12024-09-12 12:22:55.501725+00:00
271175pHdg2Icobsolete myeloid and lymphoid neoplasms with e...MONDO:0000881NoneNoneNone69None12024-09-12 12:22:55.504418+00:00
271205lzQM8ubmyeloid and lymphoid neoplasms associated with...MONDO:0000884NoneNoneNone69None12024-09-12 12:22:55.504609+00:00
\n", - "
" - ], - "text/plain": [ - " uid name \\\n", - "id \n", - "27075 7CKxLDlu obsolete congenital abnormality \n", - "27117 5pHdg2Ic obsolete myeloid and lymphoid neoplasms with e... \n", - "27120 5lzQM8ub myeloid and lymphoid neoplasms associated with... \n", - "\n", - " ontology_id abbr synonyms \\\n", - "id \n", - "27075 MONDO:0000839 None congenital abnormality|congenital anatomic Abn... \n", - "27117 MONDO:0000881 None None \n", - "27120 MONDO:0000884 None None \n", - "\n", - " description source_id run_id \\\n", - "id \n", - "27075 Obsolete. Any Abnormality, Anatomical Or Bioch... 69 None \n", - "27117 None 69 None \n", - "27120 None 69 None \n", - "\n", - " created_by_id updated_at \n", - "id \n", - "27075 1 2024-09-12 12:22:55.501725+00:00 \n", - "27117 1 2024-09-12 12:22:55.504418+00:00 \n", - "27120 1 2024-09-12 12:22:55.504609+00:00 " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m records with similar names exist! did you mean to load one of them?\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
uidnameontology_idabbrsynonymsdescriptionsource_idrun_idcreated_by_idupdated_at
id
339411wpjcCa5hemoglobin--variants for which the chain carry...MONDO:0007717NoneNoneNone69None12024-09-12 12:22:56.435466+00:00
428112C05jMg9sporadic adult-onset ataxia of unknown etiologyMONDO:0016591NoneSAOA|idiopathic late-onset cerebellar ataxiaSporadic Adult-Onset Ataxia Of Unknown Etiolog...69None12024-09-12 12:22:57.181985+00:00
429244sqESY3Dobsolete glial tumor of neuroepithelial tissue...MONDO:0016704NoneNoneNone69None12024-09-12 12:22:57.190972+00:00
\n", - "
" - ], - "text/plain": [ - " uid name \\\n", - "id \n", - "33941 1wpjcCa5 hemoglobin--variants for which the chain carry... \n", - "42811 2C05jMg9 sporadic adult-onset ataxia of unknown etiology \n", - "42924 4sqESY3D obsolete glial tumor of neuroepithelial tissue... \n", - "\n", - " ontology_id abbr synonyms \\\n", - "id \n", - "33941 MONDO:0007717 None None \n", - "42811 MONDO:0016591 None SAOA|idiopathic late-onset cerebellar ataxia \n", - "42924 MONDO:0016704 None None \n", - "\n", - " description source_id run_id \\\n", - "id \n", - "33941 None 69 None \n", - "42811 Sporadic Adult-Onset Ataxia Of Unknown Etiolog... 69 None \n", - "42924 None 69 None \n", - "\n", - " created_by_id updated_at \n", - "id \n", - "33941 1 2024-09-12 12:22:56.435466+00:00 \n", - "42811 1 2024-09-12 12:22:57.181985+00:00 \n", - "42924 1 2024-09-12 12:22:57.190972+00:00 " - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "# more straightforward\n", - "populate_my_ontology(organisms=[\"NCBITaxon:9544\", \"NCBITaxon:9483\", \"NCBITaxon:10090\", \"NCBITaxon:9606\"])" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[Disease(uid='4oYaDnBG', name='alopecia', ontology_id='MONDO:0004907', synonyms='alopecia|hair loss|loss Of hair', description='Hair Loss Usually From The Scalp. It May Result In Bald Spots Or Spread To The Entire Scalp Or The Entire Epidermis. It May Be Androgenetic Or Caused By Chemotherapeutic Agents, Compulsive Hair Pulling, Autoimmune Disorders Or Congenital Conditions.', created_by_id=1, source_id=69, updated_at='2024-09-12 12:22:56 UTC'),\n", - " Disease(uid='1KQgvwK8', name='hereditary skin disorder', ontology_id='MONDO:0100118', synonyms='genodermatosis|diseases, genetic skin|skin disease, genetic|genetic skin diseases|disease, genetic skin|genetic skin disease', description='An Instance Of Skin Disease That Is Caused By A Modification Of The Individual'S Genome.', created_by_id=1, source_id=69, updated_at='2024-09-12 12:22:58 UTC')]" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "list(bt.Disease.filter(ontology_id=\"MONDO:0000005\").one().parents.filter())" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array(['MONDO:0100118', 'MONDO:0004907'], dtype=object)" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "bt.Disease.public().df().loc[\"MONDO:0000005\"].parents" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# load the latest datasets / load datasets that were initially dropped" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[Collection(uid='dMyEX3NTfKOEYXyMu591', version='2023-12-15', is_latest=False, name='cellxgene-census', hash='0NB32iVKG5ttaW5XILvG', visibility=1, created_by_id=1, transform_id=19, run_id=24, updated_at='2024-01-30 09:09:49 UTC'),\n", - " Collection(uid='dMyEX3NTfKOEYXyMKDAQ', version='2023-07-25', is_latest=False, name='cellxgene-census', hash='pEJ9uvIeTLvHkZW2TBT5', visibility=1, created_by_id=1, transform_id=18, run_id=23, updated_at='2024-01-30 09:06:05 UTC'),\n", - " Collection(uid='dMyEX3NTfKOEYXyMKDD7', version='2024-07-01', is_latest=True, name='cellxgene-census', hash='nI8Ag-HANeOpZOz-8CSn', visibility=1, created_by_id=1, transform_id=22, run_id=27, updated_at='2024-07-16 12:24:38 UTC')]" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "list(ln.Collection.using(instance=\"laminlabs/cellxgene\").filter(name=\"cellxgene-census\").all())" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "(Collection(uid='dMyEX3NTfKOEYXyMKDD7', version='2024-07-01', is_latest=True, name='cellxgene-census', hash='nI8Ag-HANeOpZOz-8CSn', visibility=1, created_by_id=1, transform_id=22, run_id=27, updated_at='2024-07-16 12:24:38 UTC'),\n", - " 812)" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset = ln.Collection.using(instance=\"laminlabs/cellxgene\").filter(name=\"cellxgene-census\", version='2024-07-01').one()\n", - "cx_dataset, len(cx_dataset.artifacts.all())" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m renewing expired lamin token: call `lamin login` to avoid this\n", - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "(Collection(uid='dMyEX3NTfKOEYXyMu591', version='2023-12-15', is_latest=False, name='cellxgene-census', hash='0NB32iVKG5ttaW5XILvG', visibility=1, created_by_id=1, transform_id=19, run_id=24, updated_at='2024-01-30 09:09:49 UTC'),\n", - " 1113)" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset_2 = ln.Collection.using(instance=\"laminlabs/cellxgene\").filter(name=\"cellxgene-census\", version='2023-12-15').one()\n", - "cx_dataset_2, len(cx_dataset_2.artifacts.all())" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "'cell-census/2024-07-01/h5ads/0041b9c3-6a49-4bf7-8514-9bc7190067a7.h5ad'" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset.artifacts.all()[0].key" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "'0041b9c3-6a49-4bf7-8514-9bc7190067a7.h5ad'" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset.artifacts.all()[0].key.split(\"/\")[-1]" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n", - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "129" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(set([a.key.split(\"/\")[-1] for a in cx_dataset.artifacts.all()]) - set([a.key.split(\"/\")[-1] for a in cx_dataset_2.artifacts.all()]))" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n", - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "683" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(set([a.key.split(\"/\")[-1] for a in cx_dataset.artifacts.all()]) & set([a.key.split(\"/\")[-1] for a in cx_dataset_2.artifacts.all()]))" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n", - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n" - ] - }, - { - "data": { - "text/plain": [ - "430" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "a = set([a.key.split(\"/\")[-1] for a in cx_dataset_2.artifacts.all()]) - set([a.key.split(\"/\")[-1] for a in cx_dataset.artifacts.all()])\n", - "a = list(a)\n", - "len(a)" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'Joint scRNA-seq and scATAC-seq atlas of the adult human retina'" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset_2.artifacts.filter(key=\"cell-census/2023-12-15/h5ads/\"+a[20]).one().description" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "from scdataloader.preprocess import (\n", - " LaminPreprocessor,\n", - " additional_postprocess,\n", - " additional_preprocess,\n", - ")\n", - "\n", - "DESCRIPTION='scPRINT-V2 datasets'\n", - "\n", - "\n", - "do_preprocess = LaminPreprocessor(additional_postprocess=additional_postprocess, additional_preprocess=additional_preprocess, skip_validate=False, subset_hvg=3000, cache=False, stream=True, filter_gene_by_counts=False, filter_cell_by_counts=500, min_valid_genes_id=4000, min_nnz_genes=150, maxdropamount=90, organisms=[\"NCBITaxon:9606\", \"NCBITaxon:9544\", \"NCBITaxon:9483\", \"NCBITaxon:10090\"], batch_key=\"assay_ontology_term_id\")" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[93m!\u001b[0m no run & transform get linked, consider calling ln.context.track()\n", - "13\n", - "Artifact(uid='R4ZHoQegxXdSFNFYJ146', version='2023-12-15', is_latest=False, description='A proximal-to-distal survey of healthy adult human small intestine and colon epithelium by single-cell transcriptomics', key='cell-census/2023-12-15/h5ads/019c7af2-c827-4454-9970-44d5e39ce068.h5ad', suffix='.h5ad', size=1746683238, hash='5JSpfZdzeM1Tlicvx6-A0g', n_observations=12590, _hash_type='md5-n', _accessor='AnnData', visibility=1, _key_is_virtual=False, created_by_id=1, storage_id=2, transform_id=16, run_id=22, updated_at='2024-01-29 07:45:47 UTC')\n" - ] - }, - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[4], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m preprocessed_dataset \u001b[38;5;241m=\u001b[39m \u001b[43mdo_preprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcx_dataset_2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mDESCRIPTION\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdescription\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mDESCRIPTION\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstart_at\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m13\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m3\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Documents code/scDataLoader/scdataloader/preprocess.py:447\u001b[0m, in \u001b[0;36mLaminPreprocessor.__call__\u001b[0;34m(self, data, name, description, start_at, version)\u001b[0m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m file\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m<\u001b[39m\u001b[38;5;241m=\u001b[39m MAXFILESIZE:\n\u001b[0;32m--> 447\u001b[0m adata \u001b[38;5;241m=\u001b[39m \u001b[43mfile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 448\u001b[0m \u001b[38;5;28mprint\u001b[39m(adata)\n\u001b[1;32m 449\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/lamindb/_artifact.py:967\u001b[0m, in \u001b[0;36mload\u001b[0;34m(self, is_run_input, stream, **kwargs)\u001b[0m\n\u001b[1;32m 965\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 966\u001b[0m using_key \u001b[38;5;241m=\u001b[39m settings\u001b[38;5;241m.\u001b[39m_using_key\n\u001b[0;32m--> 967\u001b[0m access_memory \u001b[38;5;241m=\u001b[39m \u001b[43mload_to_memory\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 968\u001b[0m \u001b[43m \u001b[49m\u001b[43mfilepath_from_artifact\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43musing_key\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43musing_key\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\n\u001b[1;32m 969\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 970\u001b[0m \u001b[38;5;66;03m# only call if load is successfull\u001b[39;00m\n\u001b[1;32m 971\u001b[0m _track_run_input(\u001b[38;5;28mself\u001b[39m, is_run_input)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/lamindb/core/storage/paths.py:245\u001b[0m, in \u001b[0;36mload_to_memory\u001b[0;34m(filepath, stream, **kwargs)\u001b[0m\n\u001b[1;32m 243\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m filepath\n\u001b[1;32m 244\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 245\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mreader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/lamindb/core/storage/paths.py:109\u001b[0m, in \u001b[0;36mread_adata_h5ad\u001b[0;34m(filepath, **kwargs)\u001b[0m\n\u001b[1;32m 106\u001b[0m fs, filepath \u001b[38;5;241m=\u001b[39m infer_filesystem(filepath)\n\u001b[1;32m 108\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m fs\u001b[38;5;241m.\u001b[39mopen(filepath, mode\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrb\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m file:\n\u001b[0;32m--> 109\u001b[0m adata \u001b[38;5;241m=\u001b[39m \u001b[43mad\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_h5ad\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbacked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 110\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m adata\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/h5ad.py:261\u001b[0m, in \u001b[0;36mread_h5ad\u001b[0;34m(filename, backed, as_sparse, as_sparse_fmt, chunk_size)\u001b[0m\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m read_dataframe(elem)\n\u001b[1;32m 259\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(elem)\n\u001b[0;32m--> 261\u001b[0m adata \u001b[38;5;241m=\u001b[39m \u001b[43mread_dispatched\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallback\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcallback\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 263\u001b[0m \u001b[38;5;66;03m# Backwards compat (should figure out which version)\u001b[39;00m\n\u001b[1;32m 264\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mraw.X\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m f:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/experimental/_dispatch_io.py:48\u001b[0m, in \u001b[0;36mread_dispatched\u001b[0;34m(elem, callback)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01manndata\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_io\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mspecs\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m _REGISTRY, Reader\n\u001b[1;32m 46\u001b[0m reader \u001b[38;5;241m=\u001b[39m Reader(_REGISTRY, callback\u001b[38;5;241m=\u001b[39mcallback)\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_elem\u001b[49m\u001b[43m(\u001b[49m\u001b[43melem\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/utils.py:207\u001b[0m, in \u001b[0;36mreport_read_key_on_error..func_wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 205\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo element found in args.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 207\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 209\u001b[0m path, key \u001b[38;5;241m=\u001b[39m _get_display_path(store)\u001b[38;5;241m.\u001b[39mrsplit(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;241m1\u001b[39m)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/specs/registry.py:256\u001b[0m, in \u001b[0;36mReader.read_elem\u001b[0;34m(self, elem, modifiers)\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcallback \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 255\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m read_func(elem)\n\u001b[0;32m--> 256\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcallback\u001b[49m\u001b[43m(\u001b[49m\u001b[43mread_func\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43melem\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43melem\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43miospec\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43miospec\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/h5ad.py:242\u001b[0m, in \u001b[0;36mread_h5ad..callback\u001b[0;34m(func, elem_name, elem, iospec)\u001b[0m\n\u001b[1;32m 239\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcallback\u001b[39m(func, elem_name: \u001b[38;5;28mstr\u001b[39m, elem, iospec):\n\u001b[1;32m 240\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m iospec\u001b[38;5;241m.\u001b[39mencoding_type \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124manndata\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m elem_name\u001b[38;5;241m.\u001b[39mendswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 241\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m AnnData(\n\u001b[0;32m--> 242\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m{\n\u001b[1;32m 243\u001b[0m \u001b[38;5;66;03m# This is covering up backwards compat in the anndata initializer\u001b[39;00m\n\u001b[1;32m 244\u001b[0m \u001b[38;5;66;03m# In most cases we should be able to call `func(elen[k])` instead\u001b[39;00m\n\u001b[1;32m 245\u001b[0m k: read_dispatched(elem[k], callback)\n\u001b[1;32m 246\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m elem\u001b[38;5;241m.\u001b[39mkeys()\n\u001b[1;32m 247\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m k\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mraw.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 248\u001b[0m }\n\u001b[1;32m 249\u001b[0m )\n\u001b[1;32m 250\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m elem_name\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/raw.\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 251\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/h5ad.py:245\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 239\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcallback\u001b[39m(func, elem_name: \u001b[38;5;28mstr\u001b[39m, elem, iospec):\n\u001b[1;32m 240\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m iospec\u001b[38;5;241m.\u001b[39mencoding_type \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124manndata\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m elem_name\u001b[38;5;241m.\u001b[39mendswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 241\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m AnnData(\n\u001b[1;32m 242\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m{\n\u001b[1;32m 243\u001b[0m \u001b[38;5;66;03m# This is covering up backwards compat in the anndata initializer\u001b[39;00m\n\u001b[1;32m 244\u001b[0m \u001b[38;5;66;03m# In most cases we should be able to call `func(elen[k])` instead\u001b[39;00m\n\u001b[0;32m--> 245\u001b[0m k: \u001b[43mread_dispatched\u001b[49m\u001b[43m(\u001b[49m\u001b[43melem\u001b[49m\u001b[43m[\u001b[49m\u001b[43mk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallback\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 246\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m elem\u001b[38;5;241m.\u001b[39mkeys()\n\u001b[1;32m 247\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m k\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mraw.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 248\u001b[0m }\n\u001b[1;32m 249\u001b[0m )\n\u001b[1;32m 250\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m elem_name\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/raw.\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 251\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/experimental/_dispatch_io.py:48\u001b[0m, in \u001b[0;36mread_dispatched\u001b[0;34m(elem, callback)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01manndata\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_io\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mspecs\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m _REGISTRY, Reader\n\u001b[1;32m 46\u001b[0m reader \u001b[38;5;241m=\u001b[39m Reader(_REGISTRY, callback\u001b[38;5;241m=\u001b[39mcallback)\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mreader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_elem\u001b[49m\u001b[43m(\u001b[49m\u001b[43melem\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/utils.py:207\u001b[0m, in \u001b[0;36mreport_read_key_on_error..func_wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 205\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo element found in args.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 207\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 209\u001b[0m path, key \u001b[38;5;241m=\u001b[39m _get_display_path(store)\u001b[38;5;241m.\u001b[39mrsplit(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;241m1\u001b[39m)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/specs/registry.py:256\u001b[0m, in \u001b[0;36mReader.read_elem\u001b[0;34m(self, elem, modifiers)\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcallback \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 255\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m read_func(elem)\n\u001b[0;32m--> 256\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcallback\u001b[49m\u001b[43m(\u001b[49m\u001b[43mread_func\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43melem\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43melem\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43miospec\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43miospec\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/h5ad.py:259\u001b[0m, in \u001b[0;36mread_h5ad..callback\u001b[0;34m(func, elem_name, elem, iospec)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m elem_name \u001b[38;5;129;01min\u001b[39;00m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/obs\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/var\u001b[39m\u001b[38;5;124m\"\u001b[39m}:\n\u001b[1;32m 257\u001b[0m \u001b[38;5;66;03m# Backwards compat\u001b[39;00m\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m read_dataframe(elem)\n\u001b[0;32m--> 259\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43melem\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_io/specs/methods.py:604\u001b[0m, in \u001b[0;36mread_sparse\u001b[0;34m(elem, _reader)\u001b[0m\n\u001b[1;32m 599\u001b[0m \u001b[38;5;129m@_REGISTRY\u001b[39m\u001b[38;5;241m.\u001b[39mregister_read(H5Group, IOSpec(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcsc_matrix\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0.1.0\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 600\u001b[0m \u001b[38;5;129m@_REGISTRY\u001b[39m\u001b[38;5;241m.\u001b[39mregister_read(H5Group, IOSpec(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcsr_matrix\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0.1.0\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 601\u001b[0m \u001b[38;5;129m@_REGISTRY\u001b[39m\u001b[38;5;241m.\u001b[39mregister_read(ZarrGroup, IOSpec(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcsc_matrix\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0.1.0\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 602\u001b[0m \u001b[38;5;129m@_REGISTRY\u001b[39m\u001b[38;5;241m.\u001b[39mregister_read(ZarrGroup, IOSpec(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcsr_matrix\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0.1.0\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 603\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mread_sparse\u001b[39m(elem, _reader):\n\u001b[0;32m--> 604\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msparse_dataset\u001b[49m\u001b[43m(\u001b[49m\u001b[43melem\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_memory\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/anndata/_core/sparse_dataset.py:532\u001b[0m, in \u001b[0;36mBaseCompressedSparseDataset.to_memory\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 530\u001b[0m format_class \u001b[38;5;241m=\u001b[39m get_memory_class(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mformat)\n\u001b[1;32m 531\u001b[0m mtx \u001b[38;5;241m=\u001b[39m format_class(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mshape, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdtype)\n\u001b[0;32m--> 532\u001b[0m mtx\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgroup\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mdata\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 533\u001b[0m mtx\u001b[38;5;241m.\u001b[39mindices \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mgroup[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mindices\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;241m.\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;241m.\u001b[39m]\n\u001b[1;32m 534\u001b[0m mtx\u001b[38;5;241m.\u001b[39mindptr \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mindptr\n", - "File \u001b[0;32mh5py/_objects.pyx:54\u001b[0m, in \u001b[0;36mh5py._objects.with_phil.wrapper\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mh5py/_objects.pyx:55\u001b[0m, in \u001b[0;36mh5py._objects.with_phil.wrapper\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/h5py/_hl/dataset.py:758\u001b[0m, in \u001b[0;36mDataset.__getitem__\u001b[0;34m(self, args, new_dtype)\u001b[0m\n\u001b[1;32m 756\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_fast_read_ok \u001b[38;5;129;01mand\u001b[39;00m (new_dtype \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[1;32m 757\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 758\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fast_reader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 759\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 760\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m \u001b[38;5;66;03m# Fall back to Python read pathway below\u001b[39;00m\n", - "File \u001b[0;32mh5py/_selector.pyx:376\u001b[0m, in \u001b[0;36mh5py._selector.Reader.read\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mh5py/h5fd.pyx:163\u001b[0m, in \u001b[0;36mh5py.h5fd.H5FD_fileobj_read\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/fsspec/spec.py:1959\u001b[0m, in \u001b[0;36mAbstractBufferedFile.readinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 1954\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"mirrors builtin file's readinto method\u001b[39;00m\n\u001b[1;32m 1955\u001b[0m \n\u001b[1;32m 1956\u001b[0m \u001b[38;5;124;03mhttps://docs.python.org/3/library/io.html#io.RawIOBase.readinto\u001b[39;00m\n\u001b[1;32m 1957\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1958\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmemoryview\u001b[39m(b)\u001b[38;5;241m.\u001b[39mcast(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mB\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m-> 1959\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mout\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnbytes\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1960\u001b[0m out[: \u001b[38;5;28mlen\u001b[39m(data)] \u001b[38;5;241m=\u001b[39m data\n\u001b[1;32m 1961\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(data)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/fsspec/spec.py:1941\u001b[0m, in \u001b[0;36mAbstractBufferedFile.read\u001b[0;34m(self, length)\u001b[0m\n\u001b[1;32m 1938\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m length \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 1939\u001b[0m \u001b[38;5;66;03m# don't even bother calling fetch\u001b[39;00m\n\u001b[1;32m 1940\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1941\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcache\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fetch\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mlength\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1943\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\n\u001b[1;32m 1944\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m read: \u001b[39m\u001b[38;5;132;01m%i\u001b[39;00m\u001b[38;5;124m - \u001b[39m\u001b[38;5;132;01m%i\u001b[39;00m\u001b[38;5;124m \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 1945\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1948\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcache\u001b[38;5;241m.\u001b[39m_log_stats(),\n\u001b[1;32m 1949\u001b[0m )\n\u001b[1;32m 1950\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(out)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/fsspec/caching.py:234\u001b[0m, in \u001b[0;36mReadAheadCache._fetch\u001b[0;34m(self, start, end)\u001b[0m\n\u001b[1;32m 232\u001b[0m end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmin\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msize, end \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mblocksize)\n\u001b[1;32m 233\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtotal_requested_bytes \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m end \u001b[38;5;241m-\u001b[39m start\n\u001b[0;32m--> 234\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcache \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfetcher\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# new block replaces old\u001b[39;00m\n\u001b[1;32m 235\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart \u001b[38;5;241m=\u001b[39m start\n\u001b[1;32m 236\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mend \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mlen\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcache)\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/s3fs/core.py:2303\u001b[0m, in \u001b[0;36mS3File._fetch_range\u001b[0;34m(self, start, end)\u001b[0m\n\u001b[1;32m 2301\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_fetch_range\u001b[39m(\u001b[38;5;28mself\u001b[39m, start, end):\n\u001b[1;32m 2302\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 2303\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_fetch_range\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2304\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2305\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbucket\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2306\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2307\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mversion_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2308\u001b[0m \u001b[43m \u001b[49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2309\u001b[0m \u001b[43m \u001b[49m\u001b[43mend\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2310\u001b[0m \u001b[43m \u001b[49m\u001b[43mreq_kw\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreq_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2311\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2313\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m ex:\n\u001b[1;32m 2314\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ex\u001b[38;5;241m.\u001b[39margs[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m==\u001b[39m errno\u001b[38;5;241m.\u001b[39mEINVAL \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpre-conditions\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m ex\u001b[38;5;241m.\u001b[39margs[\u001b[38;5;241m1\u001b[39m]:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/s3fs/core.py:2465\u001b[0m, in \u001b[0;36m_fetch_range\u001b[0;34m(fs, bucket, key, version_id, start, end, req_kw)\u001b[0m\n\u001b[1;32m 2463\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2464\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFetch: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m/\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m-\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, bucket, key, start, end)\n\u001b[0;32m-> 2465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_inner_fetch\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbucket\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreq_kw\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/site-packages/fsspec/asyn.py:91\u001b[0m, in \u001b[0;36msync\u001b[0;34m(loop, func, timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 88\u001b[0m asyncio\u001b[38;5;241m.\u001b[39mrun_coroutine_threadsafe(_runner(event, coro, result, timeout), loop)\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m 90\u001b[0m \u001b[38;5;66;03m# this loops allows thread to get interrupted\u001b[39;00m\n\u001b[0;32m---> 91\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mevent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwait\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 92\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[1;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/threading.py:607\u001b[0m, in \u001b[0;36mEvent.wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 605\u001b[0m signaled \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_flag\n\u001b[1;32m 606\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m signaled:\n\u001b[0;32m--> 607\u001b[0m signaled \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cond\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwait\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m signaled\n", - "File \u001b[0;32m~/miniconda3/envs/scprint/lib/python3.10/threading.py:324\u001b[0m, in \u001b[0;36mCondition.wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 323\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m--> 324\u001b[0m gotit \u001b[38;5;241m=\u001b[39m \u001b[43mwaiter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 325\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 326\u001b[0m gotit \u001b[38;5;241m=\u001b[39m waiter\u001b[38;5;241m.\u001b[39macquire(\u001b[38;5;28;01mFalse\u001b[39;00m)\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " - ] - } - ], - "source": [ - "preprocessed_dataset = do_preprocess(cx_dataset_2, name=DESCRIPTION, description=DESCRIPTION, start_at=13, version=\"3\")" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[Artifact(uid='Mgilie8RUip2slElOmPq', version='3', is_latest=True, description='scPRINT-V2 datasets', suffix='.h5ad', size=489810414, hash='7-paLQLkX3je-5v0oWz7XD', _hash_type='sha1-fl', _accessor='AnnData', visibility=1, _key_is_virtual=True, created_by_id=1, storage_id=1, updated_at='2024-09-18 13:26:29 UTC'),\n", - " Artifact(uid='iAZPSOBKLpaK7lqyeq5B', version='3', is_latest=True, description='scPRINT-V2 datasets', suffix='.h5ad', size=609504688, hash='ucyfECH2v6qBVTByiQ45Wk', _hash_type='sha1-fl', _accessor='AnnData', visibility=1, _key_is_virtual=True, created_by_id=1, storage_id=1, updated_at='2024-09-18 13:31:43 UTC'),\n", - " Artifact(uid='8Nvv13lKsjEHL8dndOjz', version='3', is_latest=True, description='scPRINT-V2 datasets', suffix='.h5ad', size=2705747907, hash='vNLVHW_JMWMXgEAtDsvr9a', _hash_type='sha1-fl', _accessor='AnnData', visibility=1, _key_is_virtual=True, created_by_id=1, storage_id=1, updated_at='2024-09-18 13:50:47 UTC'),\n", - " Artifact(uid='qA6JWwBI3uNVjUqXJECH', version='3', is_latest=True, description='scPRINT-V2 datasets', suffix='.h5ad', size=854708940, hash='0Z2MUnPBkw3B6jCpMSckUG', _hash_type='sha1-fl', _accessor='AnnData', visibility=1, _key_is_virtual=True, created_by_id=1, storage_id=1, updated_at='2024-09-18 13:57:16 UTC'),\n", - " Artifact(uid='UEE9mPND42ONqZUCGBXy', version='3', is_latest=True, description='scPRINT-V2 datasets', suffix='.h5ad', size=1248097203, hash='ra3V8C0j6ygPDoDaW8q5kE', _hash_type='sha1-fl', _accessor='AnnData', visibility=1, _key_is_virtual=True, created_by_id=1, storage_id=1, updated_at='2024-09-18 14:10:03 UTC')]" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "list(ln.Artifact.filter(version=\"3\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 57, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "430" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len([i for i in cx_dataset_2.artifacts.filter() if i.is_latest])" - ] - }, - { - "cell_type": "code", - "execution_count": 54, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 54, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cx_dataset_2.artifacts.filter()[3].open().obs.is_primary_data.sum()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "scprint", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.15" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/scprint/__init__.py b/scprint/__init__.py index 49f9074..23e7d73 100644 --- a/scprint/__init__.py +++ b/scprint/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.1" +__version__ = "1.6.2" from .model.model import scPrint diff --git a/scprint/model/model.py b/scprint/model/model.py index f1c10f5..3be049d 100644 --- a/scprint/model/model.py +++ b/scprint/model/model.py @@ -324,6 +324,7 @@ def on_load_checkpoint(self, checkpoints): n_cls=size, ) classes = checkpoints["hyper_parameters"]["classes"] + self.normalization = checkpoints["hyper_parameters"]["normalization"] self.label_decoders = checkpoints["hyper_parameters"]["label_decoders"] self.labels_hierarchy = checkpoints["hyper_parameters"]["labels_hierarchy"] for k, v in self.labels_hierarchy.items(): @@ -344,7 +345,7 @@ def on_load_checkpoint(self, checkpoints): in mencoders ): self.trainer.datamodule.kwargs["collate_fn"]._setup( - mencoders[ + org_to_id=mencoders[ self.trainer.datamodule.kwargs["collate_fn"].organism_name ], valid_genes=self.genes, @@ -874,6 +875,7 @@ def _compute_loss( do_ecs=False, do_adv_cls=False, do_adv_batch=False, + do_mse=0, ): """ _compute_loss compute the loss of the model given output from the forward pass @@ -887,6 +889,9 @@ def _compute_loss( Defaults to False. do_adv_cls (bool, optional): A flag to indicate whether to perform adversarial classification. Defaults to False. + do_mse (float, optional): A scaling factor to indicate whether and how much to weight mean + squared error loss in addition to zinb loss. + Defaults to 0. Raises: ValueError: Raised when an invalid operation or input is encountered. @@ -904,6 +909,12 @@ def _compute_loss( mu=output["mean"], target=expression, ) + if do_mse: + loss_expr += loss.mse( + input=torch.log(output["mean"] + 1) + * (1 - torch.sigmoid(output["zero_logits"])), + target=torch.log(expression + 1), + ) elif "disp" in output: loss_expr = loss.nb( theta=output["disp"], diff --git a/scprint/tasks/cell_emb.py b/scprint/tasks/cell_emb.py index 22afde1..931f0d6 100644 --- a/scprint/tasks/cell_emb.py +++ b/scprint/tasks/cell_emb.py @@ -411,7 +411,9 @@ def default_benchmark( embedder = Embedder( pred_embedding=["cell_type_ontology_term_id"], doclass=(default_dataset not in ["pancreas", "lung"]), - devices=1, + max_len=4000, + keep_all_cls_pred=False, + output_expression="none", ) embed_adata, metrics = embedder(model, adata.copy()) diff --git a/uv.lock b/uv.lock index 62001e9..ce4e0bd 100644 --- a/uv.lock +++ b/uv.lock @@ -1387,6 +1387,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c9/f2/f925f787460274f34675d5048c52e9a7018d636fe1b1abdb686d3125fbf6/fastobo-0.12.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:958da0f135270da6fcfb8181114e5f631e77bc11ad897112039764af19085183", size = 1642228 }, ] +[[package]] +name = "fcsparser" +version = "0.2.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "pandas" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/7b/b8decfe3b0e6c2aca4e9069bb80f54960fe6405a6bf63c01a9ca685ba5c6/fcsparser-0.2.8.tar.gz", hash = "sha256:df0436bf678df1f4ad3274e55fa06773f884fa45d8329015913a6178d10c73ea", size = 14538608 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/10/bfdc8e5b35896d8134a9637ce51c6686f60d8a10fe511de2e07accb8b407/fcsparser-0.2.8-py3-none-any.whl", hash = "sha256:833b02ceff18f34c9304681f5b6675039f5b39a31dfdd9640881f43223bcc2ab", size = 14613064 }, +] + [[package]] name = "filelock" version = "3.16.0" @@ -1753,6 +1766,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2b/b2/0ee327933ffa37af1fc7915df7fc067e6009adcd8445d55ad07a9bec11b5/h5py-3.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:21dbdc5343f53b2e25404673c4f00a3335aef25521bd5fa8c707ec3833934892", size = 2970991 }, ] +[[package]] +name = "harmonypy" +version = "0.0.10" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "pandas" }, + { name = "scikit-learn" }, + { name = "scipy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/1a/69/9af6183745618057797b940a76320c52a38ad2a69e688e6345e2a0219655/harmonypy-0.0.10.tar.gz", hash = "sha256:27bd39a6f9ada1708ffa577e46c9b7363d1e2fd62740e477ce11fd61819a54df", size = 20339 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/cd/9479dd66e503af191edc016a302d2125c4f02ea777ebea1e48f6b944b073/harmonypy-0.0.10-py3-none-any.whl", hash = "sha256:dab528052f909204e521c9c2bd980221c64003538b0c0fe25be2e43c1199282b", size = 20885 }, +] + [[package]] name = "hdbscan" version = "0.8.39" @@ -2074,6 +2102,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/13/1bb2bcb4d9f4719dd5f3d98f5c2fc2235f961ced576366b040372eebdb17/jaxlib-0.4.31-cp312-cp312-win_amd64.whl", hash = "sha256:c4bfd15315e30525514b7262d555bea00745b09ac9818bb14c20ef8afbbab072", size = 56299104 }, ] +[[package]] +name = "jaxopt" +version = "0.8.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jax" }, + { name = "jaxlib" }, + { name = "numpy" }, + { name = "scipy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f9/af/73f7514ea14d6aba0a851e03afbdd532a7af896577c708c6ce405917ce80/jaxopt-0.8.3.tar.gz", hash = "sha256:4b06dfa6f915a4f3291699606245af6069371a48dc5c92d4c507840d62990646", size = 121236 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/a4/fc292a90a9c51d1b633cdffe2df30c702e1e0b3e0b568c7b81004cac0a06/jaxopt-0.8.3-py3-none-any.whl", hash = "sha256:4be2f82798393682529c9ca5046e5397ac6c8657b8acb6bf275e773b28df15b6", size = 172264 }, +] + [[package]] name = "jedi" version = "0.19.1" @@ -2777,6 +2820,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979 }, ] +[[package]] +name = "mellon" +version = "1.4.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jax" }, + { name = "jaxopt" }, + { name = "numpy" }, + { name = "scikit-learn" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b5/87/2b0a0436321e189552095439c6f6a08beb2ebbcea2103f2f5b13926fd6df/mellon-1.4.3.tar.gz", hash = "sha256:388815906245ed47041442f482ae0a77699949d40d69fb50bd1197dcef9b8e8b", size = 92055 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/ba/ff60f299d2c0977c1683a3dc4a8b3150d9b5293fa444c8ba4ee714bd9efe/mellon-1.4.3-py3-none-any.whl", hash = "sha256:91607e39d6e8b6804722c96924a28f74cc1403ed14dd9f1bd49d17ec49df0353", size = 95963 }, +] + [[package]] name = "mergedeep" version = "1.3.4" @@ -3143,8 +3201,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/bc/f7/7ec7fddc92e50714ea3745631f79bd9c96424cb2702632521028e57d3a36/multiprocess-0.70.16-py310-none-any.whl", hash = "sha256:c4a9944c67bd49f823687463660a2d6daae94c289adff97e0f9d696ba6371d02", size = 134824 }, { url = "https://files.pythonhosted.org/packages/50/15/b56e50e8debaf439f44befec5b2af11db85f6e0f344c3113ae0be0593a91/multiprocess-0.70.16-py311-none-any.whl", hash = "sha256:af4cabb0dac72abfb1e794fa7855c325fd2b55a10a44628a3c1ad3311c04127a", size = 143519 }, { url = "https://files.pythonhosted.org/packages/0a/7d/a988f258104dcd2ccf1ed40fdc97e26c4ac351eeaf81d76e266c52d84e2f/multiprocess-0.70.16-py312-none-any.whl", hash = "sha256:fc0544c531920dde3b00c29863377f87e1632601092ea2daca74e4beb40faa2e", size = 146741 }, - { url = "https://files.pythonhosted.org/packages/ea/89/38df130f2c799090c978b366cfdf5b96d08de5b29a4a293df7f7429fa50b/multiprocess-0.70.16-py38-none-any.whl", hash = "sha256:a71d82033454891091a226dfc319d0cfa8019a4e888ef9ca910372a446de4435", size = 132628 }, - { url = "https://files.pythonhosted.org/packages/da/d9/f7f9379981e39b8c2511c9e0326d212accacb82f12fbfdc1aa2ce2a7b2b6/multiprocess-0.70.16-py39-none-any.whl", hash = "sha256:a0bafd3ae1b732eac64be2e72038231c1ba97724b60b09400d68f229fcc2fbf3", size = 133351 }, ] [[package]] @@ -3591,6 +3647,30 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746 }, ] +[[package]] +name = "palantir" +version = "1.3.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anndata" }, + { name = "fcsparser" }, + { name = "joblib" }, + { name = "leidenalg" }, + { name = "matplotlib" }, + { name = "mellon" }, + { name = "networkx" }, + { name = "numpy" }, + { name = "pandas" }, + { name = "pygam" }, + { name = "scanpy" }, + { name = "scikit-learn" }, + { name = "scipy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dd/6c/3fd143141e3674b46513701c32c4a5ad5f8357264179695fe671330f3cef/palantir-1.3.3.tar.gz", hash = "sha256:915bb802e01f282d309fab02062caa4e790535279c14f6c15823cdaa01ba7a56", size = 51575 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/d7/73adcb0b35ccd15cbcf952f29f16acadac6a684b14a82ba25e7618c32f65/palantir-1.3.3-py3-none-any.whl", hash = "sha256:384ab841582c62912b7424cb2a73fff989c1fcb1d82e42a8570fa33440501052", size = 50531 }, +] + [[package]] name = "pandas" version = "2.2.2" @@ -3835,6 +3915,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e8/26/e0daa306f83d705bc1ed4d6759b7fc945cc787530c230ee1fe299cc28093/powerlaw-1.5-py3-none-any.whl", hash = "sha256:633a669573d9fd663d2f452f121117f2d6b2f2c502eca532f9355f733abfec96", size = 24982 }, ] +[[package]] +name = "progressbar2" +version = "4.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "python-utils" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/24/3587e795fc590611434e4bcb9fbe0c3dddb5754ce1a20edfd86c587c0004/progressbar2-4.5.0.tar.gz", hash = "sha256:6662cb624886ed31eb94daf61e27583b5144ebc7383a17bae076f8f4f59088fb", size = 101449 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/94/448f037fb0ffd0e8a63b625cf9f5b13494b88d15573a987be8aaa735579d/progressbar2-4.5.0-py3-none-any.whl", hash = "sha256:625c94a54e63915b3959355e6d4aacd63a00219e5f3e2b12181b76867bf6f628", size = 57132 }, +] + [[package]] name = "prompt-toolkit" version = "3.0.47" @@ -3882,6 +3974,8 @@ version = "6.0.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/18/c7/8c6872f7372eb6a6b2e4708b88419fb46b857f7a2e1892966b851cc79fc9/psutil-6.0.0.tar.gz", hash = "sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2", size = 508067 } wheels = [ + { url = "https://files.pythonhosted.org/packages/c5/66/78c9c3020f573c58101dc43a44f6855d01bbbd747e24da2f0c4491200ea3/psutil-6.0.0-cp27-none-win32.whl", hash = "sha256:02b69001f44cc73c1c5279d02b30a817e339ceb258ad75997325e0e6169d8b35", size = 249766 }, + { url = "https://files.pythonhosted.org/packages/e1/3f/2403aa9558bea4d3854b0e5e567bc3dd8e9fbc1fc4453c0aa9aafeb75467/psutil-6.0.0-cp27-none-win_amd64.whl", hash = "sha256:21f1fb635deccd510f69f485b87433460a603919b45e2a324ad65b0cc74f8fb1", size = 253024 }, { url = "https://files.pythonhosted.org/packages/0b/37/f8da2fbd29690b3557cca414c1949f92162981920699cd62095a984983bf/psutil-6.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c588a7e9b1173b6e866756dde596fd4cad94f9399daf99ad8c3258b3cb2b47a0", size = 250961 }, { url = "https://files.pythonhosted.org/packages/35/56/72f86175e81c656a01c4401cd3b1c923f891b31fbcebe98985894176d7c9/psutil-6.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ed2440ada7ef7d0d608f20ad89a04ec47d2d3ab7190896cd62ca5fc4fe08bf0", size = 287478 }, { url = "https://files.pythonhosted.org/packages/19/74/f59e7e0d392bc1070e9a70e2f9190d652487ac115bb16e2eff6b22ad1d24/psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd9a97c8e94059b0ef54a7d4baf13b405011176c3b6ff257c247cae0d560ecd", size = 290455 }, @@ -4121,6 +4215,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9a/fd/df3932340498a8f38c6107c95b0eb1d9ac406c5ea1307c8f43408977378e/pydot-3.0.1-py3-none-any.whl", hash = "sha256:43f1e878dc1ff7c1c2e3470a6999d4e9e97771c5c862440c2f0af0ba844c231f", size = 22565 }, ] +[[package]] +name = "pygam" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "progressbar2" }, + { name = "scipy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/26/6e6756bc2398648bc26322d94aa02668319297884e0eea79dd9a5ecdc703/pygam-0.9.0.tar.gz", hash = "sha256:dba62285a275cdd15a6adf764f6717b3cd077502f01cf1bcee5ce7cbda221956", size = 513903 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1a/5b/9357e294997efc17c661355bdd2f12aa21d5631e57d7e650393c79168e60/pygam-0.9.0-py3-none-any.whl", hash = "sha256:3537bbcdbc49d93010c12fb3fdb2f53e1dd062d21eb721a328817aefd91945f4", size = 522208 }, +] + [[package]] name = "pygments" version = "2.18.0" @@ -4297,6 +4405,18 @@ dependencies = [ ] sdist = { url = "https://files.pythonhosted.org/packages/7c/0d/8787b021d52eb8764c0bb18ab95f720cf554902044c6a5cb1865daf45763/python-louvain-0.16.tar.gz", hash = "sha256:b7ba2df5002fd28d3ee789a49532baad11fe648e4f2117cf0798e7520a1da56b", size = 204641 } +[[package]] +name = "python-utils" +version = "3.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/99/fd1e3f80357dd88378281013ae7040a443de395bb0855bf17cbb828488d1/python_utils-3.9.0.tar.gz", hash = "sha256:3689556884e3ae53aec5a4c9f17b36e752a3e93a7ba2768c6553fc4dd6fa70ef", size = 35352 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/e7/200045de1f41ad74915a334f7c2aac54d2d6f4b89643a53e1062cde4895b/python_utils-3.9.0-py2.py3-none-any.whl", hash = "sha256:a7719a5ef4bae7360d2a15c13b08c4e3c3e39b9df19bd16f119ff8d0cfeaafb7", size = 32085 }, +] + [[package]] name = "pytorch-lightning" version = "2.4.0" @@ -4907,28 +5027,30 @@ wheels = [ [[package]] name = "scdataloader" -version = "1.2.1" +version = "1.6.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anndata" }, { name = "biomart" }, { name = "cellxgene-census" }, { name = "django" }, + { name = "harmonypy" }, { name = "ipykernel" }, { name = "lamindb", extra = ["bionty"] }, { name = "leidenalg" }, { name = "lightning" }, { name = "matplotlib" }, { name = "numpy" }, + { name = "palantir" }, { name = "pandas" }, { name = "scikit-misc" }, { name = "seaborn" }, { name = "torch" }, { name = "torchdata" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/47/2b/6e50db4feadd2966571eec302b0107c85ad45091ce420da7bca96c7ff089/scdataloader-1.2.1.tar.gz", hash = "sha256:c8ab3b9fc952ebb5a8dc58a2a1dbd169ab7f00d809704cf7a1b415f0ec1a5bb8", size = 14668023 } +sdist = { url = "https://files.pythonhosted.org/packages/19/7d/f196190ce75c97f51de0a7cdf45306a34ead69a7be842d6a215d4475f692/scdataloader-1.6.5.tar.gz", hash = "sha256:db9cfaf69c907bf3914ff9d7562e70f8677b06a3f57ce7b48249390c7e95711d", size = 43314 } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/c2/176c4517c2699d69e103dd96eaeca4a2bae84af2f93d633b2aa0b25e5c7d/scdataloader-1.2.1-py3-none-any.whl", hash = "sha256:7323b33ac30b4ecd5785f5a1e76ebf307a8ce22b2873e187222706e6a597a138", size = 45530 }, + { url = "https://files.pythonhosted.org/packages/e6/a9/99dd819e023d430b9edb32b2486299411f5cedd9f73c42b8485ca142d9e3/scdataloader-1.6.5-py3-none-any.whl", hash = "sha256:b8837755a56d64b48029a8d636668e201a19894132aad8f7cf325d56c7e7ac70", size = 46454 }, ] [[package]] @@ -5221,7 +5343,7 @@ requires-dist = [ { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=4.1.0" }, { name = "rich", specifier = ">=10.0.0" }, { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.6.4" }, - { name = "scdataloader", specifier = ">=1.1.3" }, + { name = "scdataloader", specifier = ">=1.6.5" }, { name = "scib", specifier = ">=1.0.0" }, { name = "scib-metrics", specifier = ">=0.1.0" }, { name = "scikit-learn", specifier = ">=1.4.0" },