Spirogram
Documentation: User Manual · Source Code: GitHub · Report Issues: Issues
Spirogram is a Python package for creating spiral chronograms, a spiral visualization designed for chronological data. The package is intended for datasets containing pairs of collection dates together with an associated quantitative measurement. The measurement may represent quantities such as genetic distances, similarity scores, temperature differences, or any other numeric value defined between two time points.
The package accepts multiple input formats, performs data validation and preprocessing, transforms the data into spiral coordinates, and generates customizable spiral chronograms.
Installation
Install the package using pip.
pip install spirogram
Requirements
- Python 3.10 or later
The following packages are installed automatically when installing spirogram:
- NumPy
- pandas
- matplotlib
Supported File Formats
Input data may be provided as .csv, .dat, or .json files, or as a pandas DataFrame passed directly.
Quick Start
Import the package.
from spirogram import spirogram
Supported Input Formats
Long-format
Each row represents one pairwise comparison.
Required columns:
- Later collection date
- Earlier collection date
- Quantitative measurement
Example
| LaterDate | EarlierDate | Distance |
|---|---|---|
| 2020-04-10 | 2020-03-15 | 0.0024 |
| 2020-04-15 | 2020-03-20 | 0.0031 |
Matrix-format
The input consists of a square distance matrix whose rows and columns correspond to collection dates. The package accepts
- Full matrices
- Upper triangular matrices
- Lower triangular matrices
The matrix is automatically converted internally into the standard long format before generating the spirogram.
Examples
The examples below use SARS-CoV-2 spike protein sequence data downloaded from the National Center for Biotechnology Information (NCBI). The sequences were collected in Illinois between March 2020 and April 2026, and pairwise genetic distances were calculated between collection dates.
Long-format data
spirogram(file="data/spiroExample_long.csv", dataFormat="long",
laterDate="Date", earlierDate="EarlierDate", distance="Meankdistance")
Matrix-format data
spirogram(file="data/spiroExample_matrix.json", dataFormat="matrix",matrixType="full", invalidDates="drop", cmap="Spectral", turns=5)
Main Function
spirogram(...)
The package provides numerous options for customizing the visualization, including
- spiral spacing
- number of turns
- angular correction
- color maps
- point size
- color scale
- plot title
- colorbar label
- data coverage summary
- returning the processed data
See the User Manual for a complete description of every argument.
License
This project is distributed under the GNU General Public License v3.0.
Acknowledgements
We would like to express our gratitude to Dr. Mengfei Ho, Assistant Research Professor, and Dr. Brenda Wilson, Professor, Department of Microbiology, School of Molecular & Cellular Biology, University of Illinois Urbana-Champaign, for their guidance, many helpful discussions and feedback throughout this project.
We thank Professor Douglas Simpson, Director of the Institute for Mathematical and Statistical Innovation (IMSI), and acknowledge the support of the IMSI Summer Internship Program, funded by the National Science Foundation Grant No. DMS-2425650.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spirogram-1.0.0.tar.gz.
File metadata
- Download URL: spirogram-1.0.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772018737427a733170431861785d3f730e23bef76874e8ba4bf19009344082a
|
|
| MD5 |
c6c625c7f6e19df3be214e11070eba13
|
|
| BLAKE2b-256 |
a4009acbd52a84115450269f74a7e4b211d02e1dfbcdde5926953eb295801531
|
Provenance
The following attestation bundles were made for spirogram-1.0.0.tar.gz:
Publisher:
release.yml on sfmensah/spirogram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spirogram-1.0.0.tar.gz -
Subject digest:
772018737427a733170431861785d3f730e23bef76874e8ba4bf19009344082a - Sigstore transparency entry: 2734421270
- Sigstore integration time:
-
Permalink:
sfmensah/spirogram@5239468a2f5063c11974be8b4a0b1c0c5895959d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/sfmensah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5239468a2f5063c11974be8b4a0b1c0c5895959d -
Trigger Event:
release
-
Statement type:
File details
Details for the file spirogram-1.0.0-py3-none-any.whl.
File metadata
- Download URL: spirogram-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6700d3ac19abc55d6aee5cf92ba5a59f522925a9cd474ccf2606f5dbb7dc9048
|
|
| MD5 |
88f748622ee7db9fc8402f2ee2c6554d
|
|
| BLAKE2b-256 |
79727179112b8f3d4f624d0d2d8b0a1c8e44ff38f65bb17b9a57da31fdbc3576
|
Provenance
The following attestation bundles were made for spirogram-1.0.0-py3-none-any.whl:
Publisher:
release.yml on sfmensah/spirogram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spirogram-1.0.0-py3-none-any.whl -
Subject digest:
6700d3ac19abc55d6aee5cf92ba5a59f522925a9cd474ccf2606f5dbb7dc9048 - Sigstore transparency entry: 2734421837
- Sigstore integration time:
-
Permalink:
sfmensah/spirogram@5239468a2f5063c11974be8b4a0b1c0c5895959d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/sfmensah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5239468a2f5063c11974be8b4a0b1c0c5895959d -
Trigger Event:
release
-
Statement type: