Browse code

Added the seqbias package to the repository.

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/seqbias@52013 bc3139a8-67e5-0310-9ffc-ced21a209358

Chao-Jen Wong authored on 22/01/2011 00:26:36
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+\name{random.intervals}
2
+\alias{random.intervals}
3
+\title{Generating random genomic intervals}
4
+\description{Given a vector of sequence lengths, generate genomic intervals uniformly at
5
+random}
6
+\usage{random.intervals(I, n=1, ms=10000)}
7
+\arguments{
8
+  \item{I}{a GRanges object giving intervals from which to sample from}
9
+  \item{n}{number of intervals to generate}
10
+  \item{ms}{length of the intervals to generate (may be a vector)}
11
+}
12
+\details{
13
+  The function is used to place intervals of fixed sizes at random (possibly
14
+  overlapping) positions across one or more sequences. The input should be a
15
+  \code{GRanges} objects giving the sequence intervals in which the random intervals
16
+  sholud be placed. If they are to be placed anywhere within a reference
17
+  sequence, use the \code{scanFaIndex} function from Rsamtools, to obtain a set
18
+  of intervals.
19
+}
20
+\value{
21
+  Returns a GRanges object giving the generated intervals.
22
+}
23
+\author{
24
+    Daniel Jones
25
+    \email{dcjones@cs.washington.edu}
26
+}
27
+\examples{
28
+  library(Rsamtools)
29
+  ref_fn <- system.file( "extra/example.fa", package = "seqbias" )
30
+  ref_f <- FaFile( ref_fn )
31
+  open.FaFile( ref_f )
32
+
33
+  ref_seqs <- scanFaIndex( ref_f )
34
+
35
+  I <- random.intervals( ref_seqs, n = 100, ms = 1000 )
36
+}
37
+