// Add identities for each peak.
int peakIndex = 0;
for (final ChromatographicPeak peak : peaks) {
// Create pseudo-spectrum identity
final SimplePeakIdentity identity = new SimplePeakIdentity(
"Pseudo-spectrum #"
+ String.format("%03d", spectra[peakIndex]));
identity.setPropertyValue(PeakIdentity.PROPERTY_METHOD,
"Bioconductor CAMERA");
// Add isotope info, if any.
if (isotopes != null) {
final String isotope = isotopes[peakIndex].trim();
if (isotope.length() > 0) {
// Parse the isotope pattern.
final Matcher matcher = ISOTOPE_PATTERN.matcher(isotope);
if (matcher.matches()) {
identity.setPropertyValue("Isotope", matcher.group(1));
} else {
LOG.warning("Irregular isotope value: " + isotope);
}