method to construct sequence mapping for matching positions in aligned sequences