Scientists have developed statistical tools that distinguish "distant" homologies from coincidental molecular homoplasy in extremely divergent sequences. What are these tools?How are they used ?
I have very less knowledge about statistics.
There are lots of statistical algorithms that allow you to evaluate the similarity between two given sequences. For instance, blast allows you a rapid comparison between your sequence and other sequences in a database; while Clustal, with a similar functioning, allows you to compare a set of given sequences between them. They are very simple algorithms, but very fast and useful, and basically they score an alignment by counting how many positions between the two entries are the same. Other algorithms function in a similar fashion, but they use hidden Markov models to compare your sequence with a consensual sequence in order to identify motifs and domains. I'm sure there are even more advanced programs, but I don't know them and don't think it's the point.
Homology usually refers to things that share the same origin, while analogy refers to things that do the same function but their origin isn't shared. While the algorithms I've described you only search for similarity or identity, you must notice a few things:
a) Homology of function doesn't necessarily correlate with high similarity. Two proteins can have the same global structure and their sequences be completely different. The three-dimensional structure is the same, and probably there'll be key amino acids that will remain very similar. This is very obvious in many proteases, which share only the three catalytic amino acids (catalytic triad) between them, and vary enormously even between strains of the same species.
b) Protein domains vary in size from a few dozen to a few hundred amino acids. The odds that exactly the same sequence evolves in two separate moments are very low. Especially in highly conserved domains, which usually carry out key functions.
c) Proteins usually have a modular structure with more than one domain. New proteins often evolve by switching and combining domains by translocation. So, even if the same domain has evolved in two separate times, the association between these two "twin" domains with other domains will probably reveal its unusual origin.
That's why usually the term molecular analogy is not used, and if so, it would refer for example to structurally different domains that catalyze the same reaction or that share the same structure. Note that even if the analogy as you describe isn't impossible by itself, the software won't be able to differentiate them unless the sequence appears associated with others. Furthermore, the origin of many of the current protein families is so far in the past that it's quite impossible to reconstruct it, even more so with the high diversity in prokaryotes.
As Miguel puts it, homology means similarity of origin and therefore of some structural properties. Whereas analogy means similarity of function (like insect wings and bird wings provide the same function of flying).
A homoplastic trait may still be homologous because same set of genes may be involved, whose DNA/protein sequence may be homologous. Just thought of an example that was illustrated in PhD comics some days back- about dogs and hyenas- they both have snouts and look similar but hyenas are more related to cats.
This is an example of convergent evolution but the genes giving rise to snout- the structural proteins the homeotic genes, growth signaling molecules or whatever is responsible for this trait is present in both animals. This trait has a good deal of structural homology. Now, the rigor with which we say that two traits are similar is another factor. It depends on how many variables you use to define a trait. For e.g. a snout shape can be defined using- snout dimensions, angles, bone morphology, texture etc. The more variables you add the more rigorous it becomes. Sometimes the extra variables don't give any extra info and you may choose to remove these variables (this is precisely what is done in a statistical method called Principal Component Analysis).
If phylogentic study is based on these common convergent characters (snout) then we'll end up predicting that dogs and hyenas are related which is erroneous. Therefore multiple gene families are to be considered while doing phylogenetic analysis.
If we go back to butterfly-bird example; both have wings that are used for flying but they are structurally very different- therefore the genes responsible might also be different. Since the structure itself is different you wont be able to compare the two traits using structural variables. You need variables that define function. For e.g. Thrust generated, fluttering speed, angle of attack etc. (of course they need to be normalized with respect to body size).
Once you have the set of variables (random variables in statistical terms) you can apply statistical tests to compare them.