Functional grouping based on signatures in protein termini