We present a computational framework for analysis of MALDI-TOF mass spectrometry data to enable quantitative comparison of glycans in serum. The proposed framework enables a systematic selection of glycan structures that have good generalization capability in distinguishing subjects from two pre-labeled groups. We applied the proposed method for a biomarker discovery study that involves 203 participants from Cairo, Egypt; 73 hepatocellular carcinoma (HCC) cases, 52 patients with chronic liver disease (CLD), and 78 healthy individuals. Glycans were enzymatically released from proteins in serum and permethylated prior to mass spectrometric quantification. A subset of the participants (35 HCC and 35 CLD cases) was used as a training set to select global and subgroup-specific peaks. The peak selection step is preceded by peak screening, where we eliminate peaks that seem to have association with covariates such as age, gender, and viral infection based on the 78 spectra from healthy individuals. To ensure that the global peaks have good generalization capability, we subjected the entire spectral preprocessing and peak selection step to a cross-validation; a randomly selected subset of the training set was used for spectral preprocessing and peak selection in multiple runs with resubstitution. In addition to global peak identification method, we describe a new approach that allows the selection of subgroup-specific glycans by searching for glycans that display differential abundance in a subgroup of patients only. The performance of the global and subgroup-specific peaks is evaluated via a blinded independent set that comprises of 38 HCC and 17 CLD cases. Further evaluation of the potential clinical utility of the selected global and subgroup-specific candidate markers is needed.