-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic support for PCA with MALDI-TOF spectra.
Signed-off-by: Matthias Mailänder <[email protected]>
- Loading branch information
1 parent
cbe86c2
commit 97adad6
Showing
17 changed files
with
927 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
....chemclipse.chromatogram.xxd.process.supplier.pca.ui.quickstart.SpectraTileDefinition.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
53 changes: 53 additions & 0 deletions
53
...pse/chromatogram/xxd/process/supplier/pca/ui/internal/wizards/SpectraFilesWizardPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
...mclipse/chromatogram/xxd/process/supplier/pca/ui/internal/wizards/SpectraInputWizard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.