From 99f1612562e6c598dbd2b7841eea074c396562dd Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 19 Jun 2022 23:48:51 -0400 Subject: [PATCH] split out #168 to make this PR smaller --- apis/python/src/tiledbsc/assay_matrix.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apis/python/src/tiledbsc/assay_matrix.py b/apis/python/src/tiledbsc/assay_matrix.py index d2636f42e5..a018edaf2d 100644 --- a/apis/python/src/tiledbsc/assay_matrix.py +++ b/apis/python/src/tiledbsc/assay_matrix.py @@ -597,9 +597,19 @@ def to_csr_matrix(self, row_labels, col_labels): s = util.get_start_stamp() print(f"{self._indent}START read {self.uri}") - csr = self.csr() + df = self.df() + + retval = util.X_and_ids_to_sparse_matrix( + df, + self.row_dim_name, + self.col_dim_name, + self.attr_name, + row_labels, + col_labels, + return_as="csr", + ) if self._verbose: print(util.format_elapsed(s, f"{self._indent}FINISH read {self.uri}")) - return csr + return retval