mkGrids                package:ccems                R Documentation

_M_a_k_e _G_r_i_d _M_o_d_e_l _S_p_a_c_e

_D_e_s_c_r_i_p_t_i_o_n:

     This function takes 'g' from 'mkg' and maps it into a  dataframe
     of grid model definitions. It also augments and returns the input
     list 'g'.

_U_s_a_g_e:

      mkGrids (g,maxnPs=NULL,pRows=FALSE,contig=TRUE, atLeastOne=TRUE, IC=1) 

_A_r_g_u_m_e_n_t_s:

       g: The output of 'mkg'. 

  maxnPs: The maximum number of parameters of models in the model
          space. If 'NULL' all models are found. 

   pRows: Set to 'TRUE' if additional rows are to be added to the
          output dataframe to include models with 'p' freely estimated. 

  contig: Set to 'TRUE' to allow Kd equalities of threads only in
          contiguous runs. Tentatively, this should always be 'TRUE'.

atLeastOne: Leave 'TRUE' if only models with at least one complex of
          maximal size are to be considered. Set 'FALSE' if there is no
          prior knowledge supportive of the assertion that the largest
          oligomer must be in the model.

      IC: The initial condition of all K parameters optimized. The
          default is 'IC=1'. 

_D_e_t_a_i_l_s:

     In a run of equal threads, the first head node of the run is the
     leader (optimized parameter) and the remaining nodes in the run
     are followers  (i.e. constrained to track the leader in parameter
     estimate optimizations); a default in 'ems' is that only leader
     estimates are reported in html in the 'results' subdirectory. In
     contrast to its counterpart 'mkSpurs', a means of traversing the
     grid model space systematically with increasing numbers of
     parameters remains to be found and implemented.  As a result,
     'mkGrids' does not have 'state' inputs and outputs and the whole
     space is found in one batch.  When this drawback  limits research
     due to too much memory usage,  attempts will be made to identify
     an approach that, similar to what has been implemented for spurs,
     specifies chunks of grid models, fits them, and then specifies the
     next chunk based on knowledge of where the previous chunk stopped.
      Note that setting  'maxnPs' to smaller values will not help with
     this foreseen problem as the full model space dataframe is first
     generated  and then, only later, truncated by 'maxnPs'.

_V_a_l_u_e:

     A list with components  

   chunk: The entire K equality model space requested by the arguments.
          In this dataframe each row specifies a model. 

    Keqs: A list of K equality constraints indexed by model names where
          each element is a vector of character strings whose names are
          followers and values are leaders. 

       g: The input list 'g'  augmented to include the following
          components:

'dfThread': A dataframe of the thread within site and oligo structure.

'threads': A nested list of the thread structure with threads at the
          top of the list and their contents and memberships below.

'threadsWithinSites': A list  of threads within sites, i.e. the list
          indices are sites.

'nodesWithinSites': A list of non-head nodes within sites.

'usedLets': A vector of the single characters used to label Kd
          equivalent threads. This is with respect to the entire grid
          space.

_N_o_t_e:

     This work was supported by the National Cancer Institute
     (K25CA104791).

_A_u_t_h_o_r(_s):

     Tom Radivoyevitch (txr24@case.edu)

_R_e_f_e_r_e_n_c_e_s:

     Radivoyevitch, T. (2008) Equilibrium model selection: dTTP induced
     R1 dimerization. _BMC Systems Biology_ *2*, 15.

_S_e_e _A_l_s_o:

     'mkSpurs',  'ccems'

_E_x_a_m_p_l_e_s:

     library(ccems)
     topology <- list(  
             heads=c("R1t0","R2t0"),  
             sites=list(       
                     s=list(                     # s-site    thread #
                             m=c("R1t1"),        # monomer      1
                             d=c("R2t1","R2t2")  # dimer        2
                     )
             )
     ) 
     g <- mkg(topology,TCC=TRUE) 
     gridL <- mkGrids(g) 
     print(gridL$chunk)

     topology <- list(
             heads=c("R1X0","R2X2","R4X4","R6X6"), # s-sites are already filled only in (j>1)-mer head nodes 
             sites=list(                    
                     a=list(                                                              # a-site       thread #
                             m=c("R1X1"),                                                 # monomer          1
                             d=c("R2X3","R2X4"),                                          # dimer            2
                             t=c("R4X5","R4X6","R4X7","R4X8"),                            # tetramer         3
                             h=c("R6X7","R6X8","R6X9","R6X10", "R6X11", "R6X12")          # hexamer          4
                     ),
                     h=list( ## tails of a-site threads are heads of h-site threads       # h-site
                             m=c("R1X2"),                                                 # monomer          5
                             d=c("R2X5", "R2X6"),                                         # dimer            6
                             t=c("R4X9", "R4X10","R4X11", "R4X12"),                       # tetramer         7
                             h=c("R6X13", "R6X14", "R6X15","R6X16", "R6X17", "R6X18")     # hexamer          8
                     )
             )
     )

     g <- mkg(topology,TCC=TRUE) 
     gridL <- mkGrids(g,maxnPs=2) 
     print(gridL$chunk)

     gridL <- mkGrids(g,maxnPs=4) 
     # the next line should be uncommented and run separately from those above since its output is large. 
     # print(gridL$chunk)

