Skip to content

Commit

Permalink
Merge pull request #1548 from Mailaender/rdes
Browse files Browse the repository at this point in the history
Add write support for RDES
  • Loading branch information
eselmeister authored Nov 13, 2023
2 parents c4a0128 + 0a87e1d commit 3890dc6
Show file tree
Hide file tree
Showing 29 changed files with 623 additions and 3 deletions.
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.pcr.converter.supplier.rdes.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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=utf8
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
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.pcr.converter.supplier.rdes.feature"
label="RDES 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/">
This is the The Real-time PCR Data Essential Spreadsheet Format (RDES) converter.
</description>

<copyright url="http://www.chemclipse.net/">
Copyright (c) 2023 Lablicate GmbH.
</copyright>

<license url="%licenseURL">
%license
</license>

<url>
<discovery label="RDES" url="https://rdml.org/rdes.html"/>
</url>

<plugin
id="org.eclipse.chemclipse.pcr.converter.supplier.rdes"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,8 @@
id="org.eclipse.chemclipse.pcr.converter.supplier.rdml.feature"
version="0.0.0"/>

<includes
id="org.eclipse.chemclipse.pcr.converter.supplier.rdes.feature"
version="0.0.0"/>

</feature>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
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.pcr.converter.supplier.rdes</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=utf8
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.chemclipse.pcr.converter.supplier.rdml
Bundle-ManifestVersion: 2
Bundle-Name: RDES PCR Converter
Bundle-SymbolicName: org.eclipse.chemclipse.pcr.converter.supplier.rdes;singleton:=true
Bundle-Version: 0.9.0.qualifier
Bundle-Activator: org.eclipse.chemclipse.pcr.converter.supplier.rdes.Activator
Bundle-Vendor: ChemClipse
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.chemclipse.converter;bundle-version="0.8.0",
org.eclipse.chemclipse.pcr.converter;bundle-version="0.8.0",
org.eclipse.chemclipse.model;bundle-version="0.8.0",
org.eclipse.chemclipse.pcr.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"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Properties file
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.chemclipse.pcr.converter.plateSupplier">
<PlateSupplier
description="Writes Real-time PCR Data Essential Spreadsheet Format (RDES) qPCR experiments."
exportConverter="org.eclipse.chemclipse.pcr.converter.supplier.rdes.core.PCRExportConverter"
fileExtension=".tsv"
fileName=""
filterName="RDES (*.tsv)"
id="org.eclipse.chemclipse.pcr.converter.supplier.rdes"
importConverter="org.eclipse.chemclipse.pcr.converter.supplier.rdes.core.PCRImportConverter"
importMagicNumberMatcher="org.eclipse.chemclipse.pcr.converter.supplier.rdes.core.MagicNumberMatcher"
isExportable="true"
isImportable="false">
</PlateSupplier>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2023 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.pcr.converter.supplier.rdes;

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;
}

@Override
public void start(BundleContext bundleContext) throws Exception {

Activator.context = bundleContext;
}

@Override
public void stop(BundleContext bundleContext) throws Exception {

Activator.context = null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2023 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.pcr.converter.supplier.rdes.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 {

@Override
public boolean checkFileFormat(File file) {

return checkFileExtension(file, ".tsv");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*******************************************************************************
* Copyright (c) 2023 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.pcr.converter.supplier.rdes.core;

import java.io.File;
import java.io.IOException;

import org.eclipse.chemclipse.logging.core.Logger;
import org.eclipse.chemclipse.pcr.converter.core.AbstractPlateExportConverter;
import org.eclipse.chemclipse.pcr.converter.core.IPlateExportConverter;
import org.eclipse.chemclipse.pcr.converter.supplier.rdes.io.PCRWriter;
import org.eclipse.chemclipse.pcr.model.core.IPlate;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.processing.core.ProcessingInfo;
import org.eclipse.core.runtime.IProgressMonitor;

public class PCRExportConverter extends AbstractPlateExportConverter implements IPlateExportConverter {

private static final Logger logger = Logger.getLogger(PCRExportConverter.class);
private static IPlateExportConverter instance = null;
private static final String DESCRIPTION = "RDES Export";

@Override
public IProcessingInfo<File> convert(File file, IPlate plate, IProgressMonitor monitor) {

PCRWriter qPCR = new PCRWriter();
IProcessingInfo<File> processingInfo = new ProcessingInfo<>();
try {
qPCR.writePlate(file, plate);
processingInfo.setProcessingResult(file);
} catch(IOException e) {
logger.warn(e);
processingInfo.addErrorMessage(DESCRIPTION, "Failed to write file: " + file.getAbsolutePath(), e);
}
return processingInfo;
}

public static IPlateExportConverter getInstance() {

if(instance == null) {
instance = new PCRExportConverter();
}
return instance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*******************************************************************************
* Copyright (c) 2023 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.pcr.converter.supplier.rdes.core;

import java.io.File;
import java.io.IOException;

import org.eclipse.chemclipse.logging.core.Logger;
import org.eclipse.chemclipse.pcr.converter.core.AbstractPlateImportConverter;
import org.eclipse.chemclipse.pcr.converter.core.IPlateImportConverter;
import org.eclipse.chemclipse.pcr.converter.supplier.rdes.io.PCRReader;
import org.eclipse.chemclipse.pcr.model.core.IPlate;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.core.runtime.IProgressMonitor;

public class PCRImportConverter extends AbstractPlateImportConverter implements IPlateImportConverter {

private static final Logger logger = Logger.getLogger(PCRImportConverter.class);
private static final String DESCRIPTION = "RDES Import";
private static IPlateImportConverter instance = null;

@Override
public IProcessingInfo<IPlate> convert(File file, IProgressMonitor monitor) {

IProcessingInfo<IPlate> processingInfo = super.validate(file);
if(!processingInfo.hasErrorMessages()) {
PCRReader qPCR = new PCRReader();
try {
IPlate plate = qPCR.read(file);
processingInfo.setProcessingResult(plate);
} catch(IOException e) {
logger.warn(e);
processingInfo.addErrorMessage(DESCRIPTION, "Failed to read file: " + file.getAbsolutePath(), e);
}
}
return processingInfo;
}

public static IPlateImportConverter getInstance() {

if(instance == null) {
instance = new PCRImportConverter();
}
return instance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2023 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.pcr.converter.supplier.rdes.io;

import java.io.File;
import java.io.IOException;

import org.eclipse.chemclipse.pcr.model.core.IPlate;

public class PCRReader {

public IPlate read(File file) throws IOException {

return null;
}
}
Loading

0 comments on commit 3890dc6

Please sign in to comment.