Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add moa and compound annotation #444

Merged
merged 39 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a9d7e9e
fix test warning
wxicu Oct 16, 2023
59af009
Merge branch 'main' into dev_metadata
wxicu Oct 17, 2023
dad9c5e
add moa and compound
wxicu Nov 17, 2023
19e16c9
fix pre commit
wxicu Nov 17, 2023
0955291
add test and lookup
wxicu Nov 20, 2023
d498b5b
fix merge bug
wxicu Nov 21, 2023
a69c21f
update doc, fix test
wxicu Nov 21, 2023
86ee6f4
fix typo + precommit
wxicu Nov 21, 2023
f438647
Merge branch 'main' into dev_metadata
wxicu Nov 21, 2023
5bea996
Update pertpy/tools/_metadata/_cell_line.py
wxicu Nov 24, 2023
85c64b5
Update pertpy/tools/_metadata/_cell_line.py
wxicu Nov 24, 2023
467f3a1
Update pertpy/tools/_metadata/_cell_line.py
wxicu Nov 24, 2023
af2963f
Update pertpy/tools/_metadata/_compound.py
wxicu Nov 24, 2023
0f240b0
Update pertpy/tools/_metadata/_look_up.py
wxicu Nov 24, 2023
00d9d07
add helper function
wxicu Nov 24, 2023
808c583
Update pertpy/tools/_metadata/_cell_line.py
wxicu Nov 30, 2023
5bc9b95
Update pertpy/tools/_metadata/_look_up.py
wxicu Nov 30, 2023
0435d67
Update pertpy/tools/_metadata/_compound.py
wxicu Nov 30, 2023
9fb96ed
improve docstring, add parent class
wxicu Nov 30, 2023
dfa1960
parent class.
wxicu Nov 30, 2023
dd33b8c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 30, 2023
3023c5f
Merge branch 'main' into dev_metadata
wxicu Nov 30, 2023
0b3c957
rename the class
wxicu Dec 1, 2023
763a12a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2023
e7e0581
fix doc
wxicu Dec 4, 2023
e2d5ad7
Merge branch 'main' into dev_metadata
wxicu Dec 5, 2023
cefbfaf
remove cachedir, use sequence instead of list
wxicu Dec 5, 2023
c282c36
add type checking
wxicu Dec 5, 2023
e594ce3
Merge branch 'main' into dev_metadata
wxicu Dec 10, 2023
396be7f
add test scripts, add compare_categories
wxicu Dec 10, 2023
e3da695
Merge branch 'main' into dev_metadata
Zethson Dec 11, 2023
6f2640f
Refactor
Zethson Dec 11, 2023
f708619
Refactor
Zethson Dec 11, 2023
067ef0b
Merge branch 'main' into dev_metadata
Zethson Dec 14, 2023
db0b017
add correlate and plot_correlation function, simplify the code
wxicu Dec 19, 2023
2bc2354
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 19, 2023
bc0da9a
Merge branch 'main' into dev_metadata
wxicu Dec 19, 2023
c36dacf
format document
wxicu Dec 19, 2023
7c5c81a
Refactoring and move plot
Zethson Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 39 additions & 24 deletions docs/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,30 +320,6 @@ etest = pt.tl.PermutationTest(
tab = etest(adata, groupby="perturbation", contrast="control")
```

### MetaData

MetaData provides tooling to fetch and add more metadata to perturbations by querying a couple of databases.
We are currently implementing several sources with more to come.

CellLineMetaData aims to retrieve various types of information related to cell lines, including cell line annotation,
bulk RNA and protein expression data.

Available databases for cell line metadata:

- The Cancer Dependency Map Project at Broad
- The Cancer Dependency Map Project at Sanger

```{eval-rst}
.. currentmodule:: pertpy
```

```{eval-rst}
.. autosummary::
:toctree: tools

tools.CellLineMetaData
```

### Response prediction

#### Augur
Expand Down Expand Up @@ -513,3 +489,42 @@ See [perturbation space tutorial](https://pertpy.readthedocs.io/en/latest/tutori
Every tool has a set of plotting functions that start with `plot_`.

However, we are planning to offer more general plots at a later point.

## MetaData

MetaData provides tooling to fetch and add more metadata to perturbations by querying a couple of databases.
We are currently implementing several sources with more to come.

CellLine aims to retrieve various types of information related to cell lines, including cell line annotation,
bulk RNA and protein expression data.

Available databases for cell line metadata:

- [The Cancer Dependency Map Project at Broad](https://depmap.org/portal/)
- [The Cancer Dependency Map Project at Sanger](https://depmap.sanger.ac.uk/)
- [Genomics of Drug Sensitivity in Cancer (GDSC)](https://www.cancerrxgene.org/)

Compound aims to retrieve various types of information related to compounds of interest, including the most common synonym, pubchemID and canonical SMILES.

Available databases for compound metadata:

- [PubChem](https://pubchem.ncbi.nlm.nih.gov/)

Moa aims to retrieve metadata of mechanism of action studies related to perturbagens of interest, depending on the molecular targets.

Available databases for mechanism of action metadata:

- [CLUE](https://clue.io/)

```{eval-rst}
.. currentmodule:: pertpy
```

```{eval-rst}
.. autosummary::
:toctree: metadata

metadata.CellLine
metadata.Compound
metadata.Moa
```
132 changes: 132 additions & 0 deletions nicheformer-data/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[project]
name = "nicheformer-data"
version = "0.0.1"
description = "Data collection for nicheformer"
readme = "README.md"
requires-python = ">=3.9"
license = {file = "LICENSE"}
authors = [
{name = "theislab"},
]
maintainers = [
{name = "theislab", email = "[email protected]"},
]
urls.Documentation = "https://nicheformer-data.readthedocs.io/"
urls.Source = "https://github.com/theislab/nicheformer-data"
urls.Home-page = "https://github.com/theislab/nicheformer-data"
dependencies = [
"anndata",
"scanpy",
"lamindb[zarr,aws,bionty,jupyter]==0.63.5",
"cellxgene-schema>=3.1.3",
# for debug logging (referenced from the issue template)
"session-info"
]

[project.optional-dependencies]
dev = [
"pre-commit",
"twine>=4.0.2"
]
doc = [
"docutils>=0.8,!=0.18.*,!=0.19.*",
"sphinx>=4",
"sphinx-book-theme>=1.0.0",
"myst-nb",
"sphinxcontrib-bibtex>=1.0.0",
"sphinx-autodoc-typehints",
"sphinxext-opengraph",
# For notebooks
"ipykernel",
"ipython",
"sphinx-copybutton",
]
test = [
"pytest",
"pytest-cov",
]

[tool.coverage.run]
source = ["nicheformer_data"]
omit = [
"**/test_*.py",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
xfail_strict = true
addopts = [
"--import-mode=importlib", # allow using test files with same name
]

[tool.black]
line-length = 120

[tool.ruff]
src = ["src"]
line-length = 120
select = [
"F", # Errors detected by Pyflakes
"E", # Error detected by Pycodestyle
"W", # Warning detected by Pycodestyle
"I", # isort
"D", # pydocstyle
"B", # flake8-bugbear
"TID", # flake8-tidy-imports
"C4", # flake8-comprehensions
"BLE", # flake8-blind-except
"UP", # pyupgrade
"RUF100", # Report unused noqa directives
]
ignore = [
# line too long -> we accept long comment lines; black gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix
"E741",
# Missing docstring in public package
"D104",
# Missing docstring in public module
"D100",
# Missing docstring in __init__
"D107",
# Errors from function calls in argument defaults. These are fine when the result is immutable.
"B008",
# __magic__ methods are are often self-explanatory, allow missing docstrings
"D105",
# first line should end with a period [Bug: doesn't work with single-line docstrings]
"D400",
# First line should be in imperative mood; try rephrasing
"D401",
## Disable one in each pair of mutually incompatible rules
# We don’t want a blank line before a class docstring
"D203",
# We want docstrings to start immediately after the opening triple quote
"D213",
]

[tool.ruff.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
"docs/*" = ["I"]
"tests/*" = ["D"]
"*/__init__.py" = ["F401"]
"scripts/*.py" = ["D","BLE","I", "E"]

[tool.cruft]
skip = [
"tests",
"src/**/__init__.py",
"src/**/basic.py",
"docs/api.md",
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb"
]
1 change: 1 addition & 0 deletions pertpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
warnings.filterwarnings("ignore", category=UserWarning, module="scvi._settings")

from . import data as dt
from . import metadata as md
from . import plot as pl
from . import preprocessing as pp
from . import tools as tl
3 changes: 3 additions & 0 deletions pertpy/metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pertpy.metadata._cell_line import CellLine
from pertpy.metadata._compound import Compound
from pertpy.metadata._moa import Moa
Loading
Loading