Skip to main content

Burrows Wheeler Transform (BWT) search

Project description

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

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

BWTsearch-0.1.15.tar.gz (2.0 kB view hashes)

Uploaded Source

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