Skip to content
Merged

Dev #47

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f94af5b
set development version 1.1.0-dev in dev branch pyproject.toml
MayraRuizT Feb 24, 2026
da3cd44
pypi version badge
MayraRuizT Feb 24, 2026
63d68a0
Initial plan
Copilot Mar 18, 2026
0149238
Fix pandas 3.0 and matplotlib compatibility issues
Copilot Mar 18, 2026
7ea2076
Add .gitignore to exclude pycache and build artifacts
Copilot Mar 18, 2026
1a2243f
Merge pull request #1 from jsnagai/copilot/update-compatibility-new-p…
jsnagai Mar 19, 2026
d6d090b
update readthedocs config and dependencies for dev branch
MayraRuizT Mar 20, 2026
9b9ea7e
add readthedocs sphinx dependencies to generate docs for the dev branch
MayraRuizT Mar 20, 2026
00a0727
docs: add nbsphinx for notebook support
MayraRuizT Mar 20, 2026
d7aed1f
Relax and align anndata/scanpy dependency constraints
Copilot Apr 23, 2026
449fbdf
Update anndata to 0.12.11 and zarr to 3.1.6; bump Python minimum to 3.11
Copilot Apr 23, 2026
438ad63
Tighten anndata upper bound to <0.13 for safer compatibility
Copilot Apr 23, 2026
083c95c
Pin Pillow to >=12.2.0 to fix FITS GZIP decompression bomb and PSD ou…
Copilot Apr 23, 2026
c2b5cad
Merge pull request #2 from jsnagai/copilot/fix-nichesphere-dependencies
jsnagai Apr 24, 2026
673f7b6
Fix poetry lock file conflict
MayraRuizT Apr 30, 2026
31193a2
revision updates
MayraRuizT Jun 26, 2026
9b15555
signed network statistics
MayraRuizT Jul 20, 2026
ec79db1
add functions for co-localization in spatial sc data
MayraRuizT Jul 23, 2026
c142c6b
add sankey_plot module
MayraRuizT Jul 23, 2026
168ca5b
add sankey module to init
MayraRuizT Jul 23, 2026
6644fca
optimize getColocProbs with matrix operation
MayraRuizT Jul 27, 2026
e65b363
optimize coloc and comm modules changing for loops for other operations
MayraRuizT Jul 28, 2026
c2ef41e
reshapeColoc bug fix
MayraRuizT Jul 28, 2026
8946b3b
debug comm optimized functions
MayraRuizT Jul 28, 2026
83dca80
Update .gitignore with missing rules
MayraRuizT Jul 28, 2026
a0c253b
Update tutorial files and docs
MayraRuizT Jul 28, 2026
c8d75a6
add data load function
MayraRuizT Jul 29, 2026
1e613ed
update tutorials
MayraRuizT Jul 29, 2026
7799467
Stop tracking tutorial result files
MayraRuizT Jul 29, 2026
f101030
Update tests and delete old files
MayraRuizT Jul 30, 2026
64a291b
fix: adjust python version matrix in CI workflow
MayraRuizT Jul 30, 2026
29d60a1
fix: add plotly to dependencies in pyproject.toml
MayraRuizT Jul 30, 2026
fb8d67f
add spotweights parameter to getColocProbs in case eg: cell number pe…
MayraRuizT Aug 6, 2026
28ab9e3
Fix cell type names bug in colocNW and optimize get_spatial_radius_BG…
MayraRuizT Aug 6, 2026
42361e5
Update tutorials
MayraRuizT Aug 6, 2026
9794082
Fix cell type color bug for catNW
MayraRuizT Aug 6, 2026
42b4acb
update main tutorial
MayraRuizT Aug 6, 2026
5484bff
add signed stats node sizes options in network functions
MayraRuizT Aug 10, 2026
ce08051
add documentation to comm network new nodeSize options, fix small bug
MayraRuizT Aug 10, 2026
4fcc059
add signed stats node sizes for interactive network vis
MayraRuizT Aug 10, 2026
be1e1cf
small fix in assign_properties
MayraRuizT Aug 10, 2026
f2e6e9b
another small fix in assign_properties
MayraRuizT Aug 10, 2026
2ad6154
another small fix in assign_properties...
MayraRuizT Aug 10, 2026
9e8ce24
fix node sizes for signed stats in assign_properties
MayraRuizT Aug 10, 2026
49c4927
last touch to node sizes for signed stats in assign_properties
MayraRuizT Aug 10, 2026
da1ac84
New Layout Design
jmichellejm Aug 20, 2026
50f2343
new layout requirements
jmichellejm Aug 24, 2026
571babc
style: break line before parameters in getColocProbs (coloc_module)
jmichellejm Aug 27, 2026
187c50e
Merge pull request #45 from CostaLab/dev_doc
MayraRuizT Sep 1, 2026
655cb8f
small fix in tutorials python code color
jmichellejm Sep 1, 2026
dae6f72
Merge pull request #46 from CostaLab/dev_doc
MayraRuizT Sep 1, 2026
e848219
add CODEX tutorial , correct PILOT acronym
MayraRuizT Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@ name: Python package

