An algorithm for template-based prediction of secondary structures of individual RNA sequences