简体   繁体   English

我应该如何为R和Octave方法(可能使用Python)进行快速GUI开发?

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

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. 我们通常用R和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. 我们希望通过构建简单的向导式用户界面来扩展我们工作的范围,以访问我们的方法,如RNAfold等网络应用程序或分析私有数据的独立应用程序。

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. 理想情况下,我们希望接口进行一些数据检查,仅使用FOSS,在Mac和Windows环境中运行,并能够生成简单的图表和图形,可以作为适合发布的数字输出。 Also, we like Python because it's a popular language in the lab and in our research community. 此外,我们喜欢Python,因为它是实验室和我们研究社区的流行语言。

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. 从Python调用R和Octave方法。
    Answers: 回答:
  2. Re-implementing our methods in Python. 在Python中重新实现我们的方法。 In general, this is not easy because our methods rely on other methods also implemented in R and Octave. 通常,这并不容易,因为我们的方法依赖于在R和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? 如何直接在R中构建GUI和Web应用程序? (from hadley , see answer for tool refs) (来自hadley ,见工具参考答案)
  4. Other ideas that we haven't considered, eg, integrating with workflow management systems like Taverna . 我们尚未考虑的其他想法,例如与Taverna等工作流管理系统集成。
    Answers: 回答:

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 . 我首先要研究Spacedman建议的方法:使用QtDesignerPyQt4构建UI并使用RPy调用R. 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. 我们让很多没有编程背景的学生想要在实验室做志愿者,而QtDesigner看起来像我们可以训练他们有效使用的东西。

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). 我想直接在R开发GUI,如hadley推荐但是RQt ,我认为我需要使用QtDesigner,似乎没有积极开发(最后更新是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. 此外,看起来我们可能必须在R中专门开始实现我们的方法,并从MATLAB / Octave转换为R.在我的领域,无论如何这可能不是一个坏主意。

Appendix: 附录:

  1. Python libraries to simplify user interface construction: 用于简化用户界面构建的Python库:
  2. Other projects that integrate Python, R, and Octave: 集成Python,R和Octave的其他项目:
  3. GUIs to make GUIs: 用于制作GUI的GUI:

Why not continue to develop directly in R? 为什么不继续直接在R? There are a number of packages that allow you to develop GUIs (gWidgets RGtk, tcl/tk, RQt, Rwxwidgets, rjava) or web applications . 有许多软件包允许您开发GUI(gWidgets RGtk,tcl / tk,RQt,Rwxwidgets,rjava)或Web应用程序

I'd go with Python and PyQt4 for the UI, and use Rpy to interface to R. 我将使用Python和PyQt4作为UI,并使用Rpy与R接口。

There's the QtDesigner for interface designing and you can generate python from that. 有用于界面设计的QtDesigner,你可以从中生成python。 QtAssistant gives you a fully hyperlinked documentation set for Qt which is the best I've ever used. QtAssistant为Qt提供了一个完全超链接的文档集,这是我用过的最好的。

Well worth it! 非常值得!

That's a tall order -- multi-platform, multi-backend (R and Ocatve), as well and cheap, fast and easy to use! 这是一个很高的订单 - 多平台,多后端(R和Ocatve),以及便宜,快速和易于使用!

From the top of my head, look at these 从头顶看,看看这些

  • Sage : they have what they call notebooks which are interactive web pages and showed a nice demo at useR! Sage :他们拥有他们称之为笔记本电脑的互动网页,并在useR上展示了一个不错的演示! 2010; 2010; I think Octave is covered too 我认为Octave也被覆盖了

  • Shogun : which also integrates to Python, R and Octave and may have some tools for you to leverage. Shogun :它还集成了Python,R和Octave,并且可能有一些工具供您利用。

I've been looking for something similar - simple rapid GUI in R. It seems there's a new alternative from RStudio guys. 我一直在寻找类似的东西 - 在R中简单快速的GUI。似乎有一个来自RStudio家伙的新选择。

Shiny should be sufficient for small web interfaces without much coding. 对于没有太多编码的小型Web界面, Shiny应该足够了。 Seems like a viable option if you need a simple input/output style of UI. 如果您需要简单的输入/输出样式的UI,它似乎是一个可行的选项。

I haven't tried directly connecting Octave with Python beyond setting up Octave apps as a server and having a Python client call in, but I've had some luck integrating R with Python courtesy RPy . 我没有尝试直接连接Octave和Python,除了将Octave应用程序设置为服务器并调用Python客户端之外,但我有幸运行将R与Python礼貌RPy集成。 In some of our applications we build eg a wxPython + matplotlib Python frontend, and call the R scripts directly through RPy. 在我们的一些应用程序中,我们构建了一个例如wxPython + matplotlib Python前端,并直接通过RPy调用R脚本。

For R and Python integration you might also want to have a look at 对于R和Python集成,您可能还需要查看

您可以尝试查看RedR ,它允许您将R包封装在Python GUI中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM