Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Oct 25, 2024
1 parent 8ff7808 commit 2dbe6d8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,7 @@ lightning_logs/*

node_modules

# lamindb
test.ipynb
test-perturbation
test-bug
1 change: 1 addition & 0 deletions docs/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ harmonized names and be loadable as MuData objects.
.. autosummary::
:toctree: data
data.PerturbationCurator
data.adamson_2016_pilot
data.adamson_2016_upr_epistasis
data.adamson_2016_upr_perturb_seq
Expand Down
18 changes: 11 additions & 7 deletions pertpy/data/_perturbation_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import anndata as ad
import pandas as pd
from django.core.exceptions import ImproperlyConfigured
from lamin_utils import logger


class _PerturbationValidatorUnavailable:
Expand All @@ -15,25 +13,31 @@ def __init__(self):
import bionty as bt
import wetlab as wl
from cellxgene_lamin import CellxGeneFields, Curate
from django.core.exceptions import ImproperlyConfigured
from lamin_utils import logger
from lamindb_setup.core.types import UPathStr
from lnschema_core import Record
from lnschema_core.types import FieldAttr

pt_defaults = CellxGeneFields.OBS_FIELD_DEFAULTS | {
"genetic_treatments": pd.NA,
"compound_treatments": pd.NA,
"environmental_treatments": pd.NA,
"combination_treatments": pd.NA,
"cell_line": "unknown",
"genetic_treatments": "",
"compound_treatments": "",
"environmental_treatments": "",
"combination_treatments": "",
}

pt_categoricals = CellxGeneFields.OBS_FIELDS | {
"cell_line": bt.CellLine.name,
"genetic_treatments": wl.GeneticTreatment.name,
"compound_treatments": wl.CombinationTreatment.name,
"compound_treatments": wl.CompoundTreatment.name,
"environmental_treatments": wl.EnvironmentalTreatment.name,
"combination_treatments": wl.CombinationTreatment.name,
}

pt_sources: dict[str, Record] = {
"depmap_id": bt.Source.filter(name="depmap").one(),
"cell_line": bt.Source.filter(name="depmap").one(),
# "compound_treatments": bt.Source.filter(entity="Drug", name="chebi").first()
}

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ dev = [
validator = [
"cellxgene-lamin",
"wetlab",
"findrefs"
]
doc = [
"docutils>=0.8,!=0.18.*,!=0.19.*",
Expand Down

0 comments on commit 2dbe6d8

Please sign in to comment.