Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I do rapid GUI development for R and Octave methods (possibly with Python)?

Tags:

We are a medium-sized academic research lab whose main outputs are new statistical methods for analyzing large datasets. We generally develop in R and MATLAB/Octave.

We would like to expand the reach of our work by building simple, wizard-style user interfaces to access our methods, either web-apps like RNAfold or stand-alone applications to analyze private data.

Ideally, we would like the interfaces to do some data checking, to only use FOSS, to run in Mac and Windows environments, and to be able to generate simple charts and graphs that can be output as figures suitable for publication. Also, we like Python because it’s a popular language in the lab and in our research community.

However, we want to be able to develop and release quickly and cheaply. We are lucky to be able to fund one developer in the lab and s/he has to support multiple projects.

There are a lot of groups with the same needs and constraints as us, so it would be useful to be able to develop a consistent long-term strategy for this type of challenge.

Edit I asked for comments on four possible approaches, included below with summary of comments:

  1. Calling the R and Octave methods from Python.
    Answers:
    • R / Python integration
      • Rpy (from ChrisC)
      • pyRserve (from radek)
      • PypeR (from radek, see answer for paper link)
    • Using a Python client to call in to an Octave server (from ChrisC)
  2. Re-implementing our methods in Python. In general, this is not easy because our methods rely on other methods also implemented in R and Octave. Answers:
    • There was no comment on this approach, it's probably a bad idea.
  3. Using a different framework to build user-interfaces.
    Answers:
    • How about building GUIs and web-apps directly in R? (from hadley, see answer for tool refs)
  4. Other ideas that we haven’t considered, e.g., integrating with workflow management systems like Taverna.
    Answers:
    • Try a visual programming interface like RedR (from chrisamiller)

My preferred answer

I'm first going to look into the approach suggested by Spacedman: using QtDesigner to build the UI for PyQt4 and calling R with RPy. We get a lot of students without a programming background who want to volunteer in the lab, and QtDesigner looks like something that we could train them to use effectively.

I would like develop GUIs directly in R as recommended by hadley but RQt, which I presume that I need to use QtDesigner, does not appear to be in active development (last update was summer of 2009).

Also, it looks like we may have to start implementing our methods exclusively in R, and translating over from MATLAB/Octave to R. In my field, this is probably not a bad idea anyways.

Appendix:

  1. Python libraries to simplify user interface construction:
    • wxPython (ChrisC)
    • PyQt4 (from Spacedman)
  2. Other projects that integrate Python, R, and Octave:
    • SAGE (Dirk Eddelbuettel)
    • Shogun (Dirk Eddelbuettel)
  3. GUIs to make GUIs:
    • QtDesigner with PyQt4 (from Spacedman). Note Qt4 is both commercial and available under a LGPL.
like image 747
qdjm Avatar asked Sep 11 '10 17:09

qdjm


People also ask

Which software is used for GUI application development program in Python?

Tkinter Programming Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.

How GUI programming is done in Python?

Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create the GUI applications.

Is Python good for making GUI?

While being incredibly useful for the fields of data science and machine learning, Python is also great for developing graphical user interfaces! In fact, it has many frameworks that even beginners can use to easily get started with developing a GUI.


2 Answers

Why not continue to develop directly in R? There are a number of packages that allow you to develop GUIs (gWidgets RGtk, tcl/tk, RQt, Rwxwidgets, rjava) or web applications.

like image 126
hadley Avatar answered Oct 22 '22 08:10

hadley


I'd go with Python and PyQt4 for the UI, and use Rpy to interface to R.

There's the QtDesigner for interface designing and you can generate python from that. QtAssistant gives you a fully hyperlinked documentation set for Qt which is the best I've ever used.

Well worth it!

like image 41
Spacedman Avatar answered Oct 22 '22 07:10

Spacedman