return DisplayPreferences.LOADING_MESSAGE;
}
}
return psParameter.getProteinInferenceClass();
case 3:
ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey, useDB && !isScrolling);
if (proteinMatch == null) {
if (isScrolling) {
return null;
} else if (!useDB) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
}
if (!isScrolling) {
return displayFeaturesGenerator.addDatabaseLink(proteinMatch.getMainMatch());
} else {
return proteinMatch.getMainMatch();
}
case 4:
proteinMatch = identification.getProteinMatch(proteinKey, useDB && !isScrolling);
if (proteinMatch == null) {
if (isScrolling) {
return null;
} else if (!useDB) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
}
String description = null;
try {
description = sequenceFactory.getHeader(proteinMatch.getMainMatch()).getSimpleProteinDescription();
// if description is not set, return the accession instead - fix for home made fasta headers
if (description == null || description.trim().isEmpty()) {
description = proteinMatch.getMainMatch();
}
} catch (Exception e) {
exceptionHandler.catchException(e);
}
return description;
case 5:
proteinMatch = identification.getProteinMatch(proteinKey, useDB && !isScrolling);
if (proteinMatch == null) {
if (isScrolling) {
return null;
} else if (!useDB) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
}
String geneName = sequenceFactory.getHeader(proteinMatch.getMainMatch()).getGeneName();
String chromosomeNumber = geneFactory.getChromosomeForGeneName(geneName);
return new Chromosome(chromosomeNumber);
case 6:
if (isScrolling) {
return null;
}
proteinMatch = identification.getProteinMatch(proteinKey, useDB);
if (!useDB && (!identificationFeaturesGenerator.sequenceCoverageInCache(proteinKey)
|| !identificationFeaturesGenerator.observableCoverageInCache(proteinKey))
&& (proteinMatch == null || !identification.proteinDetailsInCache(proteinKey))) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
HashMap<Integer, Double> sequenceCoverage;
try {
sequenceCoverage = identificationFeaturesGenerator.getSequenceCoverage(proteinKey);
} catch (Exception e) {
exceptionHandler.catchException(e);
return Double.NaN;
}
Double sequenceCoverageConfident = 100 * sequenceCoverage.get(MatchValidationLevel.confident.getIndex());
Double sequenceCoverageDoubtful = 100 * sequenceCoverage.get(MatchValidationLevel.doubtful.getIndex());
Double sequenceCoverageNotValidated = 100 * sequenceCoverage.get(MatchValidationLevel.not_validated.getIndex());
double possibleCoverage = 100;
try {
possibleCoverage = 100 * identificationFeaturesGenerator.getObservableCoverage(proteinKey);
} catch (Exception e) {
exceptionHandler.catchException(e);
}
ArrayList<Double> doubleValues = new ArrayList<Double>();
doubleValues.add(sequenceCoverageConfident);
doubleValues.add(sequenceCoverageDoubtful);
doubleValues.add(sequenceCoverageNotValidated);
doubleValues.add(possibleCoverage - sequenceCoverageConfident - sequenceCoverageDoubtful - sequenceCoverageNotValidated);
ArrrayListDataPoints arrrayListDataPoints = new ArrrayListDataPoints(doubleValues, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType.sumExceptLastNumber);
return arrrayListDataPoints;
case 7:
if (isScrolling) {
return null;
}
proteinMatch = identification.getProteinMatch(proteinKey, useDB);
if (!useDB && (proteinMatch == null
|| !identificationFeaturesGenerator.nValidatedPeptidesInCache(proteinKey)
&& !identification.proteinDetailsInCache(proteinKey))) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
double nConfidentPeptides = identificationFeaturesGenerator.getNConfidentPeptides(proteinKey);
double nDoubtfulPeptides = identificationFeaturesGenerator.getNValidatedPeptides(proteinKey) - nConfidentPeptides;
doubleValues = new ArrayList<Double>();
doubleValues.add(nConfidentPeptides);
doubleValues.add(nDoubtfulPeptides);
doubleValues.add(proteinMatch.getPeptideCount() - nConfidentPeptides - nDoubtfulPeptides);
arrrayListDataPoints = new ArrrayListDataPoints(doubleValues, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType.sumOfNumbers);
return arrrayListDataPoints;
case 8:
if (isScrolling) {
return null;
}
proteinMatch = identification.getProteinMatch(proteinKey, useDB);
if (!useDB
&& (!identificationFeaturesGenerator.nValidatedSpectraInCache(proteinKey)
|| !identificationFeaturesGenerator.nSpectraInCache(proteinKey))
&& (proteinMatch == null || !identification.proteinDetailsInCache(proteinKey))) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
double nConfidentSpectra = identificationFeaturesGenerator.getNConfidentSpectra(proteinKey);
double nDoubtfulSpectra = identificationFeaturesGenerator.getNValidatedSpectra(proteinKey) - nConfidentSpectra;
int nSpectra = identificationFeaturesGenerator.getNSpectra(proteinKey);
doubleValues = new ArrayList<Double>();
doubleValues.add(nConfidentSpectra);
doubleValues.add(nDoubtfulSpectra);
doubleValues.add(nSpectra - nConfidentSpectra - nDoubtfulSpectra);
arrrayListDataPoints = new ArrrayListDataPoints(doubleValues, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType.sumOfNumbers);
return arrrayListDataPoints;
case 9:
if (isScrolling) {
return null;
}
proteinMatch = identification.getProteinMatch(proteinKey, useDB);
if (!useDB && !identificationFeaturesGenerator.spectrumCountingInCache(proteinKey)
&& (proteinMatch == null || !identification.proteinDetailsInCache(proteinKey))) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
return identificationFeaturesGenerator.getSpectrumCounting(proteinKey);
case 10:
if (isScrolling) {
return null;
}
proteinMatch = identification.getProteinMatch(proteinKey, useDB);
if (!useDB && proteinMatch == null) {
dataMissingAtRow(row);
return DisplayPreferences.LOADING_MESSAGE;
}
String mainMatch = proteinMatch.getMainMatch();
Protein currentProtein = sequenceFactory.getProtein(mainMatch);
if (currentProtein != null) {
return sequenceFactory.computeMolecularWeight(mainMatch);
} else {
return null;