Skip to main content

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") `

Metadata

Release files for BWTsearch 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BWTsearch 0.1.15
File Size Uploaded
BWTsearch-0.1.15.tar.gz 2.0 kB Details

Release files / BWTsearch-0.1.15.tar.gz

Download URL BWTsearch-0.1.15.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7efec890feda41669b3b978605a82077e8cad36a643151537b1218ce98d68255
BLAKE2b-256 checksum
How to use checksums
895622f87fc38ec7ba7d741c25e7e3536de0399fe07cd501514437107ad0c3bd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.15 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page