A novel molecular shape similarity comparisonmethod, namely SHeMS, derived from spherical harmonic(SH) expansion, is presented in this study. Through weightoptimization using genetic algorithms for a customizedreference set, the optimal combination of weights for thetranslationally and rotationally invariant (TRI) SH shapedescriptor, which can specifically and effectively distinguish overall and detailed shape features according to themolecular surface, is obtained for each molecule. Thismethod features two key aspects: firstly, the SH expansioncoefficients from different bands are weighted to calculatesimilarity, leading to a distinct contribution of overall anddetailed features to the final score, and thus can be bettertailored for each specific system under consideration.Secondly, the reference set for optimization can be totallyconfigured by the user, which produces great flexibility,allowing system-specific and customized comparisons. Thedirectory of useful decoys (DUD) database was adopted tovalidate and test our method, and principal componentanalysis (PCA) reveals that SH descriptors for shapecomparison preserve sufficient information to separateactives from decoys. The results of virtual screeningindicate that the proposed method based on optimal SHdescriptor weight combinations represents a great improve-ment in performance over original SH (OSH) and ultra-fastshape recognition (USR) methods, and is comparable tomany other popular methods. Through combining efficientshape similarity comparison with SH expansion method,and other aspects such as chemical and pharmacophorefeatures, SHeMS can play a significant role in this field andcan be applied practically to virtual screening by means ofsimilarity comparison with 3D shapes of known activecompounds or the binding pockets of target proteins.