Description Usage Arguments Details Value Author(s) References See Also Examples
Creates a logical vector indicating probes in annotated regions from information in a GFF formatted file.
1 | gff2index(gff, pos)
|
gff |
GFF file (see Details). |
pos |
A |
The GFF file can be provided in several ways. Either as data.frame
, as
a character string providing the name of a GFF file or as a connection
object
pointing to a GFF file.
A logical vector with one entry for each probe in pos
. TRUE
indicates probes that
are inside a region that is annotated in the provided GFF file.
Peter Humburg
GFF specification: http://www.sanger.ac.uk/Software/formats/GFF/GFF_Spec.shtml
region.position
and reg2gff
for the reverse operation.
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 | ## create two state HMM with t distributions
state.names <- c("one","two")
transition <- c(0.1, 0.02)
location <- c(1, 2)
scale <- c(1, 1)
df <- c(4, 6)
model <- getHMM(list(a=transition, mu=location, sigma=scale, nu=df),
state.names)
## obtain observation sequence from model
obs <- sampleSeq(model, 100)
## make up some genomic probe coordinates
pos <- data.frame(chromosome = rep("chr1", times = 100),
position = seq(1, 4000, length = 100))
## compute most likely state sequence for obs
vit.res <- viterbi(model, obs)
## find regions attributed to state "two"
reg.pos <- region.position(vit.res$stateSeq, region="two")
## calculate posterior probability for state "two"
post <- posterior(obs, model, log=FALSE)[1,]
## create gff annotations
gff <- reg2gff(reg.pos, post, pos)
## extract probe calls from gff annotation
probe.idx <- gff2index(gff, pos)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.