Skip to main content

No project description provided

Project description

SigAlign for python

Requirements

  • python >=3.7

Install

pip install sigalign

Usage Example

from sigalign import SequenceStorage, Reference, Aligner

# 1. Define `SequenceStorage`
ss = SequenceStorage()
ss.add_record("record_1", "ACACAGATCGCAAACTCACAATTGTATTTCTTTGCCACCTGGGCATATACTTTTTGCGCCCCCTCATTTA")
ss.add_record("record_2", "TCTGGGGCCATTGTATTTCTTTGCCAGCTGGGGCATATACTTTTTCCGCCCCCTCATTTACGCTCATCAC")

# 2. Build `Reference`
reference = Reference(
    ss,
    klt_size = 2,
    sas_ratio = 2,
    comp_block = True,
)

# 3. Make `Aligner`
aligner = Aligner(
    4,
    6,
    2,
    50,
    0.2,
    is_local_mode = True,
)

# 4. Perform alignment
query = "CAAACTCACAATTGTATTTCTTTGCCAGCTGGGCATATACTTTTTCCGCCCCCTCATTTAACTTCTTGGA"
result = aligner.align_query(reference, query)

# 5. Print result
import json
json.loads(result.to_json())

import pandas as pd
df = pd.DataFrame(
    result.to_2d_array(),
    columns = [
        'index', 'label', 'penalty', 'length',
        'qstart', 'qend', 'rstart', 'rend', 'operations',
    ]
)

Build manually

  • Use maturin as backend
    pip install maturin
    maturin develop
    

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

sigalign-0.1.0.tar.gz (45.9 kB view hashes)

Uploaded Source

Built Distribution

sigalign-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

Supported by

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