Skip to content

Commit

Permalink
Merge branch 'rewrite' of https://github.com/BiocPy/rds2py into rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Oct 24, 2024
2 parents 7ac0aec + d7440c2 commit f7301f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rds2py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
from .read_granges import parse_genomic_ranges, parse_granges_list
from .read_rle import parse_rle
from .read_se import parse_summarized_experiment, parse_ranged_summarized_experiment
from .read_sce import parse_single_cell_experiment
from .read_sce import parse_single_cell_experiment
4 changes: 3 additions & 1 deletion src/rds2py/read_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def parse_vector(robject: dict):
_cls = get_class(robject)

if _cls not in ["vector"]:
raise RuntimeError(f"`robject` does not contain not a vector/dictionary object, contains `{_cls}`.")
raise RuntimeError(
f"`robject` does not contain not a vector/dictionary object, contains `{_cls}`."
)

if "names" not in robject["attributes"]:
return [_dispatcher(x) for x in robject["data"]]
Expand Down
8 changes: 7 additions & 1 deletion src/rds2py/read_sce.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def parse_single_cell_experiment(robject: dict):
# check red. dims, alternative expts
robj_reduced_dims = None
robj_altExps = None
col_attrs = list(_dispatcher(robject["attributes"]["int_colData"]["attributes"]["listData"]["attributes"]["names"]))
col_attrs = list(
_dispatcher(
robject["attributes"]["int_colData"]["attributes"]["listData"][
"attributes"
]["names"]
)
)

for idx in range(len(col_attrs)):
idx_col = col_attrs[idx]
Expand Down
1 change: 0 additions & 1 deletion tests/test_sce.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ def test_read_sce():
assert data is not None
assert isinstance(data, SingleCellExperiment)
assert data.shape == (100, 100)

0 comments on commit f7301f6

Please sign in to comment.