-
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.
- Loading branch information
1 parent
ca2f595
commit e4d1908
Showing
47 changed files
with
1,457 additions
and
0 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
17 changes: 17 additions & 0 deletions
17
chemclipse/features/org.eclipse.chemclipse.wsd.converter.supplier.scf.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.wsd.converter.supplier.scf.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> |
2 changes: 2 additions & 0 deletions
2
....chemclipse.wsd.converter.supplier.scf.feature/.settings/org.eclipse.core.resources.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,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=utf8 |
1 change: 1 addition & 0 deletions
1
...lipse/features/org.eclipse.chemclipse.wsd.converter.supplier.scf.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 |
30 changes: 30 additions & 0 deletions
30
chemclipse/features/org.eclipse.chemclipse.wsd.converter.supplier.scf.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,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feature | ||
id="org.eclipse.chemclipse.wsd.converter.supplier.scf.feature" | ||
label="SCF Converter" | ||
version="0.9.0.qualifier" | ||
provider-name="ChemClipse" | ||
plugin="org.eclipse.chemclipse.feature.branding" | ||
license-feature="org.eclipse.license" | ||
license-feature-version="1.0.0.qualifier"> | ||
|
||
<description url="http://www.chemclipse.net"> | ||
SCF DNA sequencing data converter | ||
</description> | ||
|
||
<copyright url="http://www.lablicate.com"> | ||
Copyright (c) 2024 Lablicate GmbH. | ||
</copyright> | ||
|
||
<license url="%licenseURL"> | ||
%license | ||
</license> | ||
|
||
<plugin | ||
id="org.eclipse.chemclipse.wsd.converter.supplier.scf" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
</feature> |
7 changes: 7 additions & 0 deletions
7
chemclipse/plugins/org.eclipse.chemclipse.wsd.converter.supplier.scf/.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-17"/> | ||
<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.wsd.converter.supplier.scf/.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.wsd.converter.supplier.scf/.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.wsd.converter.supplier.scf</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> |
2 changes: 2 additions & 0 deletions
2
....eclipse.chemclipse.wsd.converter.supplier.scf/.settings/org.eclipse.core.resources.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,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=utf8 |
7 changes: 7 additions & 0 deletions
7
...ns/org.eclipse.chemclipse.wsd.converter.supplier.scf/.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=17 | ||
org.eclipse.jdt.core.compiler.compliance=17 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=17 |
19 changes: 19 additions & 0 deletions
19
chemclipse/plugins/org.eclipse.chemclipse.wsd.converter.supplier.scf/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,19 @@ | ||
Manifest-Version: 1.0 | ||
Automatic-Module-Name: net.openchrom.wsd.converter.supplier.abif | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: SCF Converter | ||
Bundle-SymbolicName: org.eclipse.chemclipse.wsd.converter.supplier.scf;singleton:=true | ||
Bundle-Version: 0.9.0.qualifier | ||
Bundle-Activator: org.eclipse.chemclipse.wsd.converter.supplier.scf.Activator | ||
Bundle-Vendor: ChemClipse | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.chemclipse.converter;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.wsd.converter;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.model;bundle-version="0.8.0", | ||
org.eclipse.chemclipse.wsd.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.support;bundle-version="0.8.0", | ||
org.apache.commons.lang3 | ||
Bundle-RequiredExecutionEnvironment: JavaSE-17 | ||
Bundle-ActivationPolicy: lazy |
1 change: 1 addition & 0 deletions
1
...gins/org.eclipse.chemclipse.wsd.converter.supplier.scf/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.wsd.converter.supplier.scf/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/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
plugin.xml |
17 changes: 17 additions & 0 deletions
17
chemclipse/plugins/org.eclipse.chemclipse.wsd.converter.supplier.scf/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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.eclipse.chemclipse.wsd.converter.chromatogramSupplier"> | ||
<ChromatogramSupplier | ||
description="Reads Staden Trace Files." | ||
fileExtension=".scf" | ||
filterName="Standard Chromatogram Format (*.scf)" | ||
id="org.eclipse.chemclipse.wsd.converter.supplier.scf" | ||
importConverter="org.eclipse.chemclipse.wsd.converter.supplier.scf.core.ChromatogramImportConverter" | ||
importMagicNumberMatcher="org.eclipse.chemclipse.wsd.converter.supplier.scf.core.MagicNumberMatcher" | ||
isExportable="false" | ||
isImportable="true"> | ||
</ChromatogramSupplier> | ||
</extension> | ||
</plugin> |
45 changes: 45 additions & 0 deletions
45
...nverter.supplier.scf/src/org/eclipse/chemclipse/wsd/converter/supplier/scf/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,45 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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: | ||
* Philip Wenig - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chemclipse.wsd.converter.supplier.scf; | ||
|
||
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) | ||
*/ | ||
@Override | ||
public void start(BundleContext bundleContext) throws Exception { | ||
|
||
Activator.context = bundleContext; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
@Override | ||
public void stop(BundleContext bundleContext) throws Exception { | ||
|
||
Activator.context = null; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...rter.supplier.scf/src/org/eclipse/chemclipse/wsd/converter/supplier/scf/PathResolver.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) 2024 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: | ||
* Philip Wenig - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chemclipse.wsd.converter.supplier.scf; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import org.eclipse.core.runtime.FileLocator; | ||
import org.eclipse.core.runtime.IPath; | ||
import org.eclipse.core.runtime.Path; | ||
import org.eclipse.core.runtime.Platform; | ||
import org.osgi.framework.Bundle; | ||
|
||
public class PathResolver { | ||
|
||
/** | ||
* Returns a absolute path of the specified Folder. For example | ||
* TESTDATA_IMPORT_EMPTY as an absolute Path: | ||
* $PluginPath$/testData/test.scf | ||
* | ||
* @param string | ||
* @return String absolutePath | ||
*/ | ||
public static String getAbsolutePath(String string) { | ||
|
||
Bundle bundle = Platform.getBundle(Activator.getContext().getBundle().getSymbolicName()); | ||
IPath path = new Path(string); | ||
URL url = FileLocator.find(bundle, path, null); | ||
try { | ||
return FileLocator.resolve(url).getPath(); | ||
} catch(IOException e) { | ||
e.printStackTrace(); | ||
} | ||
return null; | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...c/org/eclipse/chemclipse/wsd/converter/supplier/scf/core/ChromatogramImportConverter.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,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.wsd.converter.supplier.scf.core; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.eclipse.chemclipse.converter.chromatogram.AbstractChromatogramImportConverter; | ||
import org.eclipse.chemclipse.converter.l10n.ConverterMessages; | ||
import org.eclipse.chemclipse.logging.core.Logger; | ||
import org.eclipse.chemclipse.model.core.IChromatogramOverview; | ||
import org.eclipse.chemclipse.processing.core.IProcessingInfo; | ||
import org.eclipse.chemclipse.wsd.converter.io.IChromatogramWSDReader; | ||
import org.eclipse.chemclipse.wsd.converter.supplier.scf.io.ChromatogramReader; | ||
import org.eclipse.chemclipse.wsd.model.core.IChromatogramWSD; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.eclipse.osgi.util.NLS; | ||
|
||
public class ChromatogramImportConverter extends AbstractChromatogramImportConverter<IChromatogramWSD> { | ||
|
||
private static final Logger logger = Logger.getLogger(ChromatogramImportConverter.class); | ||
private static final String DESCRIPTION = "SCF Import Converter"; | ||
|
||
@Override | ||
public IProcessingInfo<IChromatogramWSD> convert(File file, IProgressMonitor monitor) { | ||
|
||
IProcessingInfo<IChromatogramWSD> processingInfo = super.validate(file); | ||
if(!processingInfo.hasErrorMessages()) { | ||
IChromatogramWSDReader reader = new ChromatogramReader(); | ||
monitor.subTask(ConverterMessages.importChromatogram); | ||
try { | ||
IChromatogramWSD chromatogram = reader.read(file, monitor); | ||
processingInfo.setProcessingResult(chromatogram); | ||
} catch(IOException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, NLS.bind(ConverterMessages.failedToReadFile, file.getAbsolutePath())); | ||
} | ||
} | ||
return processingInfo; | ||
} | ||
|
||
@Override | ||
public IProcessingInfo<IChromatogramOverview> convertOverview(File file, IProgressMonitor monitor) { | ||
|
||
IProcessingInfo<IChromatogramOverview> processingInfo = super.validate(file); | ||
if(!processingInfo.hasErrorMessages()) { | ||
IChromatogramWSDReader reader = new ChromatogramReader(); | ||
monitor.subTask(ConverterMessages.importChromatogramOverview); | ||
try { | ||
IChromatogramOverview chromatogramOverview = reader.readOverview(file, monitor); | ||
processingInfo.setProcessingResult(chromatogramOverview); | ||
} catch(IOException e) { | ||
logger.warn(e); | ||
processingInfo.addErrorMessage(DESCRIPTION, NLS.bind(ConverterMessages.failedToReadFile, file.getAbsolutePath())); | ||
} | ||
} | ||
return processingInfo; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...er.scf/src/org/eclipse/chemclipse/wsd/converter/supplier/scf/core/MagicNumberMatcher.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,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.wsd.converter.supplier.scf.core; | ||
|
||
import java.io.File; | ||
|
||
import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher; | ||
import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher; | ||
|
||
public class MagicNumberMatcher extends AbstractMagicNumberMatcher implements IMagicNumberMatcher { | ||
|
||
private static final byte[] MAGIC_CODE = new byte[]{(byte)'.', (byte)'s', (byte)'c', (byte)'f'}; | ||
|
||
@Override | ||
public boolean checkFileFormat(File file) { | ||
|
||
if(!checkFileExtension(file, ".scf")) { | ||
return false; | ||
} | ||
return checkMagicCode(file, MAGIC_CODE); | ||
} | ||
} |
Oops, something went wrong.