[codeface] Re: [PATCH 4/6] Create location for interactive analysis scripts

  • From: Mitchell Joblin <joblin.m@xxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Mon, 23 Nov 2015 13:45:14 +0100

Hi Wolfgang,

On Sat, Nov 21, 2015 at 9:45 PM, Wolfgang Mauerer
<wolfgang.mauerer@xxxxxxxxxxxxxxxxx> wrote:

While web front-end is designed for end-user visualisation,
scientific research often demands more experimental
forms of visualisation. Create directory R/interactive
for corresponding scripts.

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>
---
codeface/R/interactive.r | 67
------------------------------------
codeface/R/interactive/interactive.r | 67
++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 67 deletions(-)
delete mode 100644 codeface/R/interactive.r
create mode 100644 codeface/R/interactive/interactive.r

diff --git a/codeface/R/interactive.r b/codeface/R/interactive.r
deleted file mode 100644
index aeafe00..0000000
--- a/codeface/R/interactive.r
+++ /dev/null
@@ -1,67 +0,0 @@
-## This file is part of Codeface. Codeface is free software: you can
-## redistribute it and/or modify it under the terms of the GNU General Public
-## License as published by the Free Software Foundation, version 2.
-##
-## This program is distributed in the hope that it will be useful, but
WITHOUT
-## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
-## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-## details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Copyright 2013 by Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>
-## All Rights Reserved.
-
-## Definitions to simplify interacting with the Codeface database,
-## usually for explorative research
-
-## Use create.conf() to create a configuration object.
-## Then, use standard query functions and the associated processing
-## mechanisms to work with the database content.
-
-source("config.r")
-source("query.r")
-
-create.conf <- function(codeface.conf, project.conf=NULL) {
- ## Load configuration file(s)
- conf <- load.config(codeface.conf, project.conf)
-
- ## Open up the corresponding database connection
- if(is.null(project.conf)) {
- conf <- init.db.global(conf)
- } else {
- conf <- init.db(conf)
- }
-
- return(conf)
-}

This function looks very similarly to connect.db in the db.r file. The
main difference is that one supports the inclusion of a project
configuration file but I guess we don't need both functions. I am not
sure when this function was introduced but connect.db has been there
for ages. To me it doesn't matter which function is kept.

Cheers,

Mitchell

-
-
-## Example session: Plot the initiation-response network
-########################################################
-
-### Create a configuration object for project busybox
-### Run this in codeface/R (or setwd() appropriately)
-#source(interactive.r)
-#conf <- create.conf("/path/to/codeface.conf", "/path/to/busybox.conf")
-#
-### Load definitions of interest
-#source("ml/init.response.r")
-#
-### Obtain a list of range ids. Evert analysed release range is
-### uniquely identified by a single numeric id
-#range.ids <- query.range.ids(conf)
-#
-### Query data of interest (in this case, the initate-response
-### structure for the developer mailing list). The analysis range
-### is chosen arbitrarily
-#ml.id <- query.ml.id(conf, "dev")
-#dat <- query.initiate.response(conf$con, ml.id, range.ids[[3]])
-#dat <- prepare.initiate.response(dat)
-#g <- plot.init.response(g, title="Initate-response structure for busybox")
-#
-### Store the resulting graphs
-#ggsave("/tmp/ir1.pdf", g[[1]])
-#ggsave("/tmp/ir2.pdf", g[[2]])
diff --git a/codeface/R/interactive/interactive.r
b/codeface/R/interactive/interactive.r
new file mode 100644
index 0000000..c3a03a0
--- /dev/null
+++ b/codeface/R/interactive/interactive.r
@@ -0,0 +1,67 @@
+## This file is part of Codeface. Codeface is free software: you can
+## redistribute it and/or modify it under the terms of the GNU General Public
+## License as published by the Free Software Foundation, version 2.
+##
+## This program is distributed in the hope that it will be useful, but
WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+## details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## Copyright 2013 by Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>
+## All Rights Reserved.
+
+## Definitions to simplify interacting with the Codeface database,
+## usually for explorative research
+
+## Use create.conf() to create a configuration object.
+## Then, use standard query functions and the associated processing
+## mechanisms to work with the database content.
+
+source("../config.r", chdir=TRUE)
+source("../query.r", chdir=TRUE)
+
+create.conf <- function(codeface.conf, project.conf=NULL) {
+ ## Load configuration file(s)
+ conf <- load.config(codeface.conf, project.conf)
+
+ ## Open up the corresponding database connection
+ if(is.null(project.conf)) {
+ conf <- init.db.global(conf)
+ } else {
+ conf <- init.db(conf)
+ }
+
+ return(conf)
+}
+
+
+## Example session: Plot the initiation-response network
+########################################################
+
+### Create a configuration object for project busybox
+### Run this in codeface/R (or setwd() appropriately)
+#source(interactive.r)
+#conf <- create.conf("/path/to/codeface.conf", "/path/to/busybox.conf")
+#
+### Load definitions of interest
+#source("ml/init.response.r")
+#
+### Obtain a list of range ids. Evert analysed release range is
+### uniquely identified by a single numeric id
+#range.ids <- query.range.ids(conf)
+#
+### Query data of interest (in this case, the initate-response
+### structure for the developer mailing list). The analysis range
+### is chosen arbitrarily
+#ml.id <- query.ml.id(conf, "dev")
+#dat <- query.initiate.response(conf$con, ml.id, range.ids[[3]])
+#dat <- prepare.initiate.response(dat)
+#g <- plot.init.response(g, title="Initate-response structure for busybox")
+#
+### Store the resulting graphs
+#ggsave("/tmp/ir1.pdf", g[[1]])
+#ggsave("/tmp/ir2.pdf", g[[2]])
--
2.1.4



Other related posts: