Skip to main content

I/O and models in type-annotated Python for NGS sample sheets: Illumina and Aviti

Project description

PyPI - Version PyPI - Types PyPI - Python Version CI docs

El Sheeto

I/O and models in type-annotated Python for NGS sample sheets: Illumina (v1) and Aviti

Features

Parsing & Reading:

  • Parse Illumina sample sheets (v1 format)
  • Parse Aviti sample sheets (Sequencing Manifests) with composite index support
  • Type-safe Pydantic models with comprehensive validation
  • Three-stage parsing architecture for robust error handling

Modification & Writing:

  • Modify existing sample sheets with fluent API
  • Add, remove, and update samples, run values, and settings
  • Builder pattern for complex sheet construction
  • Export modified sheets back to CSV format
  • Round-trip compatibility: parse → modify → write → parse

Key Capabilities:

  • Composite index handling for Aviti (e.g., ATCG+GCTA)
  • Case-insensitive field access
  • Immutable data structures with modification methods
  • 100% type coverage with mypy/pyright
  • Comprehensive test suite

Quick Start

Parsing Sample Sheets

from elsheeto import parse_aviti, parse_illumina_v1

# Parse Aviti sample sheet
aviti_sheet = parse_aviti("sequencing_manifest.csv")
print(f"Found {len(aviti_sheet.samples)} samples")

# Parse Illumina v1 sample sheet
illumina_sheet = parse_illumina_v1("sample_sheet.csv")
print(f"Found {len(illumina_sheet.samples)} samples")

Modifying Sample Sheets

from elsheeto import parse_aviti, write_aviti_to_file
from elsheeto.models.aviti import AvitiSample

# Load and modify existing sheet
sheet = parse_aviti("experiment.csv")
modified_sheet = (sheet
    .with_sample_added(AvitiSample(
        sample_name="New_Sample",
        index1="ATCGATCG",
        project="MyProject"
    ))
    .with_sample_modified("Old_Sample", project="UpdatedProject")
    .with_run_value_added("ModificationDate", "2024-01-15")
)

# Write back to file
write_aviti_to_file(modified_sheet, "modified_experiment.csv")

Creating New Sample Sheets

from elsheeto.models.aviti import AvitiSheetBuilder, AvitiSample

# Build new sheet from scratch
sheet = (AvitiSheetBuilder()
    .add_run_value("Experiment", "EXP_001")
    .add_setting("ReadLength", "150")
    .add_sample(AvitiSample(
        sample_name="Sample_1",
        index1="ATCGATCG",
        project="MyProject"
    ))
    .build())

# Export to CSV
csv_content = sheet.to_csv()

Examples

See the examples/ directory for comprehensive usage examples:

  • examples/quick_start_aviti.py - Simple introduction to key features
  • examples/modify_aviti.py - Complete modification guide with advanced patterns
  • examples/read_aviti.py - Parsing and analysis examples
  • examples/read_illumina_v1.py - Illumina v1 parsing examples

Installation

pip install elsheeto

Documentation

Complete documentation is available at ReadTheDocs, including:

Contributing

Contributions are welcome! Please see the development setup in the repository for details on:

  • Type safety requirements (100% mypy/pyright compliance)
  • Testing with pytest
  • Code formatting with black and ruff
  • Three-stage parsing architecture

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

elsheeto-0.3.2.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

elsheeto-0.3.2-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file elsheeto-0.3.2.tar.gz.

File metadata

  • Download URL: elsheeto-0.3.2.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for elsheeto-0.3.2.tar.gz
Algorithm Hash digest
SHA256 17d197a7df5deb62d521761c0965907b73c4bb79fb41d32215850ceef7f34fec
MD5 0f38be006f20ce34187d9e737bbe25ba
BLAKE2b-256 7cf4dc23c13c1498d2929e4dafddfb66e8db37edd12dc7da6284be335e3d7351

See more details on using hashes here.

File details

Details for the file elsheeto-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: elsheeto-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for elsheeto-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03ecbacd5372efe30f0e6cb30c383d7c3411ac53312d37efaf32e4ff0ce3e7ba
MD5 fa2e9234733be1a31fde615b2e798765
BLAKE2b-256 51695c2e4fff9b97bd84a37db3e3e4a7044f4b0d0a95b03e0ea15c402d59acaa

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