on:
push:
branches: [ "main", "doc" ] # Added "doc" so you can see if it works before merging!
branches: [ "main", "dev", "doc" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10","3.11","3.12"]
python-version: ["3.11", "3.12", "3.14"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 # Updated to v5 (current best practice)
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
# IMPORTANT: This installs YOUR local code from the current branch
pip install -e .
# Check if requirements exist in the new root or docs folder
pip install -e .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
Expand All @@ -39,5 +37,4 @@ jobs:

- name: Test with pytest
run: |
# This tells pytest to look in your new root tests/ folder
pytest tests/
pytest tests/
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
__pycache__/
*.py[cod]
*.egg-info/
dist/
build/
.eggs/
data/
figures/
results/
.ipynb_checkpoints/
*.pyc
Results_PILOT/
docs/build/
docs/_build/
docs/generated/
nichesphere/
4 changes: 4 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ sphinx:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
# 1. Install all dependencies (statsmodels, joblib, gravis)
- requirements: docs/requirements.txt
# 2. Install the library itself so Sphinx can find your code
- method: pip
path: .
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
Expand Down
104 changes: 104 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/* --- Custom sidebar logo size --- */

img[src*="logo.png"] {
max-height: 150px !important; /* Limits maximum image height */
height: 150px !important; /* Forces a fixed height of 140px */
width: auto !important; /* Maintains aspect ratio automatically */
}




/* --- Logo home page --- */

/* Margin and spacing around the floating logo */
img.logo-header {
background: none !important;
margin-left: 30px !important;
margin-bottom: 20px !important;
margin-top: -10px !important; /* Slightly aligns the top of the logo with the heading */
}

/* Improves text flow next to the logo */
p {
text-align: justify;
line-height: 1.6 !important;
}

/* Clears floating alignment after the first block to prevent layout issues */
.clear-float {
clear: both;
}




/* --- Styles for the nbgallery (Thumbnails in tutorial section) --- */

/* Gallery container: uses flexbox to align cards */
div.nbgallery {
display: flex !important;
flex-wrap: wrap !important;
gap: 15px !important;
margin-top: 20px !important;
margin-bottom: 25px !important;
align-items: stretch !important; /* IMPORTANT: Ensures all cards in the row have the same height */
}

/* Individual Card Formatting */
.nbsphinx-gallery .sphx-glr-thumbcontainer,
div.nbgallery > div {
border: 1px solid #e2e8f0 !important; /* Soft solid gray border */
border-style: solid !important;
border-radius: 50px !important; /* Rounded corners */
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important; /* Soft shadow */
background-color: #ffffff !important;
padding: 15px !important;
width: 210px !important; /* Uniform width */
display: flex !important;
flex-direction: column !important; /* Column layout: Image top, Text bottom */
justify-content: flex-start !important; /* Content starts at the top */
transition: transform 0.2s ease, box-shadow 0.2s ease !important;
height: auto !important; /* IMPORTANT: Do not force fixed height */
box-sizing: border-box !important;
}

/* Hover effect in tutorial notebooks*/
.nbsphinx-gallery .sphx-glr-thumbcontainer:hover,
div.nbgallery > div:hover {
transform: translateY(-3px) !important;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
border-color: #cbd5e1 !important;
}

/* Image inside the card */
.nbsphinx-gallery .sphx-glr-thumbcontainer img,
div.nbgallery img {
max-height: 120px !important;
object-fit: contain !important;
margin: 0 auto !important;
display: block !important;
border-bottom: 1px solid #f1f5f9 !important; /* Divider line below image */
padding-bottom: 10px !important;
margin-bottom: 0 !important; /* REMOVES margin that pushed text down */
}

/* Notebook Text/Title style */
.nbsphinx-gallery a,
div.nbgallery a,
.nbsphinx-gallery .sphx-glr-thumbcontainer a {
color: var(--color-foreground-primary, currentColor) !important; /* Professional dark text color */
font-weight: 600 !important;
font-size: 0.9em !important;
line-height: 1.4 !important;
text-decoration: none !important; /* Removes blue underline */
text-align: center !important;
margin-top: 10px !important; /* Space between divider line and text */
display: block !important;
width: 100% !important;
}

.nbsphinx-gallery a:hover,
div.nbgallery a:hover {
color: var(--color-brand-primary, #2563eb) !important;
}
11 changes: 5 additions & 6 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
API Reference
=============

.. toctree::
:maxdepth: 2

coloc
comm
tl
.. include:: coloc.rst
.. include:: comm.rst
.. include:: tl.rst
.. include:: niche_stats.rst
.. include:: sankey.rst
25 changes: 20 additions & 5 deletions docs/coloc.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
.. custom label for :ref: on the home page
.. _api_coloc:

coloc module
=======================
--------------

Focused on differential co-localization

.. automodule:: nichesphere.coloc
:members:
:undoc-members:
:show-inheritance:
.. autosummary::
:toctree: generated
:nosignatures:

~nichesphere.coloc.OvsE_coloc_test
~nichesphere.coloc.OvsE_coloc_test_adjPval
~nichesphere.coloc.cellCatContained
~nichesphere.coloc.colocNW
~nichesphere.coloc.compute_sc_spatial_knn_coloc_matrix
~nichesphere.coloc.compute_sc_spatial_radius_coloc_matrix
~nichesphere.coloc.diffColoc_test
~nichesphere.coloc.getColocProbs
~nichesphere.coloc.reshapeColoc
~nichesphere.coloc.spatialCTPlot
~nichesphere.coloc.spatialNichePlot
~nichesphere.coloc.spatialSingleCTPlot
22 changes: 17 additions & 5 deletions docs/comm.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
.. custom label for :ref: on the home page
.. _api_comm:

comm module
=======================
--------------

Focused on differential communication

.. automodule:: nichesphere.comm
:members:
:undoc-members:
:show-inheritance:
.. autosummary::
:toctree: generated
:nosignatures:

~nichesphere.comm.calculate_LR_CT_pair_scores_dir
~nichesphere.comm.catNW
~nichesphere.comm.cellCatContained
~nichesphere.comm.diffCcommStats
~nichesphere.comm.equalizeScoresTable
~nichesphere.comm.getDiffComm
~nichesphere.comm.lr_ctPairScores_perCat_dir
~nichesphere.comm.plotDiffCcommStatsHM
~nichesphere.comm.unique
69 changes: 56 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,74 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx_rtd_theme', 'nbsphinx', 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx']

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx_book_theme',
'nbsphinx',
'sphinx.ext.autosummary',
'sphinxcontrib.bibtex',
'sphinx.ext.intersphinx',
'sphinx_design']

autosummary_generate = True # Auto-generates individual API doc pages from summary tables
templates_path = ['_templates']
exclude_patterns = []

language = 'English'
language = 'en'

# -- BibTeX citation settings
bibtex_bibfiles = ['references.bib']
bibtex_default_style = 'alpha'

# -- It hides the input/output prompt numbers (In [1]: / Out [1]:).
nbsphinx_prolog = """
.. raw:: html

<style>
div.nbinput.container div.prompt,
div.nboutput.container div.prompt,
span.prompt {
display: none !important;
min-width: 0 !important;
padding: 0 !important;
}
</style>
"""

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

#import sphinx_rtd_theme
#import sphinx_book_theme

html_theme = 'sphinx_book_theme'

pygments_style = 'sphinx'

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

# Path to the logo relative to the configuration directory
html_logo = "_static/logo.png"

# Ensure the static path is included so Sphinx finds the file
html_static_path = ['_static']
# Link custom CSS (logo sizing and styling, located in '_static')
html_css_files = [
"custom.css",
]

# (Optional) If you want ONLY the logo to show without the project name text
# Specific parameters passed directly to the 'sphinx_book_theme'.
html_theme_options = {
'logo_only': True,
'display_version': False,
}


# URL of the GitHub repository
"repository_url": "https://github.com/CostaLab/Nichesphere",
# GitHub button in the top navigation bar
"use_repository_button": True,
# Show a download button (e.g., PDF or Markdown/RST)
"use_download_button": True,
# Full-screen reading mode
"use_fullscreen_button": True,
# Collapse inactive subsections in the left sidebar to keep it tidy
"collapse_navbar": True,
# Set the maximum depth of heading levels (H1 to H4) shown in the right-hand page TOC
"show_toc_level": 4,
# Control how many navigation levels deep are automatically expanded in the left sidebar
"show_navbar_depth": 2,
}
6 changes: 6 additions & 0 deletions docs/generated/nichesphere.coloc.OvsE_coloc_test.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nichesphere.coloc.OvsE\_coloc\_test
===================================

.. currentmodule:: nichesphere.coloc

.. autofunction:: OvsE_coloc_test
6 changes: 6 additions & 0 deletions docs/generated/nichesphere.coloc.OvsE_coloc_test_adjPval.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nichesphere.coloc.OvsE\_coloc\_test\_adjPval
============================================

.. currentmodule:: nichesphere.coloc

.. autofunction:: OvsE_coloc_test_adjPval
6 changes: 6 additions & 0 deletions docs/generated/nichesphere.coloc.cellCatContained.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nichesphere.coloc.cellCatContained
==================================

.. currentmodule:: nichesphere.coloc

.. autofunction:: cellCatContained
6 changes: 6 additions & 0 deletions docs/generated/nichesphere.coloc.colocNW.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nichesphere.coloc.colocNW
=========================

.. currentmodule:: nichesphere.coloc

.. autofunction:: colocNW
6 changes: 6 additions & 0 deletions docs/generated/nichesphere.coloc.colocNW_old.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nichesphere.coloc.colocNW\_old
==============================

.. currentmodule:: nichesphere.coloc

.. autofunction:: colocNW_old
Loading
Loading