Permalink
Browse files

Initialise repo

  • Loading branch information...
1 parent 46f207c commit 8b58e810166e004cda3ca35e5ed3a5e2335b4a75 @cheeyeelim committed Nov 6, 2015
Showing with 5,206 additions and 0 deletions.
  1. +22 −0 DESCRIPTION
  2. +44 −0 NAMESPACE
  3. +69 −0 R/RcppExports.R
  4. +17 −0 R/boolmodel_class.R
  5. +19 −0 R/booltrainer.R
  6. +309 −0 R/compression.R
  7. +128 −0 R/data_desc.R
  8. +644 −0 R/general.R
  9. +181 −0 R/initialisation.R
  10. +300 −0 R/methods.R
  11. +249 −0 R/model_modification.R
  12. +277 −0 R/output_format.R
  13. +543 −0 R/rand_model.R
  14. +162 −0 R/score_calculation.R
  15. +272 −0 R/search.R
  16. +102 −0 R/simulation.R
  17. +18 −0 booltrainer.Rproj
  18. BIN data/bon_bmodel.rda
  19. BIN data/bon_istate.rda
  20. BIN data/bon_moig_istate.rda
  21. BIN data/bon_sstate.rda
  22. BIN data/bon_wilson_istate.rda
  23. BIN data/bonkrum_geneid_map.rda
  24. BIN data/krum_bmodel.rda
  25. BIN data/krum_istate.rda
  26. BIN data/krum_sstate.rda
  27. BIN data/krum_wilson_istate.rda
  28. BIN data/moig_raw_data.rda
  29. BIN data/real_param.rda
  30. BIN data/wilson_raw_data.rda
  31. BIN data/wilson_raw_rnaseq.rda
  32. +22 −0 man/BoolModel-class.Rd
  33. +11 −0 man/BoolTraineR.Rd
  34. +17 −0 man/amat_to_bm.Rd
  35. +17 −0 man/bin_to_real.Rd
  36. +17 −0 man/bm_to_amat.Rd
  37. +15 −0 man/bm_to_df.Rd
  38. +18 −0 man/bon_bmodel.Rd
  39. +17 −0 man/bon_istate.Rd
  40. +19 −0 man/bon_moig_istate.Rd
  41. +25 −0 man/calc_mscore.Rd
  42. +15 −0 man/calc_roc.Rd
  43. +19 −0 man/check_bmodel.Rd
  44. +20 −0 man/compress_bmodel.Rd
  45. +22 −0 man/decompress_bmodel.Rd
  46. +15 −0 man/decreate_boolmodel.Rd
  47. +16 −0 man/df_to_bm.Rd
  48. +21 −0 man/equi_model.Rd
  49. +19 −0 man/eval_bool.Rd
  50. +15 −0 man/extract_term.Rd
  51. +19 −0 man/filter_dflist.Rd
  52. +25 −0 man/gen_one_rmodel.Rd
  53. +23 −0 man/gen_randata.Rd
  54. +23 −0 man/gen_randata_bn.Rd
  55. +24 −0 man/gen_singlerule.Rd
  56. +30 −0 man/gen_two_rmodel.Rd
  57. +25 −0 man/gen_two_rmodel_dag.Rd
  58. +18 −0 man/get_encodings.Rd
  59. +17 −0 man/grow_bmodel.Rd
  60. +17 −0 man/initialise_data.Rd
  61. +16 −0 man/initialise_model.Rd
  62. +22 −0 man/initialise_raw_data.Rd
  63. +18 −0 man/krum_bmodel.Rd
  64. +17 −0 man/krum_istate.Rd
  65. +21 −0 man/m_score.Rd
  66. +18 −0 man/match_state.Rd
  67. +17 −0 man/match_state_loop.Rd
  68. +20 −0 man/match_term.Rd
  69. +17 −0 man/minmod_internal.Rd
  70. +19 −0 man/minmod_model.Rd
  71. +21 −0 man/model_consensus.Rd
  72. +21 −0 man/model_dist.Rd
  73. +23 −0 man/model_setdiff.Rd
  74. +24 −0 man/model_simplify.Rd
  75. +31 −0 man/model_train.Rd
  76. +17 −0 man/moig_data.Rd
  77. +17 −0 man/moig_raw_data.Rd
  78. +17 −0 man/outcyto_model.Rd
  79. +24 −0 man/outcyto_stategraph.Rd
  80. +17 −0 man/outgenysis_model.Rd
  81. +17 −0 man/param_bimodal.Rd
  82. +17 −0 man/printBM.Rd
  83. +17 −0 man/rcpp_ham_dist.Rd
  84. +15 −0 man/rcpp_m_score.Rd
  85. +17 −0 man/rcpp_man_dist.Rd
  86. +19 −0 man/rcpp_simulate.Rd
  87. +17 −0 man/rcpp_validate.Rd
  88. +14 −0 man/real_param.Rd
  89. +19 −0 man/simulate_model.Rd
  90. +17 −0 man/unique_raw_data.Rd
  91. +17 −0 man/validate_adjmat.Rd
  92. +17 −0 man/vcat.Rd
  93. +17 −0 man/which.random.min.Rd
  94. +21 −0 man/writeBM.Rd
  95. +79 −0 src/RcppExports.cpp
  96. +56 −0 src/general.cpp
  97. +254 −0 src/score_calculation.cpp
  98. +262 −0 src/simulation.cpp
