Browse code

Add terminators() method, same as promoters() but for terminator regions

Hervé Pagès authored on 22/01/2024 23:49:52
Showing 1 changed files
... ...
@@ -15,7 +15,9 @@
15 15
 \alias{flank,RangedSummarizedExperiment-method}
16 16
 
17 17
 \alias{promoters}
18
+\alias{terminators}
18 19
 \alias{promoters,RangedSummarizedExperiment-method}
20
+\alias{terminators,RangedSummarizedExperiment-method}
19 21
 
20 22
 \alias{restrict}
21 23
 \alias{restrict,RangedSummarizedExperiment-method}
... ...
@@ -42,6 +44,7 @@
42 44
       use.names=TRUE, ignore.strand=FALSE)
43 45
 
44 46
 \S4method{promoters}{RangedSummarizedExperiment}(x, upstream=2000, downstream=200)
47
+\S4method{terminators}{RangedSummarizedExperiment}(x, upstream=2000, downstream=200)
45 48
 
46 49
 \S4method{restrict}{RangedSummarizedExperiment}(x, start=NA, end=NA, keep.all.ranges=FALSE,
47 50
          use.names=TRUE)
... ...
@@ -53,21 +56,10 @@
53 56
   \item{x}{
54 57
     A \link{RangedSummarizedExperiment} object.
55 58
   }
56
-  \item{shift, use.names}{
57
-    See \code{?\link{shift}} in the \pkg{IRanges}
58
-    package.
59
-  }
60
-  \item{start, end, width, fix}{
61
-    See \code{?\link{shift}} in the \pkg{IRanges} package.
62
-  }
63
-  \item{ignore.strand, both}{
64
-    See \code{?\link{shift}} in the \pkg{IRanges} package.
65
-  }
66
-  \item{upstream, downstream}{
67
-    See \code{?\link{shift}} in the \pkg{IRanges} package.
68
-  }
69
-  \item{keep.all.ranges}{
70
-    See \code{?\link{shift}} in the \pkg{IRanges} package.
59
+  \item{shift, use.names, start, end, width, fix, ignore.strand, both,
60
+        upstream, downstream, keep.all.ranges}{
61
+    See \code{?GenomicRanges::\link[GenomicRanges]{shift}} in the
62
+    \pkg{GenomicRanges} package.
71 63
   }
72 64
 }
73 65
 
... ...
@@ -84,9 +76,10 @@
84 76
   where \code{f} is the name of the function and \code{...} any additional
85 77
   arguments passed to it.
86 78
 
87
-  See \code{?\link{shift}} in the \pkg{IRanges}
88
-  package for the details of how these transformations operate on a
89
-  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
79
+  See \code{?GenomicRanges::\link[GenomicRanges]{shift}} in the
80
+  \pkg{GenomicRanges} package for the details of how these transformations
81
+  operate on a \link[GenomicRanges]{GenomicRanges} or
82
+  \link[GenomicRanges]{GRangesList}
90 83
   object.
91 84
 }
92 85
 
... ...
@@ -94,8 +87,8 @@
94 87
   \itemize{
95 88
     \item \link{RangedSummarizedExperiment} objects.
96 89
 
97
-    \item The \link{shift} man page in the
98
-          \pkg{IRanges} package where \emph{intra range transformations}
90
+    \item The \code{\link[GenomicRanges]{shift}} man page in the
91
+          \pkg{GenomicRanges} package where \emph{intra range transformations}
99 92
           of a \link[GenomicRanges]{GenomicRanges} or
100 93
           \link[GenomicRanges]{GRangesList} object are documented.
101 94
   }
... ...
@@ -136,9 +129,21 @@ stopifnot(identical(
136 129
   flank(rowRanges(rse0), width=20)
137 130
 ))
138 131
 
