Skip to content

Commit

Permalink
Combined pairwise align function from paste1 and paste2 (#58)
Browse files Browse the repository at this point in the history
Merged functionality from paste2 to paste, with support for overlap fraction and histology data
  • Loading branch information
anushka255 authored Oct 8, 2024
1 parent 67a751e commit 4a9c925
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 746 deletions.
2 changes: 1 addition & 1 deletion src/paste3/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def to_dense_array(X):
return np.array(X.todense()) if isinstance(X, scipy.sparse.csr.spmatrix) else X


def extract_data_matrix(adata, rep):
def extract_data_matrix(adata, rep=None):
return adata.X if rep is None else adata.obsm[rep]


Expand Down
5 changes: 3 additions & 2 deletions src/paste3/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
extract_data_matrix,
glmpca_distance,
)
from paste3.paste2 import partial_pairwise_align_given_cost_matrix
from paste3.paste import pairwise_align


"""
Expand Down Expand Up @@ -200,7 +200,7 @@ def select_overlap_fraction(sliceA, sliceB, alpha=0.1, show_plot=True, numIterma
m_to_pi = {}
for m in overlap_to_check:
print("Running PASTE2 with s = " + str(m) + "...")
pi, log = partial_pairwise_align_given_cost_matrix(
pi, log = pairwise_align(
sliceA,
sliceB,
s=m,
Expand All @@ -211,6 +211,7 @@ def select_overlap_fraction(sliceA, sliceB, alpha=0.1, show_plot=True, numIterma
return_obj=True,
verbose=False,
numItermax=numItermax,
maxIter=numItermax,
)
m_to_pi[m] = pi

Expand Down
Loading

0 comments on commit 4a9c925

Please sign in to comment.