Skip to main content

Python SDK for the NativeReady API: predict native mass spectrometry suitability from a protein sequence.

Project description

nativeready

Python SDK for the NativeReady API. Predict whether a protein sequence is likely to give usable native mass spectrometry data, in seconds.

pip install nativeready

Quick start

from nativeready import predict

result = predict("MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG")
print(result)
# PredictionResult(score=97, label='Excellent', ci=[88-100], model='0.4-esm2-glyco-tm')

print(result.score)         # 97
print(result.label)         # 'Excellent'
print(result.is_ood)        # False
print(result.recommendations)

Common use cases

Predict from a FASTA file

from nativeready import Client

client = Client()
results = client.predict_fasta("my_proteins.fasta")
for r in results:
    print(r.uniprot_id, r.score, r.label)

Predict from a UniProt accession

from nativeready import Client

client = Client()
result = client.predict_uniprot("P00918")  # Carbonic anhydrase 2
print(result.score, result.label)

Batch prediction with progress bar

from nativeready import Client

client = Client()
sequences = [
    {"id": "ubiquitin", "sequence": "MQIFVKTLTGKTITLEV..."},
    {"id": "lysozyme",  "sequence": "KVFGRCELAAAMKR..."},
    "MSHHWGYGKHNGPEHWHKDF...",  # raw string also works
]
results = client.predict_batch(sequences)  # tqdm progress bar if installed

Pandas DataFrame output (with pandas extra)

pip install nativeready[pandas]
import pandas as pd
from nativeready import Client

client = Client()
results = client.predict_fasta("my_proteins.fasta")
df = pd.DataFrame([r.as_dict() for r in results])
df.to_csv("results.csv", index=False)

Command line interface

The package installs a nativeready CLI:

# Single sequence
nativeready predict --sequence "MQIFVKTLTGKTITLEV..."

# UniProt accession
nativeready predict --uniprot P00918

# Multiple UniProt accessions (comma-separated)
nativeready predict --uniprot P00918,P0CG48,P00698

# FASTA file with CSV output
nativeready predict --fasta proteins.fasta --output results.csv

# FASTA file with JSON output
nativeready predict --fasta proteins.fasta --output results.json

# Health check
nativeready health

# Public feedback statistics
nativeready stats

What the predictions mean

Each PredictionResult contains:

  • score — calibrated suitability score, 0 to 100
  • labelExcellent (>= 80), Good (>= 65), Fair (>= 50), Poor (>= 35), Unsuitable (< 35)
  • confidence_lower, confidence_upper — 95 percent confidence interval (wider when out-of-distribution)
  • is_oodTrue if the sequence is unusual relative to training data; trust the score with extra caution
  • risk_factors — per-feature risk levels (length, MW, hydrophobicity, pI, instability, cysteine content)
  • recommendations — buffer choice, sample-prep guidance, and instrument-mode notes
  • model_version — server-side model identifier (e.g., 0.4-esm2-glyco-tm)

API server

By default the SDK calls https://nativeready-production.up.railway.app. To use a self-hosted or local deployment:

from nativeready import Client
client = Client(base_url="http://localhost:8000")

Honest scope

NativeReady is currently most reliable as a positive-suitability triage tool, not a validated failure detector. With only two evidence-based real-failure records in the training set, the negative-class performance is not yet statistically meaningful. High-confidence positive predictions can be trusted; low-confidence predictions should be treated as a flag for manual review, not a verdict. See the bioRxiv preprint for full methodology and limitations.

Citing

Znabu BFZ, Atif Z. NativeReady: an open benchmark and sequence-based triage
model for native mass spectrometry suitability. bioRxiv, 2026.
https://doi.org/10.64898/2026.05.03.722506

License

MIT. See LICENSE.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nativeready-0.4.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nativeready-0.4.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file nativeready-0.4.0.tar.gz.

File metadata

  • Download URL: nativeready-0.4.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for nativeready-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e3f12d06641c9e34b2fe1d3cf0fd17d48b6351d14a4123fe75b6a0be27d18c7e
MD5 84b1250563c68ecacafa03eab4368048
BLAKE2b-256 722bcce70557d7d04a7ab30061e156cd8d13662ab3c09a4b1f4600eb505182ea

See more details on using hashes here.

File details

Details for the file nativeready-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: nativeready-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for nativeready-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b143aa8b10fb77ae62e92f34299972402659a683d6967d4ef0e505fd36fc6e9b
MD5 69aead0ffd68caf2311a2977782b06c1
BLAKE2b-256 a530b877bf6b54a4eb4d95a563956972c187cffa90d16f0adf878d4a43b9199a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page