pyabpoa: SIMD-based partial order alignment using adaptive band
Project description
pyabpoa: abPOA Python interface
Introduction
pyabpoa provides an easy-to-use interface to abPOA.
Installation
Install pyabpoa with pip
pyabpoa can be installed with pip:
pip install pyabpoa
Install pyabpoa from source
Alternatively, you can install pyabpoa from source:
git clone https://github.com/yangao07/abPOA.git
cd abPOA
make install_py
Getting started
After installation, you can run the toy example script to test it:
python ./python/example.py
Usage
import pyabpoa as pa
a = pa.msa_aligner()
seqs=[
'CCGAAGA',
'CCGAACTCGA',
'CCCGGAAGA',
'CCGAAGA'
]
res=a.msa(seqs, out_cons=True, out_msa=True, out_pog='pog.png') # perform multiple sequence alignment
# generate a figure of alignment graph to pog.png
for seq in res.cons_seq:
print(seq) # print consensus sequence
res.print_msa() # print row-column multiple sequence alignment in PIR format
APIs
Class pyabpoa.msa_aligner
pyabpoa.msa_aligner(aln_mode='g', ...)
This constructs a multiple sequence alignment handler of pyabpoa, it accepts the following arguments:
- aln_mode: alignment mode. 'g': global, 'l': local, 'e': extension; default: 'g'
- match: match score; default: 2
- gap_open1: first gap opening penalty; default: 4
- gap_ext1: first gap extension penalty; default: 2
- gap_open2: second gap opening penalty; default: 24
- gap_ext2: second gap extension penalty; default: 1
- extra_b: first part of extra band width; default: 10
- extra_f: second part of extra band width; Total extra band width: b+f*L, L is the sequence lengthl default : 0.01
- is_diploid: set as 1 if input is diploid datal default: 0
- min_freq: minimum frequency of each consensus to output for diploid datal default: 0.3
pyabpoa.msa_aligner.msa(seqs, out_cons, out_msa, out_pog=None)
This method performs mutliple sequence alignment and generates
- consensus sequence if
out_cons
is set asTrue
- row-column multiple sequence alignment in PIR format if
out_msa
is set asTrue
- plot of alignment graph if
out_pog
is set as a file name with suffix as.png
or.pdf
Class pyabpoa.msa_result
pyabpoa.msa_result(seq_n, cons_n, cons_len, ...)
This class describes the information of the generated consensus sequence and row-column multiple sequence alignment. The returned result of pyabpoa.msa_aligner.msa()
is an object of this class and it has the following properties:
- seq_n: number of input sequences
- cons_n: number of generated consensus sequences
- cons_len: an array of consensus sequence length
- cons_seq: an array of consensus sequence
- msa_len: size of each row in the row-column multiple sequence alignment
- msa_seq: an array containing
seq_n
rows of the row-column multiple sequence alignment
pyabpoa.msa_result()
also has a function of print_msa
. It prints the row-column multiple sequence alignment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyabpoa-1.0.0a1.tar.gz
.
File metadata
- Download URL: pyabpoa-1.0.0a1.tar.gz
- Upload date:
- Size: 102.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200311 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c80952dd834fea0d00f008f8b78e8ccb84a6f383a4424bcf318c3c05394f011 |
|
MD5 | d917393da42aec408cb293acc337af04 |
|
BLAKE2b-256 | 9c737cb26c4dc084163347572ce072bc3377aeeaeba7cbe57ce1c0edafaa0b63 |
Provenance
File details
Details for the file pyabpoa-1.0.0a1-py3.7-linux-x86_64.egg
.
File metadata
- Download URL: pyabpoa-1.0.0a1-py3.7-linux-x86_64.egg
- Upload date:
- Size: 424.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200311 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab8444bdd923653ed0316c15c5e6363a47963fd7e05671df6fd7fdd6faf697f |
|
MD5 | 204e47f0f5d74607f65c897418dc8017 |
|
BLAKE2b-256 | 8dd9f1df88331ba08eca856b698042f418e70e39105e6fb270670ad095a41314 |