Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zouter committed Aug 5, 2023
1 parent 522e97c commit 8d6ab6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/chromatinhd/models/pred/loader/transcriptome.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ class Transcriptome:
def __init__(
self,
transcriptome: chromatinhd.data.transcriptome.Transcriptome,
layer: str = "X",
layer: str = None,
):
X = transcriptome.layers[layer]
if layer is None:
X = transcriptome.X
else:
X = transcriptome.layers[layer]
if chromatinhd.sparse.is_sparse(X):
self.X = X.dense()
elif torch.is_tensor(X):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
fragments: chromatinhd.data.fragments.Fragments,
transcriptome: chromatinhd.data.transcriptome.Transcriptome,
cellxgene_batch_size: int,
layer: str = "X",
layer: str = None,
):
# ensure that transcriptome and fragments have the same var
if not all(transcriptome.var.index == fragments.var.index):
Expand Down

0 comments on commit 8d6ab6b

Please sign in to comment.