View
@@ -0,0 +1,22 @@
+Package: BoolTraineR
+Type: Package
+Title: Tools For Training and Analysing Asynchronous Boolean Models
+Version: 1.0.1
+Date: 2015-10-22
+Author: Chee Yee Lim
+Maintainer: Chee Yee Lim <cyl49@cam.ac.uk> <cheeyee.lim@gmail.com>
+Description: This package contains tools for Boolean model manipulation, as well as the search for the best Boolean model.
+Depends:
+ R (>= 3.0.3),
+ methods
+Imports:
+ parallel,
+ Rcpp (>= 0.11.4),
+ foreach (>= 1.4.1),
+ doParallel (>= 1.0.8),
+ poweRlaw (>= 0.30.0),
+ MASS (>= 7.3-44),
+ diptest (>= 0.75-7)
+LinkingTo: Rcpp
+License: GPL-3
+LazyData: true
View
@@ -0,0 +1,44 @@
+# Generated by roxygen2 (4.1.1): do not edit by hand
+
+export(BoolModel)
+export(amat_to_bm)
+export(bin_to_real)
+export(bm_to_amat)
+export(bm_to_df)
+export(calc_mscore)
+export(calc_roc)
+export(check_bmodel)
+export(compress_bmodel)
+export(decompress_bmodel)
+export(df_to_bm)
+export(equi_model)
+export(gen_randata)
+export(gen_randata_bn)
+export(gen_two_rmodel)
+export(gen_two_rmodel_dag)
+export(get_encodings)
+export(grow_bmodel)
+export(initialise_data)
+export(initialise_model)
+export(initialise_raw_data)
+export(model_consensus)
+export(model_dist)
+export(model_setdiff)
+export(model_train)
+export(outcyto_model)
+export(outcyto_stategraph)
+export(outgenysis_model)
+export(param_bimodal)
+export(printBM)
+export(simulate_model)
+export(unique_raw_data)
+export(validate_adjmat)
+export(writeBM)
+exportClasses(BoolModel)
+import(doParallel)
+import(foreach)
+import(methods)
+import(parallel)
+importFrom(Rcpp,evalCpp)
+importFrom(Rcpp,sourceCpp)
+useDynLib(BoolTraineR)
View
@@ -0,0 +1,69 @@
+# This file was generated by Rcpp::compileAttributes
+# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
+
+#' @title Find a match between two data frames.
+#'
+#' @description
+#' (&&&Not for public use&&&)This function finds a match between two df of states. Used in match_state(). Return an row index vector indicating which row of mstate matches the rows in xstate.
+#'
+#' @param mstate data frame. It should be a state(row) x gene(column) df.
+#' @param xstate data frame. It should be a state(row) x gene(column) df.
+match_state_loop <- function(mstate, xstate) {
+ .Call('BoolTraineR_match_state_loop', PACKAGE = 'BoolTraineR', mstate, xstate)
+}
+
+#' @title Calculating pairwise scores between model and data states.
+#'
+#' @description
+#' This function calculates the pairwise scores between each row of model and data states. The score is calculated using a custom binary distance measure.
+#'
+#' @param x_df matrix. It should be numerical matrix of model states.
+#' @param y_df matrix. It should be numerical matrix of data states.
+rcpp_man_dist <- function(x_df, y_df) {
+ .Call('BoolTraineR_rcpp_man_dist', PACKAGE = 'BoolTraineR', x_df, y_df)
+}
+
+#' @title Calculating Hamming pairwise scores between model and data states.
+#'
+#' @description
+#' This function calculates the pairwise scores between each row of model and data states. The score is calculated using a custom binary distance measure.
+#'
+#' @param x_df matrix. It should be logical matrix of model states.
+#' @param y_df matrix. It should be logical matrix of data states.
+rcpp_ham_dist <- function(x_df, y_df) {
+ .Call('BoolTraineR_rcpp_ham_dist', PACKAGE = 'BoolTraineR', x_df, y_df)
+}
+
+#' @title Inner core for m_score()
+#'
+#' @description
+#' This function takes in a df with columns ranked wrt each row, and try to assign each row to a unique column without repetition.
+#'
+#' @param x_df matrix. Matrix with columns ranked wrt each row.
+rcpp_m_score <- function(x_df) {
+ .Call('BoolTraineR_rcpp_m_score', PACKAGE = 'BoolTraineR', x_df)
+}
+
+#' @title Calculating validation scores between two adjacency matrices
+#'
+#' @description
+#' This function calculates the validation scores between two adjacency matrices.
+#'
+#' @param inf_mat matrix. It should be adjacency matrix of inferred network.
+#' @param true_mat matrix. It should be adjacency matrix of true network.
+rcpp_validate <- function(inf_mat, true_mat) {
+ .Call('BoolTraineR_rcpp_validate', PACKAGE = 'BoolTraineR', inf_mat, true_mat)
+}
+
+#' @title Simulate a Boolean model.
+#'
+#' @description
+#' (&&&Not for public use&&&)This function simulates the Boolean model using an initial state. For use within simulate_model(). Returns a matrix of full asynchronous state space.
+#'
+#' @param bmodel list. A list of 4 lists created by decreate_model().
+#' @param fstate data frame. It must have been initialised by initialise_data(), and has gene names as column names. Must contain only 1 row.
+#' @param verbose logical. Indicates whether to output progress.
+rcpp_simulate <- function(bmodel, fstate, verbose = FALSE) {
+ .Call('BoolTraineR_rcpp_simulate', PACKAGE = 'BoolTraineR', bmodel, fstate, verbose)
+}
+
View
@@ -0,0 +1,17 @@
+#' @title An S4 class to represent a Boolean Model
+#'
+#' @description
+#' This class represents Boolean Model in a S4 BoolModel object.
+#'
+#' @field target character vector. It should contain gene symbols.
+#' @field targer_var character vector. It should contain the internal representation of gene variables, in the form of "v[0-9]+s"
+#' @field rule_act list of character vectors. Each element in the list should contain the activating gene variables for a particular target gene.
+#' @field rule_inh list of character vectors. Each element in the list should contain the inhibiting gene variables for a particular target gene.
+#'
+#' @export BoolModel
+#' @exportClass BoolModel
+BoolModel = setClass('BoolModel',
+ slots=c(target='character', target_var='character',
+ rule_act='list', rule_inh='list')
+ )
+
View
@@ -0,0 +1,19 @@
+#' @title BoolTraineR: A package for studying asynchronous Boolean models
+#'
+#' @description
+#' This package contains tools for Boolean model manipulation, as well as the search for the best Boolean model.
+#'
+#' @docType package
+#' @name BoolTraineR
+NULL
+
+## All the Roxygen codes below are for generating the correct NAMESPACE file.
+#' @import methods
+#' @import parallel
+#' @import foreach
+#' @import doParallel
+NULL
+
+#' @useDynLib BoolTraineR
+#' @importFrom Rcpp sourceCpp evalCpp
+NULL
Oops, something went wrong.

0 comments on commit 8b58e81

Please sign in to comment.