A robust method to detect structural and functional remote homologues