Burrows Wheeler Transform (BWT) search
Import the BWT class into your namespace for convenience:
` from BWTsearch import BWT `
Initialize a BWT of text with instantiating the BWT class:
` text = "AGATA" `
` bwt = BWT(text) `
The instance bwt now will contain all necessary indices for efficiently searching:
bwt.bwt … contains the BWT string
bwt.position_list … contains the start positions of the rotations for each character of bwt
bwt.ranks … contains rank indices for each character of the alphabet in bwt
bwt.cnums … contains number of character occurances of the alphabet in bwt
Use the search() function to obtain a list of positions of exact matches for pattern in text:
` pattern = "AT" `
` bwt.search(pattern) `
This returns a list with indexes into text where an exact match occurs. Empty list if none. The pattern will be searched case-sensitive and should not contain $.
Use the get_text() function to retrieve the original text from the BWT instance:
` bwt.get_text() `
If a sequence file is available, a genome can be loaded from a FASTA file:
` phix = BWT.from_fast_file("phix.fa") `
` phix.search("AGATA") `
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file BWTsearch-0.1.15.tar.gz.
File metadata
- Download URL: BWTsearch-0.1.15.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7efec890feda41669b3b978605a82077e8cad36a643151537b1218ce98d68255
|
|
| MD5 |
b6a086ddaf55cd3f18f989098ad4ded4
|
|
| BLAKE2b-256 |
895622f87fc38ec7ba7d741c25e7e3536de0399fe07cd501514437107ad0c3bd
|