This release is a pre-release and may not be stable for production use.
Protspect
Protein sequence spectral analysis: transform features for proteins and peptides using numeric residue-property channels. This is the original sequence featurization method, separate from the subsequent protein language-model work.
The repository is biomodsquad/protein-sequence-spectral-analysis. The
PyPI distribution is Protspect, imported as protspect. The original
ProSpect distribution name conflicts with an unrelated existing PyPI package.
Version 0.1.0a2 is the second alpha; APIs may change.
Documentation and tutorials
Read the online documentation, covering the unified API in alpha 0.1.0a2.
The documentation source follows the MISTIC Sphinx/Furo layout: installation, matrix-based concepts, eight guided tutorials, downloadable notebooks, and a public API reference. The supplied logo and matrix illustration introduce the residue embedding → zero-padding → sequence-axis transform workflow.
Three self-contained notebooks are bundled in protspect.examples; locate them
with importlib.resources.files("protspect.examples") and copy to a writable
workspace. They cover matrix-to-feature calculations, four transforms and paired
chains, and training-only sklearn pipelines. The full AMP MLP comparison and
embedding atlas remain separate research examples with their documented inputs.
Build a local site with:
python -m pip install -e '.[docs]'
python -m docs.generate_tutorial_figures
python -m sphinx -W --keep-going -b html docs docs/_build/html
See build and validation instructions for executable snippets, notebook checks, and manual Pages publication. The documentation includes executable examples for alpha 0.1.0a2.
Install
Requires Python 3.10 or later. Install the published alpha and its dependencies:
python -m pip install Protspect==0.1.0a2
# Optional scikit-learn integration:
python -m pip install 'Protspect[ml]==0.1.0a2'
For development, install from the repository:
git clone https://github.com/biomodsquad/protein-sequence-spectral-analysis.git
cd protein-sequence-spectral-analysis
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
The distribution is named Protspect. The unrelated prospect package is a
different project.
Alternative transforms
Fourier, circular Z, finite discrete Mellin, and discrete wavelet transforms now
share transform_sequence, with a fixed-width SequenceTransformer for sklearn.
See definitions and examples. Wavelets require the optional
wavelets extra.
Residue representations
Protspect includes the ten Kidera factors (KF1–KF10), in addition to the default BLOSUM100 embedding. See representation documentation and citation.
from protspect import SequenceSet
from protspect.embeddings import kidera_factors
features = SequenceSet(embedding=kidera_factors(), compute_cross_spectra=False)
features.from_sequence_list(["ACDE", "ACDF"], spectrum_length=8)
AAindex1 files can also supply selected property channels:
from protspect.aaindex import AAIndex
database = AAIndex.from_file(".aaindex/aaindex1")
features = SequenceSet(
embedding=database.embedding(["KYTJ820101", "FAUJ880103"]),
compute_cross_spectra=False,
)
See AAindex1 loading, explicit downloads, and provenance. No database is bundled or downloaded during feature extraction.
AAindex2/3 matrices also support explicit row or column profile channels:
from protspect.aaindex import AAIndex2
matrices = AAIndex2.from_file(".aaindex/aaindex2")
embedding = matrices.embedding("HENS920102", axis="rows") # BLOSUM62
See matrix conversion and contact-potential interpretation.
One transform API
The API supports method='fourier'|'z'|'mellin'|'wavelet' throughout.
SequenceSet and ComplexSet remain primary interfaces for single and paired
collections. All entry points share the same backend and feature exporter.
Install Protspect[ml,wavelets]==0.1.0a2 for sklearn and wavelet support.
from protspect import SequenceSet, ComplexSet, transform_sequence
features = SequenceSet(method='fourier', compute_cross_spectra=False)
features.from_sequence_list(['ACDE', 'ACDF'], length=8,
attributes={'name': ['peptide-1', 'peptide-2']})
table = features.export_features('amplitude', attributes=['name'])
print(table.shape) # (2, 161): metadata + 20 channels × 8 unique Fourier bins
pairs = ComplexSet(method='z', transform_options={'radius': 1.05})
pairs.from_sequence_list(['ACDE'], ['ACDF'], length=8)
paired_table = pairs.export_features(('amplitude', 'phase'))
chain_a_table = pairs.export_features('amplitude', chain_ID='A')
result = transform_sequence('ACDE', method='fourier', length=8)
values, names = result.features(selector=lambda c: c['frequency'] >= 0)
The default BLOSUM100 embedding supplies 20 residue-property channels. Kidera, AAindex, and custom channel mappings work with every transform. Inputs are case-sensitive; unknown residues are rejected when not covered by the embedding. All chains in a collection share a fixed grid; no sequence truncation occurs. Per-sequence centering and none/length/sqrt_length/energy normalization operate on real residues before padding. Metadata cannot overwrite features.
component selects amplitude, phase, real, imaginary, or an ordered tuple;
kinds selects coefficients and/or within-channel cross_coefficients.
selector receives named coordinate arrays: frequency for Fourier/Z,
log-frequency for Mellin, band/index for wavelets. Primary exports include
all coefficients by default, with no periodic duplicate. Paired products are
aligned coefficient descriptors, not a physical model of residue contacts.
For fitted pipelines use protspect.sklearn.SequenceTransformer, with the same
method/options/components and coordinate selectors. Set paired=True for
(A, B) samples. Grid and channel moments fit on training chains only; selection
and output columns are frozen. See the unified API,
transform definitions, and
normalization formulas.
SequenceFFT, SpectralTransformer, and the sets' export_datatable methods
remain compatibility adapters. Existing Fourier values, selectors, closure bins,
and feature names are preserved. Use them with existing fitted models; recompute
and refit before switching to the primary full-bin feature schema.
Migration from FFTpro
FFTpro.features, FFTpro.embeddings, and FFTpro.utility remain compatibility
imports. New code should use protspect. The misspelled selector
frequency_selelect_positive is retained as an alias.
Feature values have intentionally changed. The original implementation labeled unshifted FFT coefficients using a centered grid, assigning coefficients to incorrect frequencies. The corrected implementation aligns bins and labels. The BLOSUM100 P-to-A score was also corrected from +2 to -2, matching A-to-P. Regenerate existing feature tables and retrain downstream models; old and new features must not be mixed. Empty sequences, short FFT lengths, unequal pair counts, and unequal metadata lengths now raise errors instead of failing later or silently dropping records.
The historical notebook in FFTpro/examples/ is archived with all saved outputs
cleared; the original CPP CSVs remain unchanged and excluded from distributions.
A new reproducible CPP notebook and workflow uses the
complete official MLCPP 2.0 website datasets and a pinned MISTIC source, a separate locked research environment, training-only model
selection, exact train/test overlap checks, and recorded provenance. See
executed results and
official data preparation and provenance.
Research dependencies are optional and separate from the runtime package.
Use examples/basic_features.py for a minimal core-only example.
Development and release
python -m pytest -q
python -m ruff check .
python -m build
python -m twine check dist/*
For the controlled antimicrobial-peptide correction audit, see
validation/README.md. Install .[dev,validation] to run
its classifier tests and benchmark.
CI checks Python 3.10–3.15 on Linux, macOS, and Windows, installing both
wheel and source archives into fresh environments outside the checkout. Exact
minimum dependencies are checked on Python 3.10. See
the compatibility policy for scope and evidence. See RELEASE_REVIEW.md for findings,
validation evidence, and the remaining release decisions. The current alpha version is
0.1.0a2. The release record links the successful TestPyPI rehearsal
and production download/install checks.
Citation and project contact
Cite the software version and commit used:
Biomolecular Systems Modeling and Design Group. Protspect: protein sequence spectral analysis. Version 0.1.0a2. https://github.com/biomodsquad/protein-sequence-spectral-analysis
Machine-readable metadata is in CITATION.cff. Cite dataset sources and external methods separately; the CPP example lists these in its provenance documentation.
The group maintains this package through GitHub Issues. See the changelog, support policy, and contribution guide.
Licensed under the BSD 3-Clause License.
Metadata
Release files for Protspect 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| protspect-0.1.0a2.tar.gz | 1.6 MB | With provenance | Details for protspect-0.1.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| protspect-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details for protspect-0.1.0a2-py3-none-any.whl |
Total release size: 1.7 MB
Release files / protspect-0.1.0a2.tar.gz
| Download URL | protspect-0.1.0a2.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab5ce90289560bdb91971dd4d9936e91e889df98844a2ba5c285aa74721d6c61
|
|
BLAKE2b-256 checksum How to use checksums |
a8dbd6b22e2f4bd08fa6a361e70705b3b419284b54785273793c5f69867ab742
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / protspect-0.1.0a2-py3-none-any.whl
| Download URL | protspect-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 161.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fe6e7a7c3431016d912c1a24c85b316f56220202c9b75b11ff24302295452cb
|
|
BLAKE2b-256 checksum How to use checksums |
94a3e9683bd677dab41100d5e5e47a35ae3a63ee59c760b112479ede15f229c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for Protspect 0.1.0a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for protspect-0.1.0a2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.