&& spectrum.getSpectrumDesc().getPrecursorList().getPrecursor().size() > 0) {
bw.write("BEGIN IONS" + System.getProperty("line.separator"));
bw.write("TITLE=" + spectrum.getId() + System.getProperty("line.separator"));
Precursor precursor = spectrum.getSpectrumDesc().getPrecursorList().getPrecursor().get(0); // get the first precursor
List<CvParam> precursorCvParams = precursor.getIonSelection().getCvParam();
Double precursorMz = null, precursorIntensity = null;
String precursorRt = null;
Integer precursorCharge = null;
for (CvParam cvParam : precursorCvParams) {