Skip to content

Commit

Permalink
Merge pull request #290 from mims-harvard/bug_fix_print
Browse files Browse the repository at this point in the history
fix printing bug in scperturb
  • Loading branch information
amva13 authored Jul 3, 2024
2 parents 33bae88 + 50f38dc commit 2344711
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tdc/multi_pred/perturboutcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ def __init__(self, name, path="./data", print_stats=False):

if self.is_gene:
import scanpy as sc
print_sys("Normalizing (log1p, 5K HVGs)!")
sc.pp.normalize_total(self.adata)
sc.pp.log1p(self.adata)
from scipy.sparse import csr_matrix
self.adata.X = csr_matrix(self.adata.X)
print_sys("Getting DE genes!")
sc.pp.highly_variable_genes(self.adata,
n_top_genes=5000,
subset=True)
Expand Down Expand Up @@ -159,12 +157,9 @@ def get_cellline_split(self,
split_to_unseen=False,
remove_unseen=True):
df = self.get_data()
print_sys("got data grouping by cell line")
cell_line_groups = df.groupby("cell_line")
print_sys("groupby completed")
cell_line_splits = {}
for cell_line, cell_line_group in cell_line_groups:
print_sys("processing cell line", cell_line)
control = cell_line_group[cell_line_group["perturbation"] ==
"control"]
cell_line_group = cell_line_group[cell_line_group["perturbation"] !=
Expand Down Expand Up @@ -219,7 +214,6 @@ def get_cellline_split(self,
cell_line_group[
cell_line_group["perturbation"].isin(perturbs_dev)]
}
print_sys("done with cell line", cell_line)

return cell_line_splits

Expand Down

0 comments on commit 2344711

Please sign in to comment.