An efficient and flexible scanning of databases of protein secondary structures