-
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.
Merge pull request #911 from Mailaender/mmass-msd
Added an import converter for mMass .msd files
- Loading branch information
Showing
28 changed files
with
771 additions
and
13 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
chemclipse/features/org.eclipse.chemclipse.msd.converter.supplier.mmass.feature/.project
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.chemclipse.msd.converter.supplier.mmass.feature</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.pde.FeatureBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.FeatureNature</nature> | ||
</natures> | ||
</projectDescription> |
1 change: 1 addition & 0 deletions
1
...pse/features/org.eclipse.chemclipse.msd.converter.supplier.mmass.feature/build.properties
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 @@ | ||
bin.includes = feature.xml |
34 changes: 34 additions & 0 deletions
34
chemclipse/features/org.eclipse.chemclipse.msd.converter.supplier.mmass.feature/feature.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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feature | ||
id="org.eclipse.chemclipse.msd.converter.supplier.mmass.feature" | ||
label="mMass Converter" | ||
version="0.9.0.qualifier" | ||
provider-name="ChemClipse" | ||
plugin="org.eclipse.chemclipse.feature.branding"> | ||
|
||
<description url="http://www.mmass.org/"> | ||
This is the mMass .msd file converter. | ||
</description> | ||
|
||
<copyright url="http://www.chemclipse.net/"> | ||
Copyright (c) 2022 Lablicate GmbH. | ||
</copyright> | ||
|
||
<license url="http://www.eclipse.org/legal/epl-v10.html"> | ||
Copyright (c) 2022 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 | ||
</license> | ||
|
||
<plugin | ||
id="org.eclipse.chemclipse.msd.converter.supplier.mmass" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
</feature> |
5 changes: 3 additions & 2 deletions
5
chemclipse/features/org.eclipse.chemclipse.msd.converter.supplier.mzml.feature/feature.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
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/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/.classpath
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"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
1 change: 1 addition & 0 deletions
1
chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/.gitignore
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 @@ | ||
/bin |
28 changes: 28 additions & 0 deletions
28
chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/.project
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.chemclipse.msd.converter.supplier.mmass</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
7 changes: 7 additions & 0 deletions
7
.../org.eclipse.chemclipse.msd.converter.supplier.mmass/.settings/org.eclipse.jdt.core.prefs
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 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 |
22 changes: 22 additions & 0 deletions
22
chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/META-INF/MANIFEST.MF
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,22 @@ | ||
Manifest-Version: 1.0 | ||
Automatic-Module-Name: org.eclipse.chemclipse.msd.converter.supplier.mzml | ||
Eclipse-RegisterBuddy: org.eclipse.chemclipse.model, org.eclipse.chemclipse.msd.model | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: mMass Converter | ||
Bundle-SymbolicName: org.eclipse.chemclipse.msd.converter.supplier.mmass;singleton:=true | ||
Bundle-Version: 0.9.0.qualifier | ||
Bundle-Activator: org.eclipse.chemclipse.msd.converter.supplier.mmass.Activator | ||
Bundle-Vendor: ChemClipse | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.chemclipse.msd.converter;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.msd.model;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.logging;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.processing;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.converter;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.model;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.support;bundle-version="0.8.0", | ||
org.apache.commons.codec;bundle-version="1.9.0" | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-ActivationPolicy: lazy | ||
Import-Package: org.apache.commons.lang3.tuple;version="3.1.0", | ||
org.eclipse.chemclipse.xxd.converter.supplier.io.exception |
1 change: 1 addition & 0 deletions
1
...ns/org.eclipse.chemclipse.msd.converter.supplier.mmass/OSGI-INF/l10n/bundle_en.properties
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 @@ | ||
#Properties file |
6 changes: 6 additions & 0 deletions
6
chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/build.properties
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,6 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
plugin.xml,\ | ||
OSGI-INF/ |
18 changes: 18 additions & 0 deletions
18
chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.mmass/plugin.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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.eclipse.chemclipse.msd.converter.massSpectrumSupplier"> | ||
<MassSpectrumSupplier | ||
description="Reads mMass .msd Mass Spectra" | ||
exportConverter="org.eclipse.chemclipse.msd.converter.supplier.mmass.converter.MassSpectrumExportConverter" | ||
fileExtension=".msd" | ||
filterName="mMass Mass Spectrum (*.msd)" | ||
id="org.eclipse.chemclipse.msd.converter.supplier.mmass" | ||
importConverter="org.eclipse.chemclipse.msd.converter.supplier.mmass.converter.MassSpectrumImportConverter" | ||
importMagicNumberMatcher="org.eclipse.chemclipse.msd.converter.supplier.mmass.converter.MassSpectrumMagicNumberMatcher" | ||
isExportable="false" | ||
isImportable="true"> | ||
</MassSpectrumSupplier> | ||
</extension> | ||
</plugin> |
43 changes: 43 additions & 0 deletions
43
...ter.supplier.mmass/src/org/eclipse/chemclipse/msd/converter/supplier/mmass/Activator.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,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2013, 2022 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: | ||
* Dr. Philip Wenig - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chemclipse.msd.converter.supplier.mmass; | ||
|
||
import org.osgi.framework.BundleActivator; | ||
import org.osgi.framework.BundleContext; | ||
|
||
public class Activator implements BundleActivator { | ||
|
||
private static BundleContext context; | ||
|
||
public static BundleContext getContext() { | ||
|
||
return context; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) | ||
*/ | ||
public void start(BundleContext bundleContext) throws Exception { | ||
|
||
Activator.context = bundleContext; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
public void stop(BundleContext bundleContext) throws Exception { | ||
|
||
Activator.context = null; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...clipse/chemclipse/msd/converter/supplier/mmass/converter/MassSpectrumExportConverter.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,45 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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: | ||
* Matthias Mailänder - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chemclipse.msd.converter.supplier.mmass.converter; | ||
|
||
import java.io.File; | ||
|
||
import org.eclipse.chemclipse.msd.converter.massspectrum.AbstractMassSpectrumExportConverter; | ||
import org.eclipse.chemclipse.msd.model.core.IMassSpectra; | ||
import org.eclipse.chemclipse.msd.model.core.IScanMSD; | ||
import org.eclipse.chemclipse.processing.core.IProcessingInfo; | ||
import org.eclipse.chemclipse.processing.core.ProcessingInfo; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
|
||
public class MassSpectrumExportConverter extends AbstractMassSpectrumExportConverter { | ||
|
||
private static final String DESCRIPTION = "mMass .msd Mass Spectra Export Converter"; | ||
|
||
@Override | ||
public IProcessingInfo<IMassSpectra> convert(File file, IScanMSD massSpectrum, boolean append, IProgressMonitor monitor) { | ||
|
||
return getProcessingInfo(); | ||
} | ||
|
||
@Override | ||
public IProcessingInfo<IMassSpectra> convert(File file, IMassSpectra massSpectra, boolean append, IProgressMonitor monitor) { | ||
|
||
return getProcessingInfo(); | ||
} | ||
|
||
private IProcessingInfo<IMassSpectra> getProcessingInfo() { | ||
|
||
IProcessingInfo<IMassSpectra> processingInfo = new ProcessingInfo<>(); | ||
processingInfo.addErrorMessage(DESCRIPTION, "It's not possible to export mass spectra as mMass .msd yet."); | ||
return processingInfo; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...clipse/chemclipse/msd/converter/supplier/mmass/converter/MassSpectrumImportConverter.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,62 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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: | ||
* Matthias Mailänder - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chemclipse.msd.converter.supplier.mmass.converter; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
|
||
import org.eclipse.chemclipse.converter.exceptions.FileIsEmptyException; | ||
import org.eclipse.chemclipse.converter.exceptions.FileIsNotReadableException; | ||
import org.eclipse.chemclipse.logging.core.Logger; | ||
import org.eclipse.chemclipse.msd.converter.io.IMassSpectraReader; | ||
import org.eclipse.chemclipse.msd.converter.massspectrum.AbstractMassSpectrumImportConverter; | ||
import org.eclipse.chemclipse.msd.converter.supplier.mmass.converter.io.MassSpectrumReader; | ||
import org.eclipse.chemclipse.msd.model.core.IMassSpectra; | ||
import org.eclipse.chemclipse.processing.core.IProcessingInfo; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
|
||
public class MassSpectrumImportConverter extends AbstractMassSpectrumImportConverter { | ||
|
||
private static final Logger logger = Logger.getLogger(MassSpectrumImportConverter.class); | ||
private static final String DESCRIPTION = "mMass .msd annotated Mass Spectrum Import"; | ||
|
||
@Override | ||
public IProcessingInfo<IMassSpectra> convert(File file, IProgressMonitor monitor) { | ||
|
||
IProcessingInfo<IMassSpectra> processingInfo = super.validate(file); | ||
if(!processingInfo.hasErrorMessages()) { | ||
try { | ||
IMassSpectraReader massSpectraReader = new MassSpectrumReader(); | ||
IMassSpectra massSpectra = massSpectraReader.read(file, monitor); | ||
if(massSpectra != null && massSpectra.size() > 0) { | ||
processingInfo.setProcessingResult(massSpectra); | ||
} else { | ||
processingInfo.addErrorMessage(DESCRIPTION, "No mass spectra are stored." + file.getAbsolutePath()); | ||
} | ||
} catch(FileNotFoundException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, "The file couldn't be found: " + file.getAbsolutePath()); | ||
} catch(FileIsNotReadableException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, "The file is not readable: " + file.getAbsolutePath()); | ||
} catch(FileIsEmptyException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, "The file is empty: " + file.getAbsolutePath()); | ||
} catch(IOException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, "Something has gone completely wrong: " + file.getAbsolutePath()); | ||
} | ||
} | ||
return processingInfo; | ||
} | ||
} |
Oops, something went wrong.