mkSpurs {ccems}R Documentation

Make Spur Model Space

Description

This function takes g from mkg and maps it into a dataframe of spur graph model definitions.

Usage

mkSpurs(g,state=list(globMdlIndex=0,globCmbIndex=0,relCmbIndex=0,
         config=NULL), maxnKjPs=NULL, maxTotalPs=NULL,minTotalPs=NULL, 
         batchSize=500,doTights=FALSE,
         atLeastOne=TRUE,atLeastOneOfEach=FALSE,
         KIC=1,kIC=1,m1=-90,p=-1,forceM1=FALSE,forceP=FALSE) 

Arguments

g The generic model output list of mkg.
state The current state of model space generation. This is a list with several components. globMdlIndex is the global model space index. When mkSpurs is called within ems the globMdlIndex of the spurs begins where it ends for grids. globCmbIndex is the global spur model index. This index is used to trim the last batchSize, if needed, to avoid attempts to extend the spur space size beyond its upper limit of 2^g$nZ. relCmbIndex is the most critical component of the state. This is the column number of the current matrix output of combn, i.e. it is a relative index. The spur space chunk returned by mkSpurs begins just after this column. config is a vector of the integer positions in g$Z of the last model's finite K (i.e. the last model of the previous chunk). config is the relCmbIndexth column of the current combn matrix. Its length is the current number of K parameters in the model unless relCmbIndex=0, in which case the number of parameters is one more than this (in this case the end of the last batch coincides with the end of a combn matrix).
maxnKjPs The maximum number of Kj parameters of models in the model space. Full chunks are created and then trimmed, so descreases in the value of this option will not solve "out of memory" problems.
maxTotalPs This is the maximum number of freely estimated k or K parameters.
minTotalPs The minimum number of parameters of models in the model space. If NULL no minimum is imposed.
batchSize This is the number of K infinity models fitted per batch. Chunk sizes are bigger than this if doTights is TRUE and/or if pRows is TRUE, and/or if activity parameter constraints split models further. Values less than ~1000 are recommended for quad core 8 GB motherboards.
doTights This should be TRUE if infinitely tight binding models of single edge spur graphs are to be created.
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.
atLeastOneOfEach Set TRUE if only models with at least one complex of each oligomer size are to be considered. This is useful when the data are multivariate proportions (i.e. mass distribution data) and each j-mer is clearly present.
KIC The initial condition of all K parameters optimized. The default is IC=1 (in uM).
kIC The initial condition of all k parameters optimized. The default is kIC=1 (in 1/seconds per occupied active site).
m1 The hub protein's monomer mass in kDa. The default is 90 for the big (R1) subunit of ribonucleotide reductase (RNR). This only matters if the data is mass data. Negative numbers imply fixed values and positive numbers imply starting values to be fitted to the data.
p Probability that hub can oligomerize, i.e. is not damaged. Set to a positive value if additional rows are to be added to the output dataframe to include models with p freely estimated. Set negative to hold fixed. Value is the initial or fixed value.
forceM1 Set TRUE to force all models to estimate M1, i.e. to not generate models with M1 fixed.
forceP Set TRUE to force all models to estimate p, i.e. to not generate models with fixed p.

Details

This function is complicated by the fact that one readily runs out of memory with 29 complexes and thus roughly 500,000,000 spur models (in this case 8 GB RAM allows at most 16 bytes per model!). Thus, chunks of the spur model space must be created, fitted and summarized in sizes small enough to fit into memory. As both an input and an output, state links successive calls to this function. It keeps track of where we are in the spur graph model space and it allows searches through the low parameter number models without first defining all of the higher parameter number models (and thus consuming all of the RAM in the process).

Value

A list with components

chunk A dataframe where each row is a spur model.
state The state, defined in the same way as the input argument state since the output state of one call is the input state of the next call.
maxReached This is TRUE if the maximum number of parameter has been reached.
lastCompleted When all of the models with j K parameters have been specified, lastCompleted equals j. This is useful in ems when smart = TRUE as it defines how far into the model space the fitting process has gone so far in terms of numbers of model parameters.

Note

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

Author(s)

Tom Radivoyevitch (txr24@case.edu)

References

Radivoyevitch, T. (2008) Equilibrium model selection: dTTP induced R1 dimerization. BMC Systems Biology 2, 15.

See Also

mkGrids, ccems, combn

Examples

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) 
mkSpurs(g,p=0.95,doTights=TRUE)

[Package ccems version 1.03 Index]