Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address a potential problem while creating a training dataset with dense array inputs #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update pertdata.py part 2
  • Loading branch information
HelloWorldLTY authored Jul 10, 2024
commit c29f4f3f944038c23b74b2b15bfa6693fd676b30
9 changes: 7 additions & 2 deletions gears/pertdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,13 @@ def create_cell_graph_dataset(self, split_adata, pert_category,
# Create cell graphs
cell_graphs = []
for X, y in zip(Xs, ys):
cell_graphs.append(self.create_cell_graph(X.toarray(),
y.toarray(), de_idx, pert_category, pert_idx))
try:
cell_graphs.append(self.create_cell_graph(X.toarray(),
y, de_idx, pert_category, pert_idx))
except:
y = y.toarray()
cell_graphs.append(self.create_cell_graph(X.toarray(),
y, de_idx, pert_category, pert_idx))

return cell_graphs

Expand Down