}
}
proteomicAnalysis = experiment.getAnalysisSet(sample).getProteomicAnalysis(replicateNumber);
// Get PeptideShaker settings
PeptideShakerSettings experimentSettings = cpsFileImporter.getExperimentSettings();
idFilter = experimentSettings.getIdFilter();
annotationPreferences = experimentSettings.getAnnotationPreferences();
spectrumCountingPreferences = experimentSettings.getSpectrumCountingPreferences();
ptmScoringPreferences = experimentSettings.getPTMScoringPreferences();
projectDetails = experimentSettings.getProjectDetails();
HashMap<Integer, Advocate> userAdvocateMapping = projectDetails.getUserAdvocateMapping();
if (userAdvocateMapping != null) {
Advocate.setUserAdvocates(userAdvocateMapping);
}
searchParameters = experimentSettings.getSearchParameters();
processingPreferences = experimentSettings.getProcessingPreferences();
metrics = experimentSettings.getMetrics();
genePreferences = experimentSettings.getGenePreferences();
filterPreferences = experimentSettings.getFilterPreferences();
displayPreferences = experimentSettings.getDisplayPreferences();
sequenceMatchingPreferences = experimentSettings.getSequenceMatchingPreferences();
// backwards compatability for the gene preferences
if (genePreferences.getCurrentSpecies() == null) {
genePreferences = new GenePreferences();
}
if (genePreferences.getCurrentSpecies() != null && genePreferences.getCurrentSpeciesType() == null) {
genePreferences.setCurrentSpeciesType("Vertebrates");
}
// backwards compatability for the filter preferences
if (filterPreferences == null) {
filterPreferences = new FilterPreferences();
}
// backwards compatability for the display preferences
if (displayPreferences != null) {
displayPreferences.compatibilityCheck(searchParameters.getModificationProfile());
} else {
displayPreferences = new DisplayPreferences();
displayPreferences.setDefaultSelection(searchParameters.getModificationProfile());
}
// backwards compatability for the sequence matching preferences
if (sequenceMatchingPreferences == null) {
sequenceMatchingPreferences = SequenceMatchingPreferences.getDefaultSequenceMatching(searchParameters);
}
if (waitingHandler != null && waitingHandler.isRunCanceled()) {
waitingHandler.setRunFinished();
return;
}
// Get identification details and set up caches
identification = proteomicAnalysis.getIdentification(IdentificationMethod.MS2_IDENTIFICATION);
if (identification.getSpectrumIdentificationMap() == null) {
// 0.18 version, needs update of the spectrum mapping
identification.updateSpectrumMapping();
}
identificationFeaturesGenerator = new IdentificationFeaturesGenerator(identification, searchParameters, idFilter, metrics, spectrumCountingPreferences, sequenceMatchingPreferences);
if (experimentSettings.getIdentificationFeaturesCache() != null) {
identificationFeaturesGenerator.setIdentificationFeaturesCache(experimentSettings.getIdentificationFeaturesCache());
}
objectsCache = new ObjectsCache();
objectsCache.setAutomatedMemoryManagement(true);
String dbFolder = PeptideShaker.getSerializationDirectory(jarFilePath).getAbsolutePath();
identification.establishConnection(dbFolder, false, objectsCache);