Just as a side note, if you do use blast to do your alignment, I wouldn't use the e-value for that output. Blast E-values are normalized p-values to the search space of the database. Since the search space is essentially length of sequence A * length of sequence B, the e-value is probably not the best metric as short sequences would artificial give high e-values. I would use the bitscore instead. Also remember that the lengths used to calculate identity in normal blast includes gaps.