Google Summer of Code 2017 — Final Report
Organization: The Eclipse Foundation
Mentor: Dr. Philip Wenig
Project: ChemClipse — Integrating R
Introduction
During GSoC 2017, I started integrating idiosyncrasies of R language into ChemClipse from scratch on behalf of The Eclipse Foundation. ChemClipse is also known as OpenChrom. OpenChrom is one of many projects, which use Eclipse Rich Client Platform as an Integrated Development Environment for Java Programming Language. In this document, I am describing my accomplishments in last 3 months.
I worked on a separate repository from beginning under github branch ‘develop’. The source code is accessible at following link:
https://github.com/OpenChrom/rscriptingsupport/tree/develop/openchrom
How to set up
1) For Developers
In order to work on this project, it is necessary to install Eclipse RCP application using installer provided by Oomph. Detailed instructions are provided for OpenChrom/ChemClipse at following link:
https://wiki.openchrom.net/index.php/Development
It is recommended to follow all the steps carefully, not only to install the Integrated Development Environment but also for Target Platform.
After finishing installation of basic environment, complete source code should be fetched to access all the plug-ins.
2) For End Users
The basic and initial functionalities of my work have been included as R-Support plugin into latest OpenChrom release. It is accessible via marketplace for version 1.2.0. The OpenChrome v-1.2.0 is accessible at following sourceforge location for different platforms:
https://sourceforge.net/projects/openchrom/files/REL-1.2.0/
After installing OpenChrom, access marketplace window using “Plug-ins” main menu (figure-1).

How it works
- Installing R
The R-support plugin requires precompiled binary distributions of R base system and packages. For Linux and Mac systems, user must install binary distribution of R separately. For windows, it can be installed by selecting submenu “Install R”, from main menu ‘R’, and then by continuing subsequent steps in wizard (as shown in figure-2 and figure-3).


2. Setting up Path Variables
Path variable needs to be set up using Preferences window (figure-4). “Path to R:” should point to the directory location where binary files have been installed. For Linux and Mac systems, it is mostly under the Unix system resources directory, and for windows it is usually “R_SERVER” directory in program files.

3. R Perspective
From the main menu tab click on “R”, under “R” the R perspective can be accessed as shown in Figure-5 and Figure-6.


4. Starting R terminal
R interpreter can be used in two ways, either by starting R terminal as native process or by using RServe library, as highlighted in figure-7. To start RServe library it is necessary to install RServe packages using “install.packages()” command.

5. Creating a new R Script
On the main menu under “R”, select “New R Script” to create new script file for R language (figure-8). It opens up a new wizard to select the project. Provide name for intended file to be created (figure-9).


6. Using Editor
Statements can be written in the editor area for selected file. The outline of script is generated in a view, that is beneath project explorer. Outline includes variables and functions as shown in figure-10.

Before executing a script, current working directory ought to be set using command “setwd(project_location)” in console.
In order to run a script, expand menu “Execute R Editor” from Console view as shown in figure-11. If sub menu “Current Line” is clicked, it executes only one line from the active script editor based on cursor positioning. If sub menu “Interpret Script” is clicked, it executes active script file.

Output after executing a script is printed in Console (figure-12).

Relevant Commits and Contributions
My telling commits are:
- Created Initial Console Factory and Console to test RServe pipeline.
- Initialized R terminal as a process.
- Started modifying and creating R Perspective as per attached screenshots.
- Introduced Common Navigator Resources in R Perspective.
- Created Table view part for R Perspective without menu and toolbar.
- Introduced Preference Pages for path variables and other settings
- Created Wizards and updated layouts with main menu
- Developed wizard to install R binary distribution on windows.
- Committed/Checked-in outline provider
- Included R Script Editor and functionality to execute active scripts.
The complete list of commits for repository’s “develop” branch can be accessed at following link:
https://github.com/OpenChrom/rscriptingsupport/commits/develop/openchrom
Open/Known Issues and Further Work
- Provide Key Bindings and shortcuts, for R Editor commands.
- Enhancement in R Table to be achieved. Provide Import/Export of Data from spreadsheets and text delimited files.
- Corrections in GUI of R Table view.
- Handle errors and activities being printed in R Console. Remove these error streams and error messages being printed in console.
- Make Properties view functional.
- Create Plot view and connect it with R pipeline.
- Handle recreation of menu commands after clicking perspective more than once.
- Implement functionality to connect R Tableview with R pipeline and read data from table directly into a variable in R language.
- A GUI, on top of console and editor window, can be developed as enhancement to evaluate R packages, libraries and Methods.
In last 3 months, I have developed the foundation for integration of very basic features of R platform into OpenChrom. Further work continues with identification and resolution of more bugs and issues. Enhancements and improvisation will be coming along in future releases.
Conclusion
I like to thank my mentor Dr. Philip Wenig for his time as well as support, and for guiding me through the technology, which was completely new to me. Students, who are planning to participate in GSoC-2018, should apply for ChemClipse/ OpenChrom. It will prove to be a great learning experience. It proved to be a ground-breaking opportunity for me.
In continuation, I have found project ChemClipse/OpenChrom very interesting. Not only working with Java was new to me but also Eclipse IDE and its Rich Client Platform was an immense challenge to me. The plugin based architecture uses basic e4 framework, where I have learned about fragments, views, view parts, perspectives, extension points, dependency injection, and target platform. The most important thing, that I learnt, was about the architecture of Rich Client Platform in Eclipse. It is amazing to see how all the pieces, which are very loosely coupled, fit and communicate with each other to create a product, that is more than the sum of its parts. It was a unique experience for me after having invested so many years in .Net and Visual Studio.