Compositions and methods for analyzing immobilized nucleic acids