Last data update: 2014.03.03

R: Simulate copy number data for a case-control study.
simulR Documentation

Simulate copy number data for a case-control study.

Description

Simulate copy number data for a case-control study.

Usage

simul(n, nbSNP, probCas, nbSeg, meanSegmentSize, prob, alpha = 15)

Arguments

n

Number of individuals.

nbSNP

Size of the DNA sequence.

probCas

Probability to be a case individual.

nbSeg

Number of causal segments.

meanSegmentSize

The mean size of anormal segment.

prob

A 2*2 matrix containing probabilities:

prob[1,1]=probability to have an anomaly to a SNP given the person does not have the disease and the SNP is causal.

prob[1,2]=probability to have an anomaly to a SNP given the person does not have the disease and the SNP is not causal.

prob[2,1]=probability to have an anomaly to a SNP given the person has the disease and the SNP is causal.

prob[2,2]=probability to have an anomaly to a SNP given the person has the disease and the SNP is not causal.

alpha

Parameter of the beta(alpha,alpha).

Value

a list containing:

data

A matrix of size n*nbSeg, containing values of the copy-number signal.

response

A vector of size n containing the cas/control status.

causalSNP

A vector of size nbSeg containing the center of causal segments.

Author(s)

Quentin Grimonprez, Serge Iovleff

Examples

data=simul(50,10000,0.4,10,150,matrix(c(0.1,0.8,0.001,0.001),nrow=2))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HDPenReg)
Loading required package: rtkore
Loading required package: Rcpp

Attaching package: 'rtkore'

The following object is masked from 'package:Rcpp':

    LdFlags

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HDPenReg/simul.Rd_%03d_medium.png", width=480, height=480)
> ### Name: simul
> ### Title: Simulate copy number data for a case-control study.
> ### Aliases: simul
> 
> ### ** Examples
> 
> data=simul(50,10000,0.4,10,150,matrix(c(0.1,0.8,0.001,0.001),nrow=2))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>