139
-se5 <- restrict(rse0, start=200, end=700, keep.all.ranges=TRUE)
132
+se5 <- promoters(rse0, upstream=85, downstream=50)
140 133
 stopifnot(identical(
141 134
   rowRanges(se5),
135
+  promoters(rowRanges(rse0), upstream=85, downstream=50)
136
+))
137
+
138
+se6 <- terminators(rse0, upstream=85, downstream=50)
139
+stopifnot(identical(
140
+  rowRanges(se6),
141
+  terminators(rowRanges(rse0), upstream=85, downstream=50)
142
+))
143
+
144
+se7 <- restrict(rse0, start=200, end=700, keep.all.ranges=TRUE)
145
+stopifnot(identical(
146
+  rowRanges(se7),
142 147
   restrict(rowRanges(rse0), start=200, end=700, keep.all.ranges=TRUE)
143 148
 ))
144 149
 }
Browse code

shift() documentation is not in GenomicRanges:shift

Martin Morgan authored on 04/06/2018 15:33:37
Showing 1 changed files
... ...
@@ -54,24 +54,20 @@
54 54
     A \link{RangedSummarizedExperiment} object.
55 55
   }
56 56
   \item{shift, use.names}{
57
-    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
57
+    See \code{?\link{shift}} in the \pkg{IRanges}
58 58
     package.
59 59
   }
60 60
   \item{start, end, width, fix}{
61
-    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
62
-    package.
61
+    See \code{?\link{shift}} in the \pkg{IRanges} package.
63 62
   }
64 63
   \item{ignore.strand, both}{
65
-    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
66
-    package.
64
+    See \code{?\link{shift}} in the \pkg{IRanges} package.
67 65
   }
68 66
   \item{upstream, downstream}{
69
-    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
70
-    package.
67
+    See \code{?\link{shift}} in the \pkg{IRanges} package.
71 68
   }
72 69
   \item{keep.all.ranges}{
73
-    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
74
-    package.
70
+    See \code{?\link{shift}} in the \pkg{IRanges} package.
75 71
   }
76 72
 }
77 73
 
... ...
@@ -88,7 +84,7 @@
88 84
   where \code{f} is the name of the function and \code{...} any additional
89 85
   arguments passed to it.
90 86
 
91
-  See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
87
+  See \code{?\link{shift}} in the \pkg{IRanges}
92 88
   package for the details of how these transformations operate on a
93 89
   \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
94 90
   object.
... ...
@@ -98,8 +94,8 @@
98 94
   \itemize{
99 95
     \item \link{RangedSummarizedExperiment} objects.
100 96
 
101
-    \item The \link[GenomicRanges]{shift} man page in the
102
-          \pkg{GenomicRanges} package where \emph{intra range transformations}
97
+    \item The \link{shift} man page in the
98
+          \pkg{IRanges} package where \emph{intra range transformations}
103 99
           of a \link[GenomicRanges]{GenomicRanges} or
104 100
           \link[GenomicRanges]{GRangesList} object are documented.
105 101
   }
Browse code

Add 'rowData' argument to SummarizedExperiment() constructor. This allows the user to supply the row data at construction time.

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

Herve Pages authored on 07/12/2015 23:48:18
Showing 1 changed files
... ...
@@ -113,37 +113,37 @@ rowRanges <- GRanges(rep(c("chr1", "chr2"), c(5, 15)),
113 113
                      strand=Rle(c("+", "-"), c(12, 8)))
114 114
 colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
115 115
                      row.names=LETTERS[1:6])
116
-se0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
117
-                            rowRanges=rowRanges, colData=colData)
116
+rse0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
117
+                             rowRanges=rowRanges, colData=colData)
118 118
 
119
-se1 <- shift(se0, 1)
119
+rse1 <- shift(rse0, 1)
120 120
 stopifnot(identical(
121
-  rowRanges(se1),
122
-  shift(rowRanges(se0), 1)
121
+  rowRanges(rse1),
122
+  shift(rowRanges(rse0), 1)
123 123
 ))
124 124
 
125
-se2 <- narrow(se0, start=10, end=-15)
125
+se2 <- narrow(rse0, start=10, end=-15)
126 126
 stopifnot(identical(
127 127
   rowRanges(se2),
128
-  narrow(rowRanges(se0), start=10, end=-15)
128
+  narrow(rowRanges(rse0), start=10, end=-15)
129 129
 ))
130 130
 
