Skip to content

Commit

Permalink
fix(denovo): remove rank 1 from stability rank suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
apduncan committed Aug 29, 2024
1 parent 8fd938e commit 1829a17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/cvanmf/denovo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ def __detect_max(
"""
from scipy.signal import argrelmax
# Default to wrap to get peaks at 2
# Remove rank 1 if it is present (if old results which allowed rank 1 in
# stability results)
maxima_idx: np.ndarray = argrelmax(
data=series.values,
**(dict(mode="wrap") | kwargs))[0]
Expand Down
4 changes: 0 additions & 4 deletions tests/test_denovo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,3 @@ def test_rank_selection_k1(
coph: pd.Series = cophenetic_correlation(decomps)
assert 1 not in disp.index
assert 1 not in coph.index

def test_temp():
pth = pathlib.Path("/Users/pez23lof/Library/CloudStorage/OneDrive-NorwichBioscienceInstitutes/cvanmf_manuscript/figures/fig_global_diversity/4.tar.gz")
d = Decomposition.load(pth)

0 comments on commit 1829a17

Please sign in to comment.