Permalink
Browse files

R CMD check cleanup

  • Loading branch information...
1 parent 0fc8b75 commit 9cd3b2af3effca910d8c6eff41d4b646be7e0359 @cheeyeelim committed Nov 29, 2015
View
@@ -1,7 +1,7 @@
Package: BoolTraineR
Type: Package
Title: Tools For Training and Analysing Asynchronous Boolean Models
-Version: 1.1.1
+Version: 1.1.2
Date: 2015-10-22
Author: Chee Yee Lim
Maintainer: Chee Yee Lim <cyl49@cam.ac.uk>
@@ -22,6 +22,7 @@ LinkingTo: Rcpp
License: GPL-3
LazyData: true
Suggests:
+ bnlearn (>= 3.8.1),
knitr,
rmarkdown
VignetteBuilder: knitr
View
@@ -9,8 +9,6 @@ export(calc_roc)
export(compress_bmodel)
export(decompress_bmodel)
export(df_to_bm)
-export(gen_randata)
-export(gen_randata_bn)
export(gen_two_rmodel)
export(gen_two_rmodel_dag)
export(get_encodings)
View
@@ -96,15 +96,41 @@ NULL
#' @usage data(wilson_raw_rnaseq)
NULL
-#' @title Example Boolean Models used in the vignette
+#' @title Example Boolean Model used in the vignette
#'
#' @description
-#' 3 Boolean models used in the examples of the vignette.
+#' A Boolean model used in the examples of the vignette.
#'
#' @format
#' Each Boolean model is a BoolModel object.
#'
#' @docType data
-#' @name example_models
+#' @name emodel1
#' @usage data(example_models)
-NULL
+NULL
+
+#' @title Example Boolean Model used in the vignette
+#'
+#' @description
+#' A Boolean model used in the examples of the vignette.
+#'
+#' @format
+#' Each Boolean model is a BoolModel object.
+#'
+#' @docType data
+#' @name emodel2
+#' @usage data(example_models)
+NULL
+
+#' @title Example Boolean Model used in the vignette
+#'
+#' @description
+#' A Boolean model used in the examples of the vignette.
+#'
+#' @format
+#' Each Boolean model is a BoolModel object.
+#'
+#' @docType data
+#' @name emodel3
+#' @usage data(example_models)
+NULL
View
@@ -12,8 +12,6 @@
#' @export
initialise_raw_data = function(x, data_type='qpcr', uni_thre=0.2, scale=T)
{
- require(diptest)
-
#(1) Convert negative to positive values.
if(min(x)<0)
{
@@ -53,7 +51,7 @@ initialise_raw_data = function(x, data_type='qpcr', uni_thre=0.2, scale=T)
for(i in 1:ncol(x))
{
#Perform unimodality test for each gene.
- uni_test = dip.test(x[,i])$p.value
+ uni_test = diptest::dip.test(x[,i])$p.value
if(uni_test > uni_thre)
{
View
@@ -66,6 +66,7 @@ writeBM = function(bmodel, file, gene.names=F, rownames=F)
#'
#' @description
#' This method plots the network underlying Boolean models by using igraph for quick visualisation.
+#' Require igraph.
#'
#' @param bmodel S4 BoolModel object.
#' @param makePlot logical. Whether to make plot or just return the object. Default to T.
@@ -74,29 +75,27 @@ writeBM = function(bmodel, file, gene.names=F, rownames=F)
#' @export
plotBM = function(bmodel, makePlot=T, ...)
{
- require(igraph)
-
#Convert to amat.
am = bm_to_amat(bmodel)
#Convert into a graph.
- g = graph.adjacency(am, mode='directed', weighted=T)
+ g = igraph::graph.adjacency(am, mode='directed', weighted=T)
#Setup edge colour for plotting.
#Activation = black, inhibition = red
- E(g)$color = sapply(E(g)$weight, function(x) ifelse(x==1, 'black', 'red'))
+ igraph::E(g)$color = sapply(igraph::E(g)$weight, function(x) ifelse(x==1, 'black', 'red'))
#Setup other colours.
- V(g)$frame.color = "white"
- V(g)$color = rgb(255, 165, 0, 200, maxColorValue = 255)
+ igraph::V(g)$frame.color = "white"
+ igraph::V(g)$color = rgb(255, 165, 0, 200, maxColorValue = 255)
#Setup vertex font size.
- V(g)$label.cex = 1.5
+ igraph::V(g)$label.cex = 1.5
if(makePlot)
{
#Make the plot.
- plot(g, layout=layout_in_circle, ...)
+ igraph::plot.igraph(g, layout=igraph::layout_in_circle, ...)
}
invisible(g)
@@ -265,7 +264,7 @@ bm_to_df = function(bmodel)
#' This method converts a data frame into a BoolModel object.
#' Note that the model should only has 1 NOT operator. More than 1 is STRICTLY NOT allowed.
#'
-#' @param df data frame with 2 columns, targets and factors
+#' @param in_df data frame with 2 columns, targets and factors
#'
#' @export
df_to_bm = function(in_df)
Oops, something went wrong.

0 comments on commit 9cd3b2a

Please sign in to comment.