Skip to content

Commit

Permalink
Add basic support for PCA with MALDI-TOF spectra.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Feb 24, 2021
1 parent 6334403 commit f19be43
Show file tree
Hide file tree
Showing 17 changed files with 927 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ Import-Package: javax.annotation;version="1.0.0";resolution:=optional,
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.PeakTileDefinition.xml,
OSGI-INF/org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.ScanTileDefinition.xml,
OSGI-INF/org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.FileTileDefinition.xml
OSGI-INF/org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.FileTileDefinition.xml,
OSGI-INF/org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.SpectraTileDefinition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.SpectraTileDefinition">
<service>
<provide interface="org.eclipse.chemclipse.ux.extension.ui.definitions.TileDefinition"/>
</service>
<implementation class="org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.SpectraTileDefinition"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jan Holy - initial API and implementation
* Christoph Läubrich - change to new Wizard API
* Philip Wenig - get rid of JavaFX
* Matthias Mailänder - adapted for MALDI
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.internal.wizards;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.model.DataInputEntry;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.model.IDataInputEntry;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.preferences.PreferenceSupplier;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.Activator;
import org.eclipse.chemclipse.model.types.DataType;
import org.eclipse.chemclipse.ux.extension.xxd.ui.wizards.InputEntriesWizard;
import org.eclipse.chemclipse.ux.extension.xxd.ui.wizards.InputWizardSettings;

public class SpectraFilesWizardPage extends DataInputPageWizard {

public SpectraFilesWizardPage() {

super("DataInputFiles");
setTitle("MALDI-TOF MS Input Files");
setDescription("This wizard lets you select MALDI-TOF MS input files and set bulk group name.");
}

@Override
protected void addFiles() {

InputWizardSettings inputWizardSettings = InputWizardSettings.create(Activator.getDefault().getPreferenceStore(), PreferenceSupplier.N_INPUT_FILE, DataType.MALDI);
inputWizardSettings.setTitle("MALDI-TOF MS Input Files");
inputWizardSettings.setDescription("This wizard lets you select several mass spectra input files.");
//
List<IDataInputEntry> dataInputEntries = new ArrayList<>();
for(File file : InputEntriesWizard.openWizard(getShell(), inputWizardSettings).keySet()) {
dataInputEntries.add(new DataInputEntry(file.getAbsolutePath()));
}
//
addInputFiles(dataInputEntries);
update();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jan Holy - initial API and implementation
* Matthias Mailänder - adapted for MALDI
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.ui.internal.wizards;

import java.util.List;

import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.core.IExtractionData;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.core.IFilterSettings;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.core.IPreprocessingSettings;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.core.PcaExtractionSpectra;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.extraction.SpectraExtractionSupport.ExtractionType;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.model.IAnalysisSettings;
import org.eclipse.chemclipse.chromatogram.xxd.process.supplier.pca.model.IDataInputEntry;
import org.eclipse.jface.wizard.Wizard;

public class SpectraInputWizard extends Wizard implements IInputWizard {

private SpectraSettingsWizardPage spectraSettingsWizardPage = new SpectraSettingsWizardPage();
private SpectraFilesWizardPage spectraFilesWizardPage = new SpectraFilesWizardPage();
private GroupNamesWizardPage groupNamesWizardPage = new GroupNamesWizardPage();
private PreprocessingWizardPage preprocessingWizardPage = new PreprocessingWizardPage();
private FilterWizardPage filterWizardPage = new FilterWizardPage();
/*
* Will be created when finishing the report.
*/
private PcaExtractionSpectra pcaExtractionData;

@Override
public void addPages() {

addPage(spectraSettingsWizardPage);
addPage(spectraFilesWizardPage);
addPage(groupNamesWizardPage);
addPage(preprocessingWizardPage);
addPage(filterWizardPage);
}

@Override
public IExtractionData getExtractionData() {

return pcaExtractionData;
}

@Override
public List<IDataInputEntry> getDataInputEntries() {

return spectraFilesWizardPage.getUniqueDataInputEnties();
}

@Override
public IAnalysisSettings getAnalysisSettings() {

return spectraSettingsWizardPage.getAnalysisSettings();
}

@Override
public IPreprocessingSettings getPreprocessingSettings() {

return preprocessingWizardPage.getPreprocessingSettings();
}

@Override
public IFilterSettings getFilterSettings() {

return filterWizardPage.getFilterSettings();
}

@Override
public boolean performFinish() {

List<IDataInputEntry> dataInputs = getDataInputEntries();
int massWindow = spectraSettingsWizardPage.getMassWindow();
boolean useDefaultProperties = spectraSettingsWizardPage.isUseDefaultProperties();
ExtractionType extractionType = spectraSettingsWizardPage.getExtractionType();
int maximalNumberScans = spectraSettingsWizardPage.getMaximalNumberPeaks();
pcaExtractionData = new PcaExtractionSpectra(massWindow, maximalNumberScans, dataInputs, extractionType, useDefaultProperties);
return true;
}
}
Loading

0 comments on commit f19be43

Please sign in to comment.