combiStructureGenerator | R Documentation |
an R6 class representing several genomic structures. Each genomic structure contained is an object of class singleStructureGenerator. Note that default clone(deep=TRUE) fails to clone singleStructureGenerator objects contained, use method $copy() instead.
testing_output
Public attribute: Testing output for initialize
new()
Create a new combiStructureGenerator object.
Note that this object can be generated within a treeMultiRegionSimulator object.
combiStructureGenerator$new(infoStr, params = NULL, testing = FALSE)
infoStr
A data frame containing columns 'n' for the number of sites, and 'globalState' for the favoured global methylation state. If initial equilibrium frequencies are given the dataframe must contain 3 additional columns: 'u_eqFreq', 'p_eqFreq' and 'm_eqFreq'
params
Default NULL. When given: data frame containing model parameters.
testing
Default FALSE. TRUE for writing in public field of new instance $testing_output
A new combiStructureGenerator
object.
get_singleStr()
Public method: Get one singleStructureGenerator object in $singleStr
combiStructureGenerator$get_singleStr(i)
i
index of the singleStructureGenerator object in $singleStr
the singleStructureGenerator object in $singleStr with index i
get_singleStr_number()
Public method: Get number of singleStructureGenerator objects in $singleStr
combiStructureGenerator$get_singleStr_number()
number of singleStructureGenerator object contained in $singleStr
get_singleStr_siteNumber()
Public method: Get number of sites in all singleStructureGenerator objects
combiStructureGenerator$get_singleStr_siteNumber()
number of sites in all singleStructureGenerator objects
get_island_number()
Public method: Get number of singleStructureGenerator objects in $singleStr with $globalState "U" (CpG islands)
combiStructureGenerator$get_island_number()
number of singleStructureGenerator in $singleStr objects with $globalState "U" (CpG islands)
get_island_index()
Public method: Get index of singleStructureGenerator objects in $singleStr with $globalState "U" (CpG islands)
combiStructureGenerator$get_island_index()
index of singleStructureGenerator objects in $singleStr with $globalState "U" (CpG islands)
set_IWE_events()
Public method: Set information of the IWE events sampled in a tree branch
combiStructureGenerator$set_IWE_events(a)
a
value to which IWE_events should be set
NULL
get_IWE_events()
Public method: Get information of the IWE events sampled in a tree branch
combiStructureGenerator$get_IWE_events()
information of the IWE events sampled in a tree branch
set_name()
Public method: Set the name of the leaf if evolutionary process (simulated from class treeMultiRegionSimulator) ends in a tree leaf.
combiStructureGenerator$set_name(a)
a
value to which name should be set
NULL
get_name()
Public method: Get the name of the leaf if evolutionary process (simulated from class treeMultiRegionSimulator) ended in a tree leaf.
combiStructureGenerator$get_name()
Name of the leaf if evolutionary process (simulated from class treeMultiRegionSimulator) ended in a tree leaf. For iner tree nodes return NULL
get_own_index()
Public method: Set own branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$get_own_index()
NULL
set_own_index()
Public method: Get own branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$set_own_index(i)
i
index of focal object
Own branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
get_parent_index()
Public method: Get parent branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$get_parent_index()
Parent branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
set_parent_index()
Public method: Set parent branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$set_parent_index(i)
i
set parent_index to this value
NULL
get_offspring_index()
Public method: Get offspring branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$get_offspring_index()
Offspring branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
set_offspring_index()
Public method: Set offspring branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$set_offspring_index(i)
i
set offspring_index to this value
NULL
add_offspring_index()
Public method: Add offspring branch index in the tree along which the evolutionary process is simulated (from class treeMultiRegionSimulator).
combiStructureGenerator$add_offspring_index(i)
i
index to be added
NULL
get_mu()
Public method.
combiStructureGenerator$get_mu()
Model parameter for the rate of the IWE evolutionary process (per island and branch length).
get_id()
Public method. Get the unique ID of the instance
combiStructureGenerator$get_id()
A numeric value representing the unique ID of the instance.
set_id()
Public method. Set the unique ID of the instance
combiStructureGenerator$set_id(id)
id
integer value to identificate the combiStructure instance
A numeric value representing the unique ID of the instance.
get_sharedCounter()
Public method. Get the counter value from the shared environment between instances of combiStructureGenerator class
combiStructureGenerator$get_sharedCounter()
Numeric counter value.
reset_sharedCounter()
Public method. Reset the counter value of the shared environment between instances of combiStructureGenerator class
combiStructureGenerator$reset_sharedCounter()
NULL
set_singleStr()
Public method: Clone each singleStructureGenerator object in $singleStr
combiStructureGenerator$set_singleStr(singStrList)
singStrList
object to be cloned
NULL
copy()
Public method: Clone combiStructureGenerator object and all singleStructureGenerator objects in it
combiStructureGenerator$copy()
cloned combiStructureGenerator object
branch_evol()
Simulate CpG dinucleotide methylation state evolution along a tree branch. The function samples the IWE events on the tree branch and simulates the evolution through the SSE and IWE processes.
combiStructureGenerator$branch_evol(branch_length, dt, testing = FALSE)
branch_length
Length of the branch.
dt
Length of SSE time steps.
testing
Default FALSE. TRUE for testing purposes.
It handles both cases where IWE events are sampled or not sampled within the branch.
Default NULL. If testing = TRUE it returns information for testing purposes.
get_highest_rate()
Public Method. Gets the highest rate among all singleStructureGenerator objects for CFTP.
combiStructureGenerator$get_highest_rate()
Highest rate value.
set_CFTP_info()
Public Method. Sets a cftpStepGenerator instance asthe CFTP info.
combiStructureGenerator$set_CFTP_info(CFTP_instance)
CFTP_instance
CFTP info.
NULL
get_CFTP_info()
Public Method. Gets the CFTP info.
combiStructureGenerator$get_CFTP_info()
CFTP info.
cftp_apply_events()
Public Method. Applies the CFTP events.
combiStructureGenerator$cftp_apply_events(testing = FALSE)
testing
default FALSE. TRUE for testing output
NULL when testing FALSE. Testing output when testing TRUE.
cftp()
Public Method. Applies the CFTP algorithm to evolve a structure and checks for convergence by comparing methylation states.
This method generates CFTP steps until the methylation sequences of the current structure and a cloned structure become identical across all singleStr instances or a step limit is reached. If the step limit is exceeded, an approximation method is applied to finalize the sequence.
combiStructureGenerator$cftp( steps = 10000, step_limit = 327680000, testing = FALSE )
steps
minimum number of steps to apply (default 10000).
step_limit
maximum number of steps before applying an approximation method (default 327680000 corresponding to size of CFTP info of approx 6.1 GB). If this limit is reached, the algorithm stops and an approximation is applied.
testing
logical. If TRUE, returns additional testing output including the current structure, the cloned structure, the counter value, total steps, and the chosen site for the CFTP events. Default is FALSE.
NULL when testing is FALSE. If testing is TRUE, returns a list with:
self
: the current object after applying the CFTP algorithm.
combi_m
: a deep cloned object with applied CFTP events.
counter
: the number of iterations performed.
total_steps
: the number of steps applied by the CFTP algorithm.
CFTP_chosen_site
: the site selected during the CFTP event application.
clone()
The objects of this class are cloneable with this method.
combiStructureGenerator$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.