}
proteinAccessionsAsString.append(proteinAccession);
}
ArrayList<String> proteinGroups = identification.getProteinMatches(peptide);
PSParameter psParameter = new PSParameter();
ArrayList<String> spectrumKeys = peptideMatch.getSpectrumMatches();
identification.loadSpectrumMatches(spectrumKeys, null);
identification.loadSpectrumMatchParameters(spectrumKeys, psParameter, null);
for (String spectrumKey : spectrumKeys) {
psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);
SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
if (spectrumMatch.getBestPeptideAssumption() != null) { // Should always be the case
PeptideAssumption peptideAssumption = spectrumMatch.getBestPeptideAssumption();
peptide = peptideAssumption.getPeptide();
int column = 1;
HSSFRow rowHead = sheet.createRow(++currentRow);
rowHead.setHeightInPoints(12.75f);
Cell cell = rowHead.createCell(column++);
MatchValidationLevel matchValidationLevel = psParameter.getMatchValidationLevel();
// High, Medium or Low - refers to the confidence in the peptide
if (matchValidationLevel == MatchValidationLevel.confident) {
cell.setCellValue("High");
} else if (matchValidationLevel == MatchValidationLevel.doubtful) {
cell.setCellValue("Medium");
} else {
cell.setCellValue("Low");
}
cell.setCellStyle(a2CellStyle);
cell = rowHead.createCell(column++);
cell.setCellValue(peptide.getSequenceWithLowerCasePtms()); // peptide sequence, modified residues in lower case
cell.setCellStyle(peptideRowCellStyle);
cell = rowHead.createCell(column++);
cell.setCellValue(1); // number of PSMs
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
cell.setCellValue(proteinAccessions.size()); // number of proteins
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
cell.setCellValue(proteinGroups.size()); // number of protein groups
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
cell.setCellValue(proteinAccessionsAsString.toString()); // protein accessions, separated by semi colon
cell.setCellStyle(peptideRowCellStyle);
cell = rowHead.createCell(column++);
cell.setCellValue(getPeptideModificationsAsString(peptide)); // the modifications, separated by semi colon _and_ space // @TODO: reformat
cell.setCellStyle(peptideRowCellStyle);
cell = rowHead.createCell(column++);
Double delta = psParameter.getDeltaPEP(); // PeptideShaker closest equivalent to a delta Cn
if (delta == null) {
cell.setCellValue(Double.NaN);
// @TODO: set another type?
} else {
cell.setCellValue(delta);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
}
cell.setCellStyle(peptideRowCellStyle);
cell = rowHead.createCell(column++);
cell.setCellValue(0); // PeptideShaker q-value // @TODO: insert real value
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
cell.setCellValue(psParameter.getPsmProbability()); // pep value
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
double score = psParameter.getPsmScore(); // PeptideShaker closest equivalent to an ion score
cell.setCellValue(score);
cell.setCellStyle(peptideRowCellStyle);
if (score != Double.POSITIVE_INFINITY) {
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
}
cell = rowHead.createCell(column++);
cell.setCellValue(psParameter.getPsmProbabilityScore()); // PeptideShaker closest equivalent to an e-value
cell.setCellStyle(peptideRowCellStyle);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell = rowHead.createCell(column++);
cell.setCellValue(peptideAssumption.getIdentificationCharge().value); // charge