Skip to main content

A parser for Illumina Sample Sheet v2 format

Project description

v2-samplesheet-parser

A lightweight Python tool to parse and validate Illumina Sample Sheet v2 format. This tool supports multiple formats including BCLConvert, Cloud, TSO500L, and TSO500S sections.

Features

  • Parse CSV to JSON: Convert Illumina Sample Sheet v2 CSV format to structured JSON data
  • Validate Samplesheets: Ensure samplesheets meet the required format and contain necessary sections
  • Retrieve Library Information: Extract library information from samplesheets
  • Revert JSON to CSV: Convert structured JSON data back to Illumina Sample Sheet v2 CSV format
  • Support for multiple section types:
    • Run Info Sections (Header, Reads, Sequencing)
    • BCLConvert Sections
    • Cloud Sections
    • TSO500L Sections
    • TSO500S Sections
  • Data validation using Pydantic models
  • Consistent naming conventions with automatic conversion between PascalCase and snake_case
  • Comprehensive error handling with detailed error messages

Installation

pip install v2-samplesheet-parser

Usage

Basic Usage

from v2_samplesheet_parser import parse_samplesheet

# Your samplesheet content as a string
samplesheet_content = """
[Header]
FileFormatVersion,2
RunName,my-illumina-sequencing-run
InstrumentPlatform,NovaSeq 6000

[Reads]
Read1Cycles,151
Read2Cycles,151
"""

# Parse the samplesheet
result = parse_samplesheet(samplesheet_content)
print(result)

Supported Section Types

The parser supports various section types:

  1. Run Info Sections

    • [Header]
    • [Reads]
    • [Sequencing]
  2. BCLConvert Sections

    • [BCLConvert_Settings]
    • [BCLConvert_Data]
  3. Cloud Sections

    • [Cloud_Settings]
    • [Cloud_Data]
  4. TSO500L Sections

    • [TSO500L_Settings]
    • [TSO500L_Data]
    • [Cloud_TSO500L_settings]
    • [Cloud_TSO500L_Data]
  5. TSO500S Sections

    • [TSO500S_Settings]
    • [TSO500S_Data]
    • [Cloud_TSO500S_Settings]
    • [Cloud_TSO500S_Data]

Development

Setup Development Environment

  1. Clone the repository:
git clone https://github.com/umccr/v2-samplesheet-parser.git
cd v2-samplesheet-parser
  1. Install development dependencies:
pip install -e ".[dev]"

Running Tests

pytest tests/

Raising Issues

If you encounter any issues or have suggestions for improvements:

  1. Check if the issue already exists in the Issue Tracker
  2. If not, create a new issue with:
    • A clear description of the problem
    • Steps to reproduce
    • Expected behavior
    • Actual behavior
    • Sample data (if applicable)
    • Python version and environment details

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

Acknowledgments

  • Based on the Illumina Sample Sheet v2 format specification
  • Built with Pydantic for robust data validation

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

v2_samplesheet_parser-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

v2_samplesheet_parser-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file v2_samplesheet_parser-0.1.0.tar.gz.

File metadata

  • Download URL: v2_samplesheet_parser-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for v2_samplesheet_parser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48dcda8f70e1e8f87249386191972a8d9916853a6b4ccdb7d0913b390996fc63
MD5 203e2a6c50a040f81bc90da21079733a
BLAKE2b-256 412ffd1487217d35415583d25d2380de120a7fdaa1c857aeebedc68acb4eaa68

See more details on using hashes here.

File details

Details for the file v2_samplesheet_parser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for v2_samplesheet_parser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a72788def7fe43cfb7cf7dea10e632fca3721a7088697d1198cd5522c2836f0f
MD5 bd11aa6a80a9cde3e1a6e06cbe53146d
BLAKE2b-256 58f411c6a6a3d57eedb20a86b8a5d1643b4fda215678d63a59528fc090d52d20

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