Description Usage Format Details Examples
Annotation data for fake.f2expr expression traits denoting position on the genome.
1 |
A data.frame with a column for chromosome (chr, as factor), and position (pos, as numeric)
There are 1000 simulated positions, one corresponding to each expression trait
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ## Not run:
library(qtl)
# random seed
set.seed(5297830)
# load map
data(map10)
# drop X chr
map10 <- map10[-20]
# chromosome lengths
L <- summary(map10)[1:19,"length"]
names(L) <- as.character(1:19)
# simulate genes in different positions
n.genes <- 1000
chr <- factor(sample(names(L), n.genes, prob=L/sum(L), repl=TRUE), levels=1:19)
pos <- runif(n.genes, 0, L[chr])
genenam <- paste("gene", 1:n.genes, sep="")
genes <- data.frame(chr=chr, pos=pos)
rownames(genes) <- genenam
# which ones have cis?
cis <- sample(c(FALSE,TRUE), n.genes, prob=c(9,1), repl=TRUE)
# trans eqtl on chr 1 at 50 cM
trans <- sample(c(FALSE,TRUE), n.genes, prob=c(8,2), repl=TRUE)
trans[cis] <- FALSE # make cis ones be not trans
# cis effects
cis.eff <- runif(n.genes, 0.2, 4.9)
cis.eff[!cis] <- 0
# trans effects
trans.eff <- runif(n.genes, 0.2, 0.9)
trans.eff[!trans] <- 0
# simulate annotation
fake.annot <- data.frame(chr=factor(sample(names(L),
n.genes, prob=L/sum(L), repl=TRUE), levels=1:19),
pos=runif(n.genes, 0, L[chr]),row.names=genenam)
fake.annot[cis,"chr"] <- genes[cis,"chr"]
fake.annot[cis,"pos"] <-
apply(cbind(genes[cis,"pos"]+runif(sum(cis),min=-2.5,max=2.5),
L[genes[cis,"chr"]]),1,function(x) max(0,min(x)))
#save(fake.annot,file="neqtl/data/fake.annot.RData")
## End(Not run)
data(fake.annot)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.