Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.6
rev: v0.16.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The `list_datasets()` function will display all available datasets along with th

```python
import scrnaseq

datasets = scrnaseq.list_datasets()
print(datasets[["name", "version"]].head(3))

Expand All @@ -57,11 +58,8 @@ res = scrnaseq.search_datasets("pancreas")
from gypsum_client import define_text_query

res = scrnaseq.search_datasets(
define_text_query("GRCm38", field="genome")
& (
define_text_query("neuro%", partial=True)
| define_text_query("pancrea%", partial=True)
)
define_text_query("GRCm38", field="genome")
& (define_text_query("neuro%", partial=True) | define_text_query("pancrea%", partial=True))
)
print(res[["name", "version"]].head(3))

Expand Down Expand Up @@ -169,9 +167,9 @@ Want to contribute your own dataset to this package? It's easy! Just follow thes
row_names = [f"GENE_{i}" for i in range(mat.shape[0])]
col_names = list("ABCDEFGHIJ")
sce = SingleCellExperiment(
assays={"counts": mat},
row_data=BiocFrame(row_names=row_names),
column_data=BiocFrame(row_names=col_names),
assays={"counts": mat},
row_data=BiocFrame(row_names=row_names),
column_data=BiocFrame(row_names=col_names),
)
```

Expand All @@ -187,13 +185,13 @@ Want to contribute your own dataset to this package? It's easy! Just follow thes

```python
meta = {
"title": "My dataset forked from ziesel brain",
"description": "This is a copy of the ziesel",
"taxonomy_id": ["10090"], # NCBI ID
"genome": ["GRCh38"], # genome build
"sources": [{"provider": "GEO", "id": "GSE12345"}],
"maintainer_name": "Shizuka Mogami",
"maintainer_email": "mogami.shizuka@765pro.com",
"title": "My dataset forked from ziesel brain",
"description": "This is a copy of the ziesel",
"taxonomy_id": ["10090"], # NCBI ID
"genome": ["GRCh38"], # genome build
"sources": [{"provider": "GEO", "id": "GSE12345"}],
"maintainer_name": "Shizuka Mogami",
"maintainer_email": "mogami.shizuka@765pro.com",
}
```

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if __name__ == "__main__":
try:
setup(use_scm_version={"version_scheme": "no-guess-dev"})
except: # noqa
except:
print(
"\n\nAn error occurred while building the project, "
"please ensure you have the most updated version of setuptools, "
Expand Down
4 changes: 1 addition & 3 deletions src/scrnaseq/list_versions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from typing import List

import gypsum_client as gypc

__author__ = "Jayaram Kancherla"
__copyright__ = "Jayaram Kancherla"
__license__ = "MIT"


def list_versions(name: str) -> List[str]:
def list_versions(name: str) -> list[str]:
"""List all available versions for a dataset.

Example:
Expand Down
8 changes: 3 additions & 5 deletions src/scrnaseq/polish_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Type

import numpy as np
from singlecellexperiment import SingleCellExperiment
from summarizedexperiment import SummarizedExperiment
Expand All @@ -10,12 +8,12 @@


def polish_dataset(
x: Type[SummarizedExperiment],
x: type[SummarizedExperiment],
reformat_assay_by_density: float = 0.3,
attempt_integer_conversion: bool = True,
remove_altexp_coldata: bool = True,
forbid_nested_altexp: bool = True,
) -> Type[SummarizedExperiment]:
) -> type[SummarizedExperiment]:
"""Optimize dataset for saving.

Prepare a
Expand Down Expand Up @@ -68,7 +66,7 @@ def polish_dataset(


def _polish_dataset(
x: Type[SummarizedExperiment],
x: type[SummarizedExperiment],
reformat_assay_by_density: float,
attempt_integer_conversion: bool,
remove_altexp_coldata: bool,
Expand Down
3 changes: 1 addition & 2 deletions src/scrnaseq/search_datasets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sqlite3
from functools import lru_cache
from typing import Union

from biocframe import BiocFrame
from gypsum_client import cache_directory, fetch_metadata_database
Expand All @@ -18,7 +17,7 @@

@lru_cache
def search_datasets(
query: Union[str, GypsumSearchClause],
query: str | GypsumSearchClause,
cache_dir: str = cache_directory(),
overwrite: bool = False,
latest: bool = True,
Expand Down
Loading