Contextual alignment of biological sequences