Metadata-Version: 2.5
Name: pepkio-mol-mass-converter
Version: 0.1.0
Summary: Python client for Pepkio mol-mass-converter tool
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: click>=8.4.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.13.4
Description-Content-Type: text/markdown

# Pepkio Molecular Mass Converter

Submit converter, batch, and purity jobs for dsDNA, ssDNA, ssRNA, and protein to the Pepkio Molecular Mass Converter REST API from Python scripts and notebooks.

# What It Does

Spectrophotometer and NanoDrop workflows need consistent answers when converting OD₂₆₀ to ng/µL and nM, translating protein mg/mL to µM, interpreting A260/A280 purity, or processing multi-sample instrument exports. Re-implementing extinction coefficients, length-based factors, and batch parsing in every notebook is slow and error-prone.

This package calls the same Pepkio Tools engine as the hosted [Molecular Mass Converter](https://www.pepkio.com/tools/mol-mass-converter) web calculator. Send manifest-defined inputs for one of three `mode` values (`converter`, `batch`, `purity`); receive structured `fields`, optional `warnings`, `coefficient_source`, and shareable run permalinks.

Programmatic runs require a network connection and a Pepkio API key. Calculator logic is hosted remotely; the client is not an offline conversion library.

# Features

- Three API modes: `converter` (bidirectional anchor-field conversion), `batch` (NanoDrop CSV up to 96 rows), `purity` (A260/A280 and optional A230 interpretation)
- Molecule types: dsDNA, ssDNA, ssRNA, protein
- Optional `sequence` for nearest-neighbor extinction; `length_bp` or `mw_kda` for nucleic acids and protein respectively
- Manifest examples: `dsdna_od1_1000bp`, `bsa_1mg_ml`, `purity_dsdna_clean`, `batch_three_rows`
- Configuration via `PEPKIO_API_KEY` and `PEPKIO_API_BASE_URL`

# Installation


Set an API key with **tools:run** scope before calling the API:

```bash
export PEPKIO_API_KEY="your-key"
```

Create a key in your [Pepkio account API keys](https://www.pepkio.com/account/api-keys) settings.

# Quick Example

```bash
curl -s -X POST https://tools.pepkio.com/api/tools/v1/tools/mol-mass-converter/run \
  -H "Authorization: Bearer $PEPKIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "mode": "converter",
      "molecule_type": "dsDNA",
      "anchor_field": "od260",
      "anchor_value": 1,
      "length_bp": 1000
    }
  }'
```

Manifest (no API key required):

```bash
curl -s https://tools.pepkio.com/api/tools/v1/tools/mol-mass-converter/manifest
```

Python client API:

# Typical Use Cases

- Convert OD₂₆₀ to ng/µL and nM for dsDNA library fragments in automated prep pipelines
- Translate mg/mL protein stocks to µM for assay design
- Batch-process NanoDrop exports for NGS library QC
- Flag A260/A280 purity issues before PCR or sequencing
- Sequence-aware extinction for GC-rich or AT-rich templates

# Scientific Background

Converter mode uses `anchor_field` + `anchor_value` bidirectionally across related units. Nucleic acids accept `length_bp` or optional `sequence` for nearest-neighbor extinction. Protein requires `mw_kda`. Batch mode parses `csv_text` with `default_length_bp` or `default_mw_kda` fallbacks. Purity mode returns ratio and flag fields from `a260`, `a280`, and optional `a230`.

# Web Application

For researchers who prefer a graphical interface, an interactive web version is available.

Web Application: https://www.pepkio.com/tools/mol-mass-converter

The web UI adds paste-with-units input, sequence extinction badges, batch mode for up to 96 NanoDrop rows, a Purity tab with plain-language warnings, a Dilution Advisor, CSV export, and browser calculation history.

# Documentation and Resources

GitHub Repository: https://github.com/pepkio/pepkio-mol-mass-converter

Web Application: https://www.pepkio.com/tools/mol-mass-converter

# About Pepkio

Pepkio (https://www.pepkio.com/) develops software tools and provides bioinformatics analysis services for life science research. Additional tools and analysis services are available at https://www.pepkio.com/cro.

# Keywords

molecular mass converter, OD260 to ng/uL, NanoDrop API, DNA RNA protein conversion, dsDNA nM calculator, protein mg/mL to uM, A260 A280 purity, batch spectrophotometer, nucleic acid extinction, pepkio-mol-mass-converter, Pepkio tools API, laboratory calculation automation, converter batch purity modes, sequence extinction coefficient, REST API molecular mass, notebook-ready quantification, run Pepkio mol mass converter from Python, API-based NanoDrop batch conversion, interpret DNA purity ratios programmatically, anchor field bidirectional conversion API

A semantic, AI-native version of this document in the K2F format is available at https://k2f.dev (https://k2f.dev/v/9bb0729bef5dcc9dae6b88db0943fa795b2b7c65f3f342145ec44a4a6e1a8b41)
