Skip to content

Commit

Permalink
Update README with anndata/h5ad snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Jun 7, 2024
1 parent 9dd0d2e commit bde73e3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ mat = data.assay("counts")
features = [str(x) for x in data.row_data["name"]]
```

or if you are coming from scverse ecosystem, i.e. `AnnData`, simply read the object as `SingleCellExperiment` and extract the matrix and the features.
Read more on [SingleCellExperiment here](https://biocpy.github.io/tutorial/chapters/experiments/single_cell_experiment.html).


```python
import singlecellexperiment as sce

sce_adata = sce.SingleCellExperiment.from_anndata(adata)

# or from a h5ad file
sce_h5ad = sce.read_h5ad("tests/data/adata.h5ad")
```

Now, we fetch the Blueprint/ENCODE reference:

```python
Expand Down

0 comments on commit bde73e3

Please sign in to comment.