diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 235c5b8..565195e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: environment-file: environment.yml - name: Install package - run: pip install . + run: pip install -e . - name: Pytest run: pytest \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b5a3c46..2cddafb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,44 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel" +requires = ["setuptools>=61.0", "setuptools_scm>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "paste" +authors = [ + {name="Max Land", email="max.ruikang.land@gmail.com"} ] -build-backend = "setuptools.build_meta" \ No newline at end of file +description = "A computational method to align and integrate spatial transcriptomics experiments." +readme = "README.md" +requires-python = ">=3.6" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", +] + +dependencies = [ + "anndata>=0.7.6", + "scanpy>=1.7.2", + "POT==0.9.0", + "numpy", + "scipy", + "scikit-learn>=0.24.0", + "IPython>=7.18.1", +] +dynamic = ["version"] + +[project.scripts] +paste = "paste.__main__:main" + +[tool.setuptools] +package-dir = {"" = "src"} + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = "-sv" + +[project.optional-dependencies] +dev = [ + "build", + "pytest", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5524c75..0000000 --- a/setup.cfg +++ /dev/null @@ -1,25 +0,0 @@ -[metadata] -name = paste-bio -version = 1.4.0 -author = Max Land -author_email = max.ruikang.land@gmail.com -description = A computational method to align and integrate spatial transcriptomics experiments. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/raphael-group/paste -project_urls = - Bug Tracker = https://github.com/raphael-group/paste/issues -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: BSD License - Operating System :: OS Independent - -[options] -package_dir = - = src -packages = find: -python_requires = >=3.6 -zip_safe = False - -[options.packages.find] -where = src \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index fc1f76c..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() \ No newline at end of file diff --git a/paste-cmd-line.py b/src/paste/paste-cmd-line.py similarity index 96% rename from paste-cmd-line.py rename to src/paste/paste-cmd-line.py index 3023bd1..74a7f73 100644 --- a/paste-cmd-line.py +++ b/src/paste/paste-cmd-line.py @@ -56,7 +56,7 @@ def main(args): pis_init = [pd.read_csv(args.start[i],index_col=0).to_numpy() for i in range(len(args.start))] # create output folder - output_path = os.path.join(args.direc, "paste_output") + output_path = os.path.join(args.direc, "../../paste_output") if not os.path.exists(output_path): os.mkdir(output_path) @@ -82,8 +82,8 @@ def main(args): center_slice, pis = center_align(initial_slice, slices, lmbda, args.alpha, args.n_components, args.threshold, dissimilarity=args.cost, distributions=[slices[i].obsm['weights'] for i in range(n_slices)], pis_init=pis_init) W = pd.DataFrame(center_slice.uns['paste_W'], index = center_slice.obs.index) H = pd.DataFrame(center_slice.uns['paste_H'], columns = center_slice.var.index) - W.to_csv(os.path.join(args.direc,"paste_output/W_center")) - H.to_csv(os.path.join(args.direc,"paste_output/H_center")) + W.to_csv(os.path.join(args.direc, "../../paste_output/W_center")) + H.to_csv(os.path.join(args.direc, "../../paste_output/H_center")) for i in range(len(pis)): output_filename = "paste_output/slice_center_slice" + str(i+1) + "_pairwise.csv" pi = pd.DataFrame(pis[i], index = center_slice.obs.index, columns = slices[i].obs.index) diff --git a/tests/test_paste.py b/tests/test_paste.py index c5e63cf..56fadd1 100644 --- a/tests/test_paste.py +++ b/tests/test_paste.py @@ -6,7 +6,9 @@ import pandas as pd import tempfile -from paste import pairwise_align, center_align, center_ot, intersect, center_NMF +from paste import pairwise_align, center_align +from paste.PASTE import center_ot, intersect, center_NMF + test_dir = Path(__file__).parent input_dir = test_dir / "data/input"