Skip to content

Commit

Permalink
use proper datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
ckmah committed Apr 26, 2024
1 parent e981cdf commit 5038087
Show file tree
Hide file tree
Showing 45 changed files with 364 additions and 588 deletions.
2 changes: 0 additions & 2 deletions bento/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def filter_by_gene(
.table is updated to remove genes with low expression.
"""
gene_filter = (sdata.table.X >= min_count).sum(axis=0) > 0
table_transform = sdata.table.attrs
filtered_table = sdata.table[:, gene_filter]
filtered_table.attrs = table_transform

filtered_genes = list(sdata.table.var_names.difference(filtered_table.var_names))
points = get_points(sdata, points_key=points_key, astype="pandas", sync=False)
Expand Down
10 changes: 8 additions & 2 deletions bento/datasets/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,11 @@ def sample_data():
ref = files(__package__) / "merfish_sample.zarr"
with as_file(ref) as path:
sdata = sd.read_zarr(path)
sdata = prep(sdata, points_key="transcripts", instance_key="feature_name", shape_keys=["cell_boundaries", "nucleus_boundaries"])
return sdata
sdata = prep(
sdata,
points_key="transcripts",
instance_key="cell_boundaries",
feature_key="feature_name",
shape_keys=["cell_boundaries", "nucleus_boundaries"],
)
return sdata
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
15
14
],
"compressor": {
"blocksize": 0,
Expand All @@ -19,7 +19,7 @@
],
"order": "C",
"shape": [
15
14
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
1443,
1224,
2
],
"compressor": {
Expand All @@ -16,7 +16,7 @@
"filters": null,
"order": "C",
"shape": [
1443,
1224,
2
],
"zarr_format": 2
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
16
15
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
16
15
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
16
15
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
16
15
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
15
12
],
"compressor": {
"blocksize": 0,
Expand All @@ -19,7 +19,7 @@
],
"order": "C",
"shape": [
15
12
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
2877,
2136,
2
],
"compressor": {
Expand All @@ -16,7 +16,7 @@
"filters": null,
"order": "C",
"shape": [
2877,
2136,
2
],
"zarr_format": 2
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
16
13
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
16
13
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
16
13
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
16
13
],
"zarr_format": 2
}
Binary file not shown.
2 changes: 1 addition & 1 deletion bento/datasets/merfish_sample.zarr/table/table/X/.zattrs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"encoding-type": "csr_matrix",
"encoding-version": "0.1.0",
"shape": [
15,
14,
135
]
}
4 changes: 2 additions & 2 deletions bento/datasets/merfish_sample.zarr/table/table/X/data/.zarray
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
2025
1890
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
2025
1890
],
"zarr_format": 2
}
Binary file modified bento/datasets/merfish_sample.zarr/table/table/X/data/0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
2025
1890
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
2025
1890
],
"zarr_format": 2
}
Binary file modified bento/datasets/merfish_sample.zarr/table/table/X/indices/0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
16
15
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
16
15
],
"zarr_format": 2
}
Binary file modified bento/datasets/merfish_sample.zarr/table/table/X/indptr/0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
15
14
],
"compressor": {
"blocksize": 0,
Expand All @@ -19,7 +19,7 @@
],
"order": "C",
"shape": [
15
14
],
"zarr_format": 2
}
Binary file modified bento/datasets/merfish_sample.zarr/table/table/obs/_index/0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
15
14
],
"compressor": {
"blocksize": 0,
Expand All @@ -19,7 +19,7 @@
],
"order": "C",
"shape": [
15
14
],
"zarr_format": 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chunks": [
15
14
],
"compressor": {
"blocksize": 0,
Expand All @@ -15,7 +15,7 @@
"filters": null,
"order": "C",
"shape": [
15
14
],
"zarr_format": 2
}
Binary file not shown.
Loading

0 comments on commit 5038087

Please sign in to comment.