131
-se3 <- resize(se0, width=75)
131
+se3 <- resize(rse0, width=75)
132 132
 stopifnot(identical(
133 133
   rowRanges(se3),
134
-  resize(rowRanges(se0), width=75)
134
+  resize(rowRanges(rse0), width=75)
135 135
 ))
136 136
 
137
-se4 <- flank(se0, width=20)
137
+se4 <- flank(rse0, width=20)
138 138
 stopifnot(identical(
139 139
   rowRanges(se4),
140
-  flank(rowRanges(se0), width=20)
140
+  flank(rowRanges(rse0), width=20)
141 141
 ))
142 142
 
143
-se5 <- restrict(se0, start=200, end=700, keep.all.ranges=TRUE)
143
+se5 <- restrict(rse0, start=200, end=700, keep.all.ranges=TRUE)
144 144
 stopifnot(identical(
145 145
   rowRanges(se5),
146
-  restrict(rowRanges(se0), start=200, end=700, keep.all.ranges=TRUE)
146
+  restrict(rowRanges(rse0), start=200, end=700, keep.all.ranges=TRUE)
147 147
 ))
148 148
 }
149 149
 
Browse code

some minor edits

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

Herve Pages authored on 15/05/2015 08:11:29
Showing 1 changed files
... ...
@@ -26,16 +26,8 @@
26 26
 \title{Intra range transformations of a RangedSummarizedExperiment object}
27 27
 
28 28
 \description{
29
-  This man page documents \emph{intra range transformations} of a
30
-  \link{RangedSummarizedExperiment} object. These transformations
31
-  operate on the \code{rowRanges} component of the object, which can be a
32
-  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
33
-  object.
34
-
35
-  See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
36
-  package for the details of how these transformations operate on a
37
-  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
38
-  object.
29
+  This man page documents the \emph{intra range transformations} that are
30
+  supported on \link{RangedSummarizedExperiment} objects.
39 31
 }
40 32
 
41 33
 \usage{
... ...
@@ -84,12 +76,22 @@
84 76
 }
85 77
 
86 78
 \details{
87
-  Any of these functions performs the following transformation on
88
-  \link{RangedSummarizedExperiment} object \code{x}:
89
-\preformatted{rowRanges(x) <- f(rowRanges(x), ...)
79
+  These transformations operate on the \code{rowRanges} component of the
80
+  \link{RangedSummarizedExperiment} object, which can be a
81
+  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
82
+  object.
83
+
84
+  More precisely, any of the above functions performs the following
85
+  transformation on \link{RangedSummarizedExperiment} object \code{x}:
86
+\preformatted{    rowRanges(x) <- f(rowRanges(x), ...)
90 87
 }
91 88
   where \code{f} is the name of the function and \code{...} any additional
92 89
   arguments passed to it.
90
+
91
+  See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
92
+  package for the details of how these transformations operate on a
93
+  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
94
+  object.
93 95
 }
94 96
 
95 97
 \seealso{
Browse code

Add man page for the findOverlaps family of methods for RangedSummarizedExperiment objects.

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

Herve Pages authored on 15/05/2015 01:00:53
Showing 1 changed files
... ...
@@ -28,12 +28,14 @@
28 28
 \description{
29 29
   This man page documents \emph{intra range transformations} of a
30 30
   \link{RangedSummarizedExperiment} object. These transformations
31
-  operate on the \code{rowRanges} component of the object.
31
+  operate on the \code{rowRanges} component of the object, which can be a
32
+  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
33
+  object.
32 34
 
33
-  See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
34
-  \pkg{GenomicRanges} package for intra range transformations of a
35
+  See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
36
+  package for the details of how these transformations operate on a
35 37
   \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
36
-  object, which the transformations described below are based on.
38
+  object.
37 39
 }
38 40
 
39 41
 \usage{
... ...
@@ -60,24 +62,24 @@
60 62
     A \link{RangedSummarizedExperiment} object.
61 63
   }
62 64
   \item{shift, use.names}{
63
-    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
64
-    \pkg{GenomicRanges} package.
65
+    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
66
+    package.
65 67
   }
66 68
   \item{start, end, width, fix}{
67
-    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
68
-    \pkg{GenomicRanges} package.
69
+    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
70
+    package.
69 71
   }
70 72
   \item{ignore.strand, both}{
71
-    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
72
-    \pkg{GenomicRanges} package.
73
+    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
74
+    package.
73 75
   }
74 76
   \item{upstream, downstream}{
75
-    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
76
-    \pkg{GenomicRanges} package.
77
+    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
78
+    package.
77 79
   }
78 80
   \item{keep.all.ranges}{
79
-    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
80
-    \pkg{GenomicRanges} package.
81
+    See \code{?\link[GenomicRanges]{shift}} in the \pkg{GenomicRanges}
82
+    package.
81 83
   }
82 84
 }
83 85
 
... ...
@@ -90,16 +92,14 @@
90 92
   arguments passed to it.
91 93
 }
92 94
 
93
-\value{
94
-  See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
95
-  \pkg{GenomicRanges} package.
96
-}
97
-
98 95
 \seealso{
99 96
   \itemize{
100 97
     \item \link{RangedSummarizedExperiment} objects.
101
-    \item The \link[GenomicRanges]{intra-range-methods} man page in the
102
-          \pkg{GenomicRanges} package.
98
+
99
+    \item The \link[GenomicRanges]{shift} man page in the
100
+          \pkg{GenomicRanges} package where \emph{intra range transformations}
101
+          of a \link[GenomicRanges]{GenomicRanges} or
102
+          \link[GenomicRanges]{GRangesList} object are documented.
103 103
   }
104 104
 }
105 105
 
Browse code

add man page for "coverage" method

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

Herve Pages authored on 14/05/2015 23:27:33
Showing 1 changed files
... ...
@@ -90,6 +90,11 @@
90 90
   arguments passed to it.
91 91
 }
92 92
 
93
+\value{
94
+  See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
95
+  \pkg{GenomicRanges} package.
96
+}
97
+
93 98
 \seealso{
94 99
   \itemize{
95 100
     \item \link{RangedSummarizedExperiment} objects.
Browse code

add man page for inter range methods

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

Herve Pages authored on 14/05/2015 23:11:21
Showing 1 changed files
... ...
@@ -87,7 +87,7 @@
87 87
 \preformatted{rowRanges(x) <- f(rowRanges(x), ...)
88 88
 }
89 89
   where \code{f} is the name of the function and \code{...} any additional
90
-  arguments passed to the function.
90
+  arguments passed to it.
91 91
 }
92 92
 
93 93
 \seealso{
Browse code

Add the following methods for RangedSummarizedExperiment objects: (a) intra range transformations, (b) coverage, (c) findOverlaps & family, (d) nearest & family. No man page yet for (b), (c), and (d) (will come soon).

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

Herve Pages authored on 08/05/2015 08:05:05
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,144 @@
1
+\name{intra-range-methods}
2
+
3
+\alias{intra-range-methods}
4
+
5
+\alias{shift}
6
+\alias{shift,RangedSummarizedExperiment-method}
7
+
8
+\alias{narrow}
9
+\alias{narrow,RangedSummarizedExperiment-method}
10
+
11
+\alias{resize}
12
+\alias{resize,RangedSummarizedExperiment-method}
13
+
14
+\alias{flank}
15
+\alias{flank,RangedSummarizedExperiment-method}
16
+
17
+\alias{promoters}
18
+\alias{promoters,RangedSummarizedExperiment-method}
19
+
20
+\alias{restrict}
21
+\alias{restrict,RangedSummarizedExperiment-method}
22
+
23
+\alias{trim,RangedSummarizedExperiment-method}
24
+
25
+
26
+\title{Intra range transformations of a RangedSummarizedExperiment object}
27
+
28
+\description{
29
+  This man page documents \emph{intra range transformations} of a
30
+  \link{RangedSummarizedExperiment} object. These transformations
31
+  operate on the \code{rowRanges} component of the object.
32
+
33
+  See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
34
+  \pkg{GenomicRanges} package for intra range transformations of a
35
+  \link[GenomicRanges]{GenomicRanges} or \link[GenomicRanges]{GRangesList}
36
+  object, which the transformations described below are based on.
37
+}
38
+
39
+\usage{
40
+\S4method{shift}{RangedSummarizedExperiment}(x, shift=0L, use.names=TRUE)
41
+
42
+\S4method{narrow}{RangedSummarizedExperiment}(x, start=NA, end=NA, width=NA, use.names=TRUE)
43
+
44
+\S4method{resize}{RangedSummarizedExperiment}(x, width, fix="start", use.names=TRUE,
45
+       ignore.strand=FALSE)
46
+
47
+\S4method{flank}{RangedSummarizedExperiment}(x, width, start=TRUE, both=FALSE,
48
+      use.names=TRUE, ignore.strand=FALSE)
49
+
50
+\S4method{promoters}{RangedSummarizedExperiment}(x, upstream=2000, downstream=200)
51
+
52
+\S4method{restrict}{RangedSummarizedExperiment}(x, start=NA, end=NA, keep.all.ranges=FALSE,
53
+         use.names=TRUE)
54
+
55
+\S4method{trim}{RangedSummarizedExperiment}(x, use.names=TRUE)
56
+}
57
+
58
+\arguments{
59
+  \item{x}{
60
+    A \link{RangedSummarizedExperiment} object.
61
+  }
62
+  \item{shift, use.names}{
63
+    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
64
+    \pkg{GenomicRanges} package.
65
+  }
66
+  \item{start, end, width, fix}{
67
+    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
68
+    \pkg{GenomicRanges} package.
69
+  }
70
+  \item{ignore.strand, both}{
71
+    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
72
+    \pkg{GenomicRanges} package.
73
+  }
74
+  \item{upstream, downstream}{
75
+    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
76
+    \pkg{GenomicRanges} package.
77
+  }
78
+  \item{keep.all.ranges}{
79
+    See \code{?`\link[GenomicRanges]{intra-range-methods}`} in the
80
+    \pkg{GenomicRanges} package.
81
+  }
82
+}
83
+
84
+\details{
85
+  Any of these functions performs the following transformation on
86
+  \link{RangedSummarizedExperiment} object \code{x}:
87
+\preformatted{rowRanges(x) <- f(rowRanges(x), ...)
88
+}
89
+  where \code{f} is the name of the function and \code{...} any additional
90
+  arguments passed to the function.
91
+}
92
+
93
+\seealso{
94
+  \itemize{
95
+    \item \link{RangedSummarizedExperiment} objects.
96
+    \item The \link[GenomicRanges]{intra-range-methods} man page in the
97
+          \pkg{GenomicRanges} package.
98
+  }
99
+}
100
+
101
+\examples{
102
+nrows <- 20; ncols <- 6
103
+counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
104
+rowRanges <- GRanges(rep(c("chr1", "chr2"), c(5, 15)),
105
+                     IRanges(sample(1000L, 20), width=100),
106
+                     strand=Rle(c("+", "-"), c(12, 8)))
107
+colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
108
+                     row.names=LETTERS[1:6])
109
+se0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
110
+                            rowRanges=rowRanges, colData=colData)
111
+
112
+se1 <- shift(se0, 1)
113
+stopifnot(identical(
114
+  rowRanges(se1),
115
+  shift(rowRanges(se0), 1)
116
+))
117
+
118
+se2 <- narrow(se0, start=10, end=-15)
119
+stopifnot(identical(
120
+  rowRanges(se2),
121
+  narrow(rowRanges(se0), start=10, end=-15)
122
+))
123
+
124
+se3 <- resize(se0, width=75)
125
+stopifnot(identical(
126
+  rowRanges(se3),
127
+  resize(rowRanges(se0), width=75)
128
+))
129
+
130
+se4 <- flank(se0, width=20)
131
+stopifnot(identical(
132
+  rowRanges(se4),
133
+  flank(rowRanges(se0), width=20)
134
+))
135
+
136
+se5 <- restrict(se0, start=200, end=700, keep.all.ranges=TRUE)
137
+stopifnot(identical(
138
+  rowRanges(se5),
139
+  restrict(rowRanges(se0), start=200, end=700, keep.all.ranges=TRUE)
140
+))
141
+}
142
+
143
+\keyword{methods}
144
+\keyword{utilities}