Skip to main content

Simple application of sequence alignment algorithms

Project description

AlignmentUtilis

AlignmentUtilis is a collection utilities of sequence alignment algorithms,

  • Needleman-Wunsch and Smith-Watermen algorithms to conduct sequence alignment with affine gap penalty
  • Naive exact matching to conduct reads alignment problem
  • ...

How to get it?

pip install AlignmentUtilis

How to use it?

# 1. PairwiseSequenceAlignment
from AlignmentUtilis.Pairwise import *
# Test
seq1 = "TCGTAGACGA"
seq2 = "ATAGAATGCGG"
# Run Global Alignment
PairwiseSequenceAlignment.Runalignment(seq1, seq2, 1, -1, -2, -1, local=False)
# Run Local Alignment
PairwiseSequenceAlignment.Runalignment(seq1, seq2, 1, -1, -2, -1, local=True)

# 2. Naive exact matching
from AlignmentUtilis.Naive import *
# Naive Exact Macthing Basic Utility Test
test_occurrences = Naive.naive_exact_matching('AG', 'AGCTTAGATAGC')
print('The pattern is AG')
print('The target sequence is AGCTTAGATAGC')
print(f'The start position of exact matching is {test_occurrences}')

# 3. Booyer-Moore algorithm to reduce the unnecessary alignments
from AlignmentUtilis.BM import *
# BoyerMoore Test
p = 'TCAA'
p_bm = BoyerMoore(p)
print(p_bm.amap)
print(p_bm.bad_character_rule(2, 'T'))
# boyer_moore Test
t = 'ACGTCGTGCGGTGAGTCGGTAGCGTAGCTAGATACAATCAAGAGAGAGTGCGGAGTGCGAGTCAA'
occurrences = boyer_moore(p, p_bm, t)
print(occurrences)

# 4. Kmer indexing of target sequence, and simple application of query sequence alignment
from AlignmentUtilis.KmerIndex import *
t = 'GCTACGATCTAGAATCTA'
p = 'TCTA'
index = Index(t, 2)
print(queryIndex(p, t, index))

License

MIT License Copyright (c) 2022 Youpu Chen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

AlignmentUtilis-0.1.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.

AlignmentUtilis-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: AlignmentUtilis-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for AlignmentUtilis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fc37e02e42acda91ea9fd6ef2cfb4efbf88f7a19e9839f00290b97f02948428
MD5 9e76d52ac314541ce9a0851b9271e63f
BLAKE2b-256 5a9f4987fb91dd21f83af2620613937a206796ef65a0f22af80fcf4620bb0f74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for AlignmentUtilis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39656b74701bfb41b13aa42c1d05c19b4233c8568053fd66dc86d16737152b34
MD5 b8ef9204a980a023c270dc6e254ab780
BLAKE2b-256 79090517f16b7bee36fce5ea0930a36e16eb323913e98a30c0b07f85ef8ce65a

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