2

comp

This is the BLAST(Basic Local Alignment Search Tool) graph. How can I calculate its time complexity?

Paolo Mossini
  • 1,064
  • 2
  • 15
  • 23
LiaNalani
  • 50
  • 9

1 Answers1

3

BLAST algorithm steps:

  • Creating a list of words of length W of the query sequence.

  • Search for W words in the database.

  • Elongation of hit sequences, ie those found, and assignment of a score. These sequences will be given by a local alignment.

  • Taking the so called HSP (High-scoring Segment Pair).

The First step take time O(n), where n is the number of element in the sequence.

The Second step is another loop on the words created in the first step ( upperbound n) so time O(n)

The Third step assign an hit score. This could be done only letter by letter so the time complexity is O(n*m) where m is the number of letter in the query word. As upper bound we can say that the time is O(n^2)

The fourth step is a simple cycle over the score obtained, so ever O(n).

In conclusion the algorithm could be assimilated to O(n^2), in the case m << n, we could say O(n*m). the lower bound is O(n).

Zig Razor
  • 3,381
  • 2
  • 15
  • 35