Skip to content

Commit

Permalink
handle de_groups in score removal
Browse files Browse the repository at this point in the history
  • Loading branch information
JPatrickPett committed Mar 10, 2024
1 parent 4f0f657 commit 3a829e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snp2cell/snp2cell_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def _init_scores(self) -> None:
self.scores = pd.DataFrame(index=list(self.grn.nodes))
self.scores_prop = pd.DataFrame(index=list(self.grn.nodes))
self.scores_rand = {}
self.de_groups = {}
else:
raise ValueError("No GRN set, add GRN first.")

Expand Down Expand Up @@ -859,8 +860,11 @@ def remove_scores(self, which: str = "propagated", **kwargs: Any) -> None:
if kwargs:
cols = self.scores.filter(**kwargs).columns # type: ignore
self.scores = self.scores.drop(columns=cols) # type: ignore
for k in self.de_groups:
self.de_groups[k] = [i for i in self.de_groups[k] if i not in cols]
else:
self.scores = pd.DataFrame(index=list(self.grn.nodes)) # type: ignore
self.de_groups = {}

def get_components(self, sel_nodes: list[str]) -> tuple[nx.Graph, list[set]]:
"""
Expand Down

0 comments on commit 3a829e0

Please sign in to comment.