Can’t find IDfind.ext exception

Whilst migrating OpenChrom to the new Eclipse e4 application platform, I’ve encountered an exception, which was hard to resolve. All 3.x editors couldn’t be opened within the first try, curiously. Instead, an error was displayed:

Editor 3.x - e4

An exception

org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException: can’t find IDfind.ext

was thrown. Finally, I’ve found a solution how to handle this issue. It works fine now, after adding the workbench action constant in the ApplicationActionBarAdvisor.java class.

protected void fillMenuBar(IMenuManager menuBar) {
	MenuManager editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
	editMenu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
}

Exist

Posted in Uncategorized | Leave a comment

Cool Eclipse Kids trink Cola. Cool Eclipse Adults enjoy Coffee …

I read Lars post about building Eclipse 4.2 via Maven/Tycho from the command line this morning:

http://www.vogella.com/blog/2012/11/27/all-the-cool-eclipse-kids-using-cbi-these-days

Honestly, I didn’t thought it will work. But it did! Cool stuff!

Ubuntu Linux 12.04 LTS
java version “1.7.0_09″
OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Default locale: de_DE, platform encoding: UTF-8
OS name: “linux”, version: “3.2.0-34-generic”, arch: “amd64″, family: “unix”

coffee

Eclipse CBI is definitively worth a try!

Posted in Uncategorized | Leave a comment

Scientists of the world, unite!

Scientists of the world unite

Image | Posted on by | Leave a comment

It’s end of October – time for the final OpenChrom release 0.7.0 “Nernst”

What a great moment, after half a year of development!

  • There are native installer for Ubuntu and Scientific Linux available now.

Go there, get it. OpenChrom is open source:
http://www.openchrom.net/main/content/downloads.php

A documentation is available here:
http://www.openchrom.net/dokuwiki/doku.php

OpenChrom lists more than 13.800 downloads since March 2010.
13.800 thanks for your confidence!

Posted in Uncategorized | Leave a comment

OpenChrom version 0.7.0 “Nernst” preview has been released!

I proudly announce the availability of the preview release 0.7.0 “Nernst”.

Several improvements are included, e.g.:

  • Varian (*.xms) converter
  • Shimadzu (*.qgd) converter
  • OpenChrom (*.ocb) converter to store chromatograms, peaks and identification results
  • Groovy-Script support
  • Improved reporting functionality
  • Display of chromatogram heatmaps
  • Improved chromatogram and peak database support

Shared Chromatogram Evaluation

Go there, get it:
http://www.openchrom.net/main/content/downloads-preview.php

The final release will be published end of October 2012.

Posted in Uncategorized | Leave a comment

It’s groovy baby …

Wouldn’t it be nice to access the API of an own RCP by using a script? Hence, adding script support to an own RCP application, that’s groovy. Indeed, Groovy is a good choice for such a purpose. Hence, I thought it’s easy to install the Groovy-Eclipse 3.7 plug-in into my own RCP OpenChrom from the marketplace … and boooom, that’s it. It wasn’t. After 3 days of handling with missing JDT and PDE dependencies, I surrendered. Despite of that, the Groovy-Eclipse plug-in is a great choice for the Eclipse IDE, but it didn’t worked for me. Anyhow, I got it working with a simple RCP test case, but the next issue was to access the API of the enclosing RCP. Again, there were problems accessing the OSGi bundles. Why on earth, there must be a solution. It was really getting ungroovy now. But after staying off the project some days, I thought about testing an embedded version of the Groovy Shell. That was the solution.

First of all, the latest Groovy binary release is needed:
http://dist.groovy.codehaus.org/distributions/groovy-binary-2.0.2.zip

It includes a folder called “embeddable” which contains the groovy redistributable “groovy-all-2.0.2.jar”. Please consider, Groovy is licensed under the Apache License, Version 2.0. Please also take care of the ANTLR, ASM, CLI, JSR223 licenses. They are stored in the downloaded zip file. The jar file needs to be included in the classpath of the plug-in. Use the “Runtime” tab of the MANIFEST.MF file.

Groovy-Jar-Classpath

A handler can be used to load groovy scripts inside the RCP application.

try {
	GroovyShell groovyShell = new GroovyShell();
	File file = new File("parse-chromatogram.groovy");
	Script script = groovyShell.parse(file);
	script.run();
} catch(CompilationFailedException e) {
	System.out.println(e);
} catch(IOException e) {
	System.out.println(e);
}

The Groovy Shell can be used now to execute Groovy script files, for example a file to parse a chromatogram: parse-chromatogram.groovy.

/*
 * Select a chromatogram file.
 * Print the TIC value of each scan.
 */
File file = new File("Chromatogram1.CDF")
IProgressMonitor monitor = new NullProgressMonitor()
IChromatogramImportConverterProcessingInfo processingInfo
try {
	/*
	 * Try to process the chromatogram.
	 */
	processingInfo = ChromatogramConverter.convert(file, monitor)
	IChromatogram chromatogram = processingInfo.getChromatogram()
	int numberOfScans = chromatogram.getNumberOfScans()
	for(int i = 1; i <= numberOfScans; i++) {
		ISupplierMassSpectrum scan = chromatogram.getScan(i)
		println("SCAN [" + i + "] - TIC: " + scan.getTotalSignal())
	}
} catch(TypeCastException e) {
	/*
	 * Print error messages.
	 */
	List<IProcessingMessage> messages = processingInfo.getMessages()
	for(int i = 0; i < messages.size(); i++) {
		IProcessingMessage message = messages.get(i)
		println(message.getDescription() + "\t" + message.getMessage())
	}
}

But which classes and bundles are accessible by the the Groovy script? It depends on the referenced packages by the executing plug-in. In this case, I’ve added all necessary bundles of Eclipse and OpenChrom to use the scripts in a variety of situations. Use the “Dependencies” tab of the MANIFEST.MF file to add plug-ins whose classes shall be accessible by the Groovy script.

Plugin-Dependencies

That’s it! This feature will be available in the next release of OpenChrom end of October 2012, version 0.7.0 “Nernst”. The next step will be to offer a support for editing groovy files within OpenChrom. But so far, it’s a great step forward. The users of OpenChrom have the chance to create their own evaluation scripts now.

That’s groovy baby …

Posted in Uncategorized | Leave a comment

Creating heatmaps using SWT XY Graph

I just discovered a brilliant library SWT XYGraph to create heatmaps. The following image is an example of a chromatogram heatmap. Mass spectrometric chromatograms are three-dimensional data sets containing scans (Y), mass fragments (X) and intensities (Z).

Chromatogram Heatmap

This is a short example of how to use the SWT XYGraph library. Get the libraries and include them in your project:

org.csstudio.swt.widgets_2.0.1.201207141617.jar
org.csstudio.swt.xygraph_2.0.1.201207141617.jar

The libraries are published under the EPL v1.0 license.

This is the code I’ve used to create a chromatogram heatmap:

LightweightSystem lightweightSystem = new LightweightSystem(canvas);
lightweightSystem.getRootFigure().setBackgroundColor(display.getSystemColor(SWT.COLOR_WHITE));
IntensityGraphFigure intensityGraphFigure = new IntensityGraphFigure();
intensityGraphFigure.setForegroundColor(display.getSystemColor(SWT.COLOR_BLACK));
intensityGraphFigure.getXAxis().setTitle("m/z");
intensityGraphFigure.getYAxis().setTitle("scan");
...
int dataHeight = stopScan - startScan + 1; // y -> scans
int dataWidth = stopIon - startIon + 1; // x -> m/z values
/**
 * Parse the data
 */
float maxIntensity = 0;
float[] heatmapData = new float[dataWidth * dataHeight * 2];
/**
 * Y-Axis: Scans
 */
for(int scan = startScan; scan <= stopScan; scan++) {
	int xScan = scan - startScan; // xScan is zero based, scan maybe not
	IExtractedIonSignal extractedIonSignal;
	try {
		extractedIonSignal = extractedIonSignals.getExtractedIonSignal(scan);
		for(int ion = startIon; ion <= stopIon; ion++) {
			/**
			 * X-Axis: m/z intensities
			 */
			int xIon = ion - startIon; // xIon is zero based, ion maybe not
			float abundance = extractedIonSignal.getAbundance(ion);
			if(abundance > maxIntensity) {
				maxIntensity = abundance;
			}
			heatmapData[xScan * dataWidth + xIon] = abundance;
		}
	} catch(NoExtractedIonSignalStoredException e) {
		logger.warn(e);
	}
}
/**
 * Set the ranges and min/max values.
 */
intensityGraphFigure.getXAxis().setRange(new Range(startIon, stopIon));
intensityGraphFigure.getYAxis().setRange(new Range(stopScan, startScan));
intensityGraphFigure.setMin(0); // Intensity
intensityGraphFigure.setMax(maxIntensity / 1000.0d); // Intensity
intensityGraphFigure.setDataHeight(dataHeight);
intensityGraphFigure.setDataWidth(dataWidth);
intensityGraphFigure.setColorMap(new ColorMap(PredefinedColorMap.JET, true, true));
/**
 * Set the heatmap data
 */
lightweightSystem.setContents(intensityGraphFigure);
intensityGraphFigure.setDataArray(heatmapData);

The chromatogram heatmap feature will be available in the next OpenChrom release, version 0.7.0 “Nernst”, scheduled for end of October 2012.

EclipseCon Europe 2012

Posted in Uncategorized | 2 Comments