t1_simulation: Simulate ORFs and Expression Data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

These utility functions generate data for simulation studies including fake ORFs and expression values.

Usage

1
2
3
4
  simu.orf(n, b.Init, phi.Obs = NULL, AA.prob = NULL, orf.length = NULL,
           orf.names = NULL, model = .CF.CT$model)
  simu.phi.Obs(Phi, sigmaW.lim = 1, bias.Phi = 0)
  simu.mixnormerr(n, param)

Arguments

n

number of ORFs or sequences.

b.Init

parameters of mutation and selection of format b.

phi.Obs

an object of format phi.Obs.

AA.prob

proportion of amino acids.

orf.length

lengths of ORFs.

orf.names

names of ORFs.

model

model to be simulated.

Phi

expression values (potentially true expression).

sigmaW.lim

std of measurement errors (between Phi and phi.Obs).

bias.Phi

bias (in log scale) for observed phi.

param

as in dmixnormerr()

Details

simu.orf() generates ORFs or sequences based on the b.Init and phi.Obs.

If phi.Obs is omitted, then standard log normal random variables are instead).

If AA.prob is omitted, then uniform proportion is assigned.

If orf.length is omitted, then 10 to 20 codons are randomly assigned.

If orf.names is omitted, then "ORF1" to "ORFn" are assigned.

simu.phi.Obs() generates phi.Obs by adding normal random errors to Phi, and errors have mean 0 and standard deviation sigmaW.lim.

simu.mixnormerr() generates Phi according to the param, and adds normal random errors to Phi.

Value

simu.orf() returns a list of format seq.data.

simu.phi.Obs() returns a vector of format phi.Obs.

simu.mixnormerr() returns a list contains three vectors of length n: one for expected gene expression Phi, one for observed gene expression phi.Obs, and one for the component id id.K.

Author(s)

Wei-Chen Chen wccsnow@gmail.com.

References

https://github.com/snoweye/cubfits/

See Also

read.seq(), read.phi.df(), write.seq(), write.phi.df(), and mixnormerr.optim().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
suppressMessages(library(cubfits, quietly = TRUE))
set.seed(1234)

# Generate sequences.
da.roc <- simu.orf(length(ex.train$phi.Obs), b.Init$roc,
                   phi.Obs = ex.train$phi.Obs, model = "roc")
names(da.roc) <- names(ex.train$phi.Obs)
write.fasta(da.roc, names(da.roc), "toy_roc.fasta")

## End(Not run)

snoweye/cubfits documentation built on Nov. 9, 2021, 3:39 a.m.