simulate.library          package:sagenhaft          R Documentation

_S_i_m_u_l_a_t_e _S_A_G_E _l_i_b_r_a_r_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Function to simulate SAGE libraries with sequencing errors.

_U_s_a_g_e:

     simulate.library(taglength = 4, lambda = 1000, mean.error = 0.01,
                      error.sd = 1, withintagerror.sd = 0.2,
                      ngenes = min(4^taglength, 1e+05), base.lib = NULL,
                      libseed = -1, ...)

_A_r_g_u_m_e_n_t_s:

taglength: Tag length for library. 

  lambda: Aproximate size of library. 

mean.error: Mean amount of sequencing errors. 

error.sd: Standard deviation for sequencing errors. 

withintagerror.sd: Standard deviation for sequencing errors within
          tags. 

  ngenes: Number of genes to generate tags from. 

base.lib: Simulate library based on tags in other lib and create
          variations. 

 libseed: Seed for random number generator. 

     ...: Arguments passed to em.estimate. 

_D_e_t_a_i_l_s:

     We set the number of possible transcripts and assign a random SAGE
     tag to each of them out of all 4\^taglength possible SAGE tags.
     For each SAGE tag a random proportion p within the library is
     generated from a log-normal distribution, and the proportions are
     then adjusted to have a sum of 1. The true counts of a tag are
     simulated by sampling from Poisson distributions with parameters p
     lambda, where p is the proportion of the tag in the library and
     lambda is a parameter for setting the size of the library. The
     simulation of the sequencing errors is done on each individual
     occurrence of a tag sequence. For each tag sequence a mean
     sequencing quality value is generated from a log-normal
     distribution. The individual quality values for each base are then
     generated from log-normal distributions with means equal to the
     simulated sequencing quality values for the tag sequences. We have
     noticed that with experimentally generated data the within tag
     sequence variation of sequencing quality values is usually about
     1/5 of the between tag sequence variation. From each true tag
     sequence one observed tag sequence is generated using the
     simulated quality values of the true sequence as the multinomial
     probabilities, i.e. replacing each base with either one of the 3
     other bases with the probability specified by the sequencing
     quality value of that base. The counts of these generated tags are
     then summed to represent the observed tags. When generating
     several simulated libraries for comparisons, we use the same
     proportions of the genes for all libraries, replacing up to 1/3 of
     the proportions by proportions with a known differential factor.

_A_u_t_h_o_r(_s):

     Tim Beissbarth

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://tagcalling.mbgproject.org>

_S_e_e _A_l_s_o:

     'sage.library', 'error.correction'

_E_x_a_m_p_l_e_s:

     library(sagenhaft)
     testlib1 <- simulate.library(taglength=10, lambda=10000,
                                  mean.error=0.01)
     testlib2 <- simulate.library(taglength=10, lambda=20000,
                                  mean.error=0.02, base.lib=testlib1)
     testlib3 <- simulate.library(taglength=10, lambda=10000,
                                  mean.error=0.01, libseed=testlib1$seed)

