Skip to content

Commit

Permalink
Merge pull request #139 from PixelgenTechnologies/feature/exe-1677
Browse files Browse the repository at this point in the history
Feature/exe 1677
  • Loading branch information
ludvigla committed May 16, 2024
2 parents 04dbc28 + 1ee3ab5 commit 28e0e10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pixelator/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def local_g(
use_weights: bool = True,
normalize_counts: bool = True,
W: csr_array | None = None,
method: Literal["gi", "gistar"] = "gi",
method: Literal["gi", "gstari"] = "gi",
) -> pd.DataFrame:
"""Compute the local G metric for each node in the graph.
Expand All @@ -308,10 +308,10 @@ def local_g(
:param W: A sparse matrix of custom edge weights. This will override the automated
computation of edge weights. `W` must have the same dimensions as A. Note that weights can
be defined for any pair of nodes, not only the pairs represented by edges in `A`. Default is None.
:param method: The method to use for computing local G. Must be one of 'gi' or 'gistar'.
:param method: The method to use for computing local G. Must be one of 'gi' or 'gstari'.
'gi' is the original local G metric, which does not consider self-loops, meaning that the
local marker expression for a node is computed by aggregating the weighted expression of
its neighbors. 'gistar' is a simplified version of local G that does consider self-loops.
its neighbors. 'gstari' is a simplified version of local G that does consider self-loops.
In other words, the local marker expression of a node also includes the weighted marker
expression of the node itself. Default is 'gi'.
:return: A DataFrame of local G-scores for each node and marker.
Expand Down
6 changes: 3 additions & 3 deletions src/pixelator/graph/node_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def local_g(
use_weights: bool = True,
normalize_counts: bool = True,
W: sp.sparse.csr_array | None = None,
method: Literal["gi", "gistar"] = "gi",
method: Literal["gi", "gstari"] = "gi",
) -> pd.DataFrame:
"""Compute local G-scores for each node and marker.
Expand Down Expand Up @@ -101,10 +101,10 @@ def local_g(
:param W: A sparse matrix of custom edge weights. This will override the automated
computation of edge weights. `W` must have the same dimensions as A. Note that weights can
be defined for any pair of nodes, not only the pairs represented by edges in `A`. Default is None.
:param method: The method to use for computing local G. Must be one of 'gi' or 'gistar'.
:param method: The method to use for computing local G. Must be one of 'gi' or 'gstari'.
'gi' is the original local G metric, which does not consider self-loops, meaning that the
local marker expression for a node is computed by aggregating the weighted expression of
its neighbors. 'gistar' is a simplified version of local G that does consider self-loops.
its neighbors. 'gstari' is a simplified version of local G that does consider self-loops.
In other words, the local marker expression of a node also includes the weighted marker
expression of the node itself. Default is 'gi'.
:return: A DataFrame of local G-scores for each node and marker.
Expand Down

0 comments on commit 28e0e10

Please sign in to comment.