cftpStepGenerator: cftpStepGenerator

cftpStepGeneratorR Documentation

cftpStepGenerator

Description

an R6 class representing the steps for sampling a sequence of methylation states from the equilibrium (SSEi and SSEc considered, IWE neglected) using the CFTP algorithm for a given combiStructureGenerator instance.

It is stored in the private attribute CFTP_info of combiStructureGenerator instances when calling the combiStructureGenerator$cftp() method and can be retrieved with the combiStructureGenerator$get_CFTP_info()

Public fields

singleStr_number

Public attribute: Number of singleStr instances

singleStr_siteNumber

Public attribute: Number of sites in singleStr instances

CFTP_highest_rate

Public attribute: CFTP highest rate

number_steps

Public attribute: counter of steps alredy generated

CFTP_chosen_singleStr

Public attribute: list with vectors of equal size with chosen singleStr index at each CFTP step

CFTP_chosen_site

Public attribute: list with vectors of equal size with chosen site index at each CFTP step

CFTP_event

Public attribute: list with vectors of equal size with type of CFTP event at each CFTP step.

CFTP_random

Public attribute: list with vectors of equal size with CFTP threshold at each CFTP step

steps_perVector

Public attribute: size of vectors in lists CFTP_chosen_singleStr, CFTP_chosen_site, CFTP_event and CFTP_random

Methods

Public methods


Method new()

Create a new instance of class cftpStepGenerator with the info of the corresponding combiStrucutre instance

Usage
cftpStepGenerator$new(
  singleStr_number,
  singleStr_siteNumber,
  CFTP_highest_rate
)
Arguments
singleStr_number

Number of singleStr instances

singleStr_siteNumber

Number of sites in singleStr instances

CFTP_highest_rate

CFTP highest rate across all singleStr withing combiStr instance

Returns

A new instance of class cftpStepGenerator


Method generate_events()

1: SSEi to unmethylated, 2: SSEi to partially methylated, 3: SSEi to methylated 4: SSEc copy left state, 5: SSEc copy right state

Public Method. Generates the events to apply for CFTP.

Usage
cftpStepGenerator$generate_events(steps = 10000, testing = FALSE)
Arguments
steps

Integer value >=1

testing

default FALSE. TRUE for testing output

Details

The function add steps to the existing ones. If called several times the given steps need to be higher than the sum of steps generated before.

Returns

NULL when testing FALSE. Testing output when testing TRUE.


Method clone()

The objects of this class are cloneable with this method.

Usage
cftpStepGenerator$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


MethEvolSIM documentation built on April 12, 2025, 1:30 a.m.