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

Overhaul SingleCellExperiment #24

Merged
merged 12 commits into from
Dec 30, 2023
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ import singlecellexperiment
sce = singlecellexperiment.read_h5ad("tests/data/adata.h5ad")
```

## output
class: SingleCellExperiment
dimensions: (20, 30)
assays(3): ['array', 'sparse', 'X']
row_data columns(5): ['var_cat', 'cat_ordered', 'int64', 'float64', 'uint8']
row_names(0):
column_data columns(5): ['obs_cat', 'cat_ordered', 'int64', 'float64', 'uint8']
column_names(0):
main_experiment_name:
reduced_dims(0): []
alternative_experiments(0): []
row_pairs(0): []
column_pairs(0): []
metadata(2): O_recarray nested

***OR construct one from scratch***

```python
Expand Down
11 changes: 5 additions & 6 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ Similarly `read_tenx_h5`, `read_tenx_mtx` and `from_anndata` methods are availa
```python
import pandas as pd
import numpy as np
from biocframe import BiocFrame
from genomicranges import GenomicRanges

nrows = 200
ncols = 6
counts = np.random.rand(nrows, ncols)
df_gr = pd.DataFrame(
row_data = BiocFrame(
{
"seqnames": [
"chr1",
Expand All @@ -50,8 +51,6 @@ df_gr = pd.DataFrame(
}
)

gr = GenomicRanges.from_pandas(df_gr)

col_data = pd.DataFrame(
{
"celltype": ["cluster1", "cluster2"] * 3,
Expand All @@ -65,7 +64,7 @@ Finally construct the object,
from singlecellexperiment import SingleCellExperiment

tse = SingleCellExperiment(
assays={"counts": counts}, row_data=df_gr, col_data=col_data
assays={"counts": counts}, row_data=row_data, column_data=col_data
)
```

Expand All @@ -76,11 +75,11 @@ Multiple methods are available to access various slots of a `SingleCellExperimen
```python
tse.assays
tse.row_data
tse.col_data
tse.column_data
tse.reduced_dims
tse.alternative_experiments
tse.row_pairs
tse.col_pairs
tse.column_pairs
```

### Access specific sets
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ package_dir =
=src

# Require a min/specific Python version (comma-separated conditions)
# python_requires = >=3.8
python_requires = >=3.8

# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0.
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in
# new major versions. This works if the required packages follow Semantic Versioning.
# For more information, check out https://semver.org/.
install_requires =
importlib-metadata; python_version<"3.8"
summarizedexperiment>=0.3.5
summarizedexperiment>=0.4.0,<0.5.0

[options.packages.find]
where = src
Expand Down
Loading
Loading