annotationPreferences.setPreferencesFromSearchParameters(searchParameters);
IonFactory.getInstance().addDefaultNeutralLoss(NeutralLoss.NH3);
IonFactory.getInstance().addDefaultNeutralLoss(NeutralLoss.H2O);
// create a shaker which will perform the analysis
PeptideShaker peptideShaker = new PeptideShaker(experiment, sample, replicateNumber);
// import the files
peptideShaker.importFiles(waitingHandler, idFilter, identificationFiles, spectrumFiles, searchParameters,
annotationPreferences, projectDetails, processingPreferences, ptmScoringPreferences,
spectrumCountingPreferences, sequenceMatchingPreferences, false);
// show the warnings
Iterator<String> iterator = peptideShaker.getWarnings().keySet().iterator();
while (iterator.hasNext()) {
FeedBack warning = peptideShaker.getWarnings().get(iterator.next());
if (warning.getType() == FeedBack.FeedBackType.WARNING) {
System.out.println(warning.getMessage()); // @TODO: better interaction between notes and feedback objetcs...
}
}
if (!waitingHandler.isRunCanceled()) {
// identification as created by PeptideShaker
ProteomicAnalysis tempProteomicAnalysis = experiment.getAnalysisSet(sample).getProteomicAnalysis(replicateNumber);
identification = tempProteomicAnalysis.getIdentification(IdentificationMethod.MS2_IDENTIFICATION);
// metrics saved while processing the data
metrics = peptideShaker.getMetrics();
// the identification feature generator
identificationFeaturesGenerator = peptideShaker.getIdentificationFeaturesGenerator();
// the cache used for identification
objectsCache = peptideShaker.getCache();
if (waitingHandler instanceof WaitingDialog) {
projectDetails.setReport(((WaitingDialog) waitingHandler).getReport(null));
((WaitingDialog) waitingHandler).setRunNotFinished();
((WaitingDialog) waitingHandler).setCloseDialogWhenImportCompletes(true, false);