Sequence analysis subroutines