Double fragmentIonMassTolerance = null;
Double peptideIonMassTolerance = null;
Integer maxMissedCleavages = null;
ArrayList<String> enzymes = new ArrayList<String>();
PrideXmlReader prideXmlReader = new PrideXmlReader(currentPrideDataFile);
Description description = prideXmlReader.getDescription();
DataProcessing dataProcessing = description.getDataProcessing();
if (dataProcessing != null && dataProcessing.getProcessingMethod() != null) {
List<CvParam> processingMethods = dataProcessing.getProcessingMethod().getCvParam();
for (CvParam cvParam : processingMethods) {
if (cvParam.getAccession().equalsIgnoreCase("PRIDE:0000161")) { // fragment mass tolerance
String value = cvParam.getValue().trim();
if (value.indexOf(" ") != -1) { // escape Da or ppm
value = value.substring(0, value.indexOf(" "));
}
fragmentIonMassTolerance = new Double(value);
} else if (cvParam.getAccession().equalsIgnoreCase("PRIDE:0000078")) { // peptide mass tolerance
String value = cvParam.getValue().trim();
if (value.indexOf(" ") != -1) { // escape Da or ppm
value = value.substring(0, value.indexOf(" "));
}
peptideIonMassTolerance = new Double(value);
} else if (cvParam.getAccession().equalsIgnoreCase("PRIDE:0000162")) { // allowed missed cleavages
maxMissedCleavages = new Integer(cvParam.getValue());
}
}
}
if (prideXmlReader.getProtocol() != null && prideXmlReader.getProtocol().getProtocolSteps() != null) {
List<Param> protocolStepDescription = prideXmlReader.getProtocol().getProtocolSteps().getStepDescription();
for (Param stepDescription : protocolStepDescription) {
List<CvParam> stepCvParams = stepDescription.getCvParam();
for (CvParam stepCvParam : stepCvParams) {
if (stepCvParam.getAccession().equalsIgnoreCase("PRIDE:0000160") || stepCvParam.getAccession().equalsIgnoreCase("PRIDE:0000024")) { // enzyme
if (stepCvParam.getValue() != null) {
enzymes.add(stepCvParam.getValue());
}
}
}
}
}
HashMap<String, Integer> ionTypes = new HashMap<String, Integer>();
HashMap<String, Integer> peptideLastResidues = new HashMap<String, Integer>();
// get the fragment ion types used
List<String> ids = prideXmlReader.getIdentIds();
progressDialog.setPrimaryProgressCounterIndeterminate(false);
progressDialog.setMaxPrimaryProgressCounter(ids.size());
progressDialog.setValue(0);
// set the ion types
for (String id : ids) {
// @TODO: implement me!
progressDialog.increasePrimaryProgressCounter();
Identification identification = prideXmlReader.getIdentById(id);
List<PeptideItem> peptides = identification.getPeptideItem();
for (PeptideItem peptide : peptides) {
String residue = peptide.getSequence().substring(peptide.getSequence().length() - 1);