Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
39 changes: 39 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Wider main content column */
/* .bd-main .bd-content .bd-article-container {
max-width: 75em;
} */

/* Optional: allow the whole page layout to grow too */
/* .bd-page-width {
max-width: 100rem;
} */

/* Wrap */

.bd-content h1 {
overflow-wrap: anywhere;
}

.prev-next-area a {
overflow-x: visible;
}

.prev-next-area a .prev-next-info {
min-width: 0;
}

.prev-next-area a p.prev-next-title {
overflow-wrap: anywhere;
}

span.pre {
white-space: normal;
overflow-wrap: anywhere;
}

/* Except */

nav.page-toc span.pre {
white-space: pre;
overflow-wrap: normal;
}
16 changes: 16 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Python API reference
====================

This section documents the public Python API for Pixelator.

.. toctree::
:maxdepth: 1

overview


.. toctree::
:maxdepth: 1
:caption: Complete reference:

generated/pixelator/index
18 changes: 18 additions & 0 deletions docs/api/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
API overview
==============

Primary entry points for PNA analysis.

**Reader**

* :func:`pixelator.read_pna`


**Datasets**

.. * :class:`pixelator.pna.pixeldataset.dataset.PixelDataset`
* :class:`pixelator.pna.pixeldataset.download.DownloadableDatasets`

.. **Configuration**

.. * :class:`pixelator.pna.config.config_instance.pna_config`
8 changes: 8 additions & 0 deletions docs/cli/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Command-line interface
======================

This section documents the Pixelator command-line interface.

.. click:: pixelator.cli.main:main_cli
:prog: pixelator
:nested: full
120 changes: 120 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information


project = "Pixelator"
copyright = "2026 Pixelgen Technologies"
author = "Pixelgen Technologies"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

nitpicky = True
nitpick_ignore = [
# --- MPX excluded from AutoAPI ---
("py:class", "pixelator.mpx.graph.Graph"),
# --- No public intersphinx inventory ---
# (see if these can be resolved without ignoring)
("py:class", "duckdb.DuckDBPyConnection"),
("py:class", "faiss.IndexBinary"),
]

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx_design",
"autoapi.extension",
"sphinx_click",
]

autoapi_type = "python"
autoapi_dirs = ["../src/pixelator"]
autoapi_root = "api/generated"
autoapi_add_toctree_entry = False

autoapi_ignore = [
"*/pixelator/mpx/*",
"*/pixelator/mpx/**/*",
"*/pixelator/cli/*",
"*/pixelator/cli/**/*",
"*/pixelator/pna/cli/*",
"*/pixelator/pna/cli/**/*",
"*/__pycache__/*",
"*/__pycache__/**/*",
]

# Options for AutoAPI
autoapi_options = [
"members", # Display children of an object
"show-inheritance", # Display a list of base classes below the class signature
"show-module-summary", # Whether to include autosummary directives in generated module documentation.
"undoc-members", # Display objects that have no docstring
"imported-members", # For objects imported into a package, display objects imported from the same top level package or module.
# "special-members", # Display special objects (eg. __foo__ in Python)
# "inherited-members", # Display children of an object that have been inherited from a base class.
# Note the absence of the option private-members
]

autoapi_member_order = "alphabetical"
autoapi_python_class_content = "both"
autoapi_python_use_implicit_namespaces = True
autoapi_own_page_level = "class"
autoapi_own_page_level = "function"
Comment on lines +68 to +69

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
autoapi_own_page_level = "class"
autoapi_own_page_level = "function"
autoapi_own_page_level = "function"



templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


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

html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_css_files = ["custom.css"]

autodoc_member_order = "alphabetical"
autodoc_typehints = "signature"
autodoc_typehints_format = "short"
autodoc_typehints_description_target = "documented_params"

napoleon_google_docstring = True
napoleon_numpy_docstring = False

napoleon_include_init_with_doc = True

napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = False

napoleon_use_param = True
napoleon_use_rtype = True
napoleon_use_ivar = True

napoleon_attr_annotations = True

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"seaborn": ("https://seaborn.pydata.org/", None),
"polars": ("https://docs.pola.rs/api/python/stable/", None),
"pydantic": ("https://docs.pydantic.dev/latest/", None),
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"cutadapt": ("https://cutadapt.readthedocs.io/en/stable/", None),
"dnaio": ("https://dnaio.readthedocs.io/en/stable/", None),
"pyarrow": ("https://arrow.apache.org/docs/", None),
"networkx": ("https://networkx.org/documentation/stable/", None),
"click": ("https://click.palletsprojects.com/en/stable/", None),
"packaging": ("https://packaging.pypa.io/en/stable/", None),
"sklearn": ("https://scikit-learn.org/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
}
54 changes: 54 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Pixelator documentation
=======================

Pixelgen Technologies provides Pixelator, a suite of open source
software solutions that empower users working with
`Molecular Pixelation (MPX) <https://software.pixelgen.com/common/glossary/#mpx>`_
and `Proximity Network (PNA) <https://software.pixelgen.com/common/glossary/#pna>`_
assays in data processing and analysis.

Pixelator can be used in two ways: as a data processing pipeline
(nf-core/pixelator) and as a programming library (pixelator).
The pipeline nf-core/pixelator consists of several steps and will produce
ready-to-analyze outputs from your initial FASTQ sequencing libraries.
Usage of Pixelator as a programming library is covered in the API reference and in
our data analysis sections for MPX and PNA (section for PNA is linked below as "Tutorials").


.. grid:: 1 1 2 2
:gutter: 2

.. grid-item-card:: Python API reference
:link: api/index
:link-type: doc

Browse Python modules, classes, functions, and methods.

.. grid-item-card:: Command-line interface
:link: cli/index
:link-type: doc

Browse Pixelator command-line interface commands, options, and arguments.

.. grid-item-card:: Pixelgen software site
:link: https://software.pixelgen.com/
:link-type: url

See the Pixelgen software site for information about
software, analysis, and datasets.

.. .. grid-item-card:: Tutorials
.. :link: https://software.pixelgen.com/pna-analysis/introduction/
.. :link-type: url

.. See tutorials and code examples for getting started
.. with Proximity Network Assay (PNA) data analysis
.. using Pixelator as a Python library.

.. toctree::
:maxdepth: 2
:caption: Contents:
:hidden:

api/index
cli/index
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ dev = [
"line-profiler>=5.0.2",
"ipykernel>=7.2.0",
]
docs = [
"pydata-sphinx-theme>=0.19.0",
"sphinx>=8.1.3",
"sphinx-autoapi>=3.8.0",
"sphinx-autobuild>=2024.10.3",
"sphinx-click>=6.2.0",
"sphinx-design>=0.6.1",
]


[project.scripts]
Expand Down
13 changes: 9 additions & 4 deletions src/pixelator/pna/pixeldataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@


def read(paths: Path | list[Path] | str | list[str]) -> PNAPixelDataset:
"""Read a PNAPixelDataset from one or more provided .pxl file(s).
"""Read data from one or more ``.pxl`` files.

Args:
path: path to the file to read
paths: Paths.
paths: One or more paths to ``.pxl`` files. A single path or a list of
paths may be passed. Each path may be a ``pathlib.Path`` or ``str``.

Returns:
an instance of `PNAPixelDataset`
The data from the ``.pxl`` file(s).

Raises:
IOException: If a file is not a DuckDB database file.
ValueError: If a file is not a valid ``.pxl`` file, if a sample name cannot be determined from file metadata.
FileNotFoundError: If any path does not exist on disk.
"""
if not paths:
raise ValueError(
Expand Down
Loading
Loading