diff --git a/build/lib/paste/__init__.py b/build/lib/paste/__init__.py index f1413a7..235b2d3 100644 --- a/build/lib/paste/__init__.py +++ b/build/lib/paste/__init__.py @@ -1,3 +1,3 @@ from .PASTE import pairwise_align, center_align -from .helper import match_spots_using_spatial_heuristic +from .helper import match_spots_using_spatial_heuristic, filter_for_common_genes from .visualization import plot_slice, stack_slices_pairwise, stack_slices_center \ No newline at end of file diff --git a/build/lib/paste/helper.py b/build/lib/paste/helper.py index 67db0db..42c2027 100644 --- a/build/lib/paste/helper.py +++ b/build/lib/paste/helper.py @@ -1,7 +1,26 @@ +from typing import List +from anndata import AnnData import numpy as np import scipy import ot +def filter_for_common_genes( + slices: List[AnnData]) -> None: + """ + Filters for the intersection of genes between all slices. + + Args: + slices: List of slices. + """ + assert len(slices) > 0, "Cannot have empty list." + + common_genes = slices[0].var.index + for s in slices: + common_genes = intersect(common_genes, s.var.index) + for i in range(len(slices)): + slices[i] = slices[i][:, common_genes] + print('Filtered all slices for common genes. There are ' + str(len(common_genes)) + ' common genes.') + def match_spots_using_spatial_heuristic( X, Y, diff --git a/dist/paste-bio-1.2.1.tar.gz b/dist/paste-bio-1.2.1.tar.gz deleted file mode 100644 index ba4c137..0000000 Binary files a/dist/paste-bio-1.2.1.tar.gz and /dev/null differ diff --git a/dist/paste-bio-1.2.2.tar.gz b/dist/paste-bio-1.2.2.tar.gz new file mode 100644 index 0000000..fa7f3d4 Binary files /dev/null and b/dist/paste-bio-1.2.2.tar.gz differ diff --git a/dist/paste_bio-1.2.1-py3-none-any.whl b/dist/paste_bio-1.2.1-py3-none-any.whl deleted file mode 100644 index 4b6e9e6..0000000 Binary files a/dist/paste_bio-1.2.1-py3-none-any.whl and /dev/null differ diff --git a/dist/paste_bio-1.2.2-py3-none-any.whl b/dist/paste_bio-1.2.2-py3-none-any.whl new file mode 100644 index 0000000..3045fa0 Binary files /dev/null and b/dist/paste_bio-1.2.2-py3-none-any.whl differ diff --git a/setup.cfg b/setup.cfg index 38ce193..a5dee0c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = paste-bio -version = 1.2.1 +version = 1.2.2 author = Max Land author_email = max.ruikang.land@gmail.com description = A computational method to align and integrate spatial transcriptomics experiments. diff --git a/src/paste_bio.egg-info/PKG-INFO b/src/paste_bio.egg-info/PKG-INFO index 1988ecc..9060adc 100644 --- a/src/paste_bio.egg-info/PKG-INFO +++ b/src/paste_bio.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: paste-bio -Version: 1.2.1 +Version: 1.2.2 Summary: A computational method to align and integrate spatial transcriptomics experiments. Home-page: https://github.com/raphael-group/paste Author: Max Land