~ubuntu-branches/ubuntu/wily/r-bioc-genomicranges/wily-proposed

« back to all changes in this revision

Viewing changes to man/intra-range-methods.Rd

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2014-06-13 15:04:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140613150419-v49mxnlg42rnuks5
Tags: 1.16.3-1
* New upstream version
* New (Build-)Depends: r-bioc-genomeinfodb
* cme fix dpkg-control
* add autopkgtest

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
\alias{intra-range-methods}
4
4
 
 
5
\alias{shift}
5
6
\alias{shift,GenomicRanges-method}
 
7
\alias{shift,GRangesList-method}
 
8
 
 
9
\alias{narrow}
6
10
\alias{narrow,GenomicRanges-method}
7
 
\alias{narrow,GAlignments-method}
8
 
\alias{narrow,GAlignmentsList-method}
 
11
 
 
12
\alias{flank}
9
13
\alias{flank,GenomicRanges-method}
 
14
\alias{flank,GRangesList-method}
 
15
 
 
16
\alias{promoters}
10
17
\alias{promoters,GenomicRanges-method}
 
18
\alias{promoters,GRangesList-method}
 
19
 
 
20
\alias{resize}
11
21
\alias{resize,GenomicRanges-method}
12
 
\alias{Ops,GenomicRanges,numeric-method}
 
22
 
 
23
\alias{restrict}
13
24
\alias{restrict,GenomicRanges-method}
 
25
\alias{restrict,GRangesList-method}
 
26
 
 
27
\alias{trim}
14
28
\alias{trim,GenomicRanges-method}
15
29
 
16
 
 
17
 
\title{Intra range transformations of a GenomicRanges object}
 
30
\alias{Ops,GenomicRanges,numeric-method}
 
31
 
 
32
 
 
33
\title{Intra range transformations of a GRanges or GRangesList object}
18
34
 
19
35
\description{
20
 
  See \code{?`\link[IRanges]{intra-range-methods}`} and
21
 
  \code{?`\link[IRanges]{inter-range-methods}`} in the IRanges package
22
 
  for a quick introduction to intra range and inter range transformations.
23
 
 
24
36
  This man page documents intra range transformations of a
25
37
  \link{GenomicRanges} object (i.e. of an object that belongs to the
26
38
  \link{GenomicRanges} class or one of its subclasses, this includes
27
 
  for example \link{GRanges} objects). 
 
39
  for example \link{GRanges} objects), or a \link{GRangesList} object.
 
40
 
 
41
  See \code{?`\link[IRanges]{intra-range-methods}`} and
 
42
  \code{?`\link[IRanges]{inter-range-methods}`} in the \pkg{IRanges}
 
43
  package for a quick introduction to intra range and inter range
 
44
  transformations.
 
45
 
 
46
  Intra range methods for \link[GenomicAlignments]{GAlignments} and
 
47
  \link[GenomicAlignments]{GAlignmentsList} objects are defined and
 
48
  documented in the \pkg{GenomicAlignments} package.
28
49
 
29
50
  See \code{?`\link[GenomicRanges]{inter-range-methods}`} for
30
 
  inter range transformations of a GenomicRanges object.
 
51
  inter range transformations of a \link{GenomicRanges} or
 
52
  \link{GRangesList} object.
31
53
}
32
54
 
33
55
\usage{
34
56
\S4method{shift}{GenomicRanges}(x, shift=0L, use.names=TRUE)
 
57
\S4method{shift}{GRangesList}(x, shift=0L, use.names=TRUE)
35
58
 
36
59
\S4method{narrow}{GenomicRanges}(x, start=NA, end=NA, width=NA, use.names=TRUE)
37
 
\S4method{narrow}{GAlignments}(x, start=NA, end=NA, width=NA, use.names=TRUE)
38
 
\S4method{narrow}{GAlignmentsList}(x, start=NA, end=NA, width=NA, use.names=TRUE)
39
60
 
40
61
\S4method{flank}{GenomicRanges}(x, width, start=TRUE, both=FALSE,
41
 
        use.names=TRUE, ignore.strand=FALSE)
 
62
      use.names=TRUE, ignore.strand=FALSE)
 
63
\S4method{flank}{GRangesList}(x, width, start=TRUE, both=FALSE,
 
64
      use.names=TRUE, ignore.strand=FALSE)
42
65
 
43
66
\S4method{promoters}{GenomicRanges}(x, upstream=2000, downstream=200, ...)
 
67
\S4method{promoters}{GRangesList}(x, upstream=2000, downstream=200, ...)
44
68
 
45
69
\S4method{resize}{GenomicRanges}(x, width, fix="start", use.names=TRUE,
46
 
        ignore.strand=FALSE)
 
70
       ignore.strand=FALSE)
47
71
 
48
72
\S4method{restrict}{GenomicRanges}(x, start=NA, end=NA, keep.all.ranges=FALSE,
49
 
        use.names=TRUE)
 
73
         use.names=TRUE)
 
74
\S4method{restrict}{GRangesList}(x, start=NA, end=NA, keep.all.ranges=FALSE,
 
75
         use.names=TRUE)
50
76
 
51
77
\S4method{trim}{GenomicRanges}(x, use.names=TRUE)
52
78
}
53
79
 
54
80
\arguments{
55
 
  \item{x}{A \link{GenomicRanges} object.}
 
81
  \item{x}{A \link{GenomicRanges} or \link{GRangesList} object.}
56
82
  \item{shift, use.names, start, end, width, both, fix, keep.all.ranges,
57
83
        upstream, downstream}{
58
84
    See \code{?`\link[IRanges]{intra-range-methods}`}.
72
98
      \link[IRanges]{Ranges} objects. See 
73
99
      \code{?`\link[IRanges]{intra-range-methods}`} for the details.
74
100
    }
75
 
    \item(){\code{narrow} on GenomicRanges objects behaves like the 
76
 
      \code{narrow} method for \link[IRanges]{Ranges} objects. See 
 
101
    \item(){\code{narrow} on a \link{GenomicRanges} object behaves
 
102
      like on a \link[IRanges]{Ranges} object. See 
77
103
      \code{?`\link[IRanges]{intra-range-methods}`} for the details.
78
104
 
79
 
      When \code{x} is a \link{GAlignments} object, \code{narrow(x)} 
80
 
      returns a new \link{GAlignments} object of the length of \code{x}
81
 
      describing the narrowed alignments. Unlike with \code{qnarrow}
82
 
      now the \code{start}/\code{end}/\code{width} arguments describe
83
 
      the narrowing on the reference side, not the query side.
84
 
      Like with \code{qnarrow}, they must be vectors of integers.
85
 
      NAs and negative values are accepted and "solved" according to the
86
 
      rules of the SEW (Start/End/Width) interface (see
87
 
      \code{?\link[IRanges]{solveUserSEW}} for the details).
 
105
      A major difference though is that it returns a \link{GenomicRanges}
 
106
      object instead of a \link[IRanges]{Ranges} object.
 
107
      The returned object is \emph{parallel} (i.e. same length and names)
 
108
      to the original object \code{x}.
88
109
    }
89
110
    \item{}{\code{flank} returns an object of the same type and length 
90
111
      as \code{x} containing intervals of width \code{width} that flank 
146
167
 
147
168
\seealso{
148
169
  \itemize{
149
 
    \item The \link{GenomicRanges} and \link{GRanges} classes.
150
 
    \item The \link[IRanges]{Ranges} class in the IRanges package.
 
170
    \item \link{GenomicRanges}, \link{GRanges}, and \link{GRangesList} objects.
151
171
    \item The \link[IRanges]{intra-range-methods} man page in the
152
 
          IRanges package.
 
172
          \pkg{IRanges} package.
 
173
    \item The \link[IRanges]{Ranges} class in the \pkg{IRanges} package.
153
174
  }
154
175
}
155
176
 
156
177
\examples{
 
178
## ---------------------------------------------------------------------
 
179
## A. ON A GRanges OBJECT
 
180
## ---------------------------------------------------------------------
157
181
gr <- GRanges(
158
182
        seqnames=Rle(paste("chr", c(1, 2, 1, 3), sep=""), c(1, 3, 2, 4)),
159
183
        ranges=IRanges(1:10, width=10:1, names=letters[1:10]),
171
195
 
172
196
gr <- GRanges("chr1", IRanges(rep(10, 3), width=6), c("+", "-", "*"))
173
197
promoters(gr, 2, 2)
 
198
 
 
199
## ---------------------------------------------------------------------
 
200
## B. ON A GRangesList OBJECT
 
201
## ---------------------------------------------------------------------
 
202
gr1 <- GRanges("chr2", IRanges(3, 6))
 
203
gr2 <- GRanges(c("chr1", "chr1"), IRanges(c(7,13), width=3),
 
204
               strand=c("+", "-"))
 
205
gr3 <- GRanges(c("chr1", "chr2"), IRanges(c(1, 4), c(3, 9)),
 
206
               strand="-")
 
207
grl <- GRangesList(gr1= gr1, gr2=gr2, gr3=gr3)
 
208
grl
 
209
 
 
210
flank(grl, width =20)
 
211
 
 
212
restrict(grl, start=3)
174
213
}
175
 
 
 
214
 
 
215
\keyword{methods}
176
216
\keyword{utilities}