Subclassifications in spectral classes?

In the spectral classification of stars, there are the major classes--OBAFGKM in the old HKK system--which are subdivided into subclasses, O5, G2, G1, K2, M4. What I seek is the relationship used to compute these subclasses. What formula lets an astronomer say a star is G2 verses G3 or G5?
Update: I realize the old HKK system doesn't include Wolf-Rayet stars, Carbon Stars, the proposed new L-class stars, etc, and that my question ignores the White Dwarves and a number of other issues. The issue is the assignation of the digit that represents the subclassification of the alphabetic major spectral class. ... show more I realize the old HKK system doesn't include Wolf-Rayet stars, Carbon Stars, the proposed new L-class stars, etc, and that my question ignores the White Dwarves and a number of other issues. The issue is the assignation of the digit that represents the subclassification of the alphabetic major spectral class. I've also ignored the issue of giants, supergiants, dwarves, etc. Thanks for the input, though.
5 answers 5