Skip to content

Commit

Permalink
Add values alias to elementMetadata accessor and setter.
Browse files Browse the repository at this point in the history
  • Loading branch information
p.aboyoun committed Mar 26, 2010
1 parent 47666e1 commit 8e72d66
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Version: 0.0.10
Author: P. Aboyoun, H. Pages and M. Lawrence
Maintainer: Biocore Team c/o BioC user list <[email protected]>
biocViews: Genetics, Sequencing, HighThroughputSequencing, Annotation
Depends: R (>= 2.8.0), methods, IRanges (>= 1.5.67)
Depends: R (>= 2.8.0), methods, IRanges (>= 1.5.71)
Imports: methods, IRanges
LinkingTo: IRanges
Suggests: RUnit, GenomicFeatures, BSgenome
Expand Down
4 changes: 2 additions & 2 deletions R/GRanges-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ setMethod("show", "GRanges",
nc <- ncol(object@elementMetadata)
cat(class(object), " with ",
lo, ifelse(lo == 1, " range and ", " ranges and "),
nc, ifelse(nc == 1, " elementMetadata column\n",
" elementMetadata columns\n"),
nc, ifelse(nc == 1, " elementMetadata value\n",
" elementMetadata values\n"),
sep = "")
if (lo == 0) {
out <-
Expand Down
6 changes: 5 additions & 1 deletion man/GRanges-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
Gets or sets the optional data columns. \code{value} can be a DataFrame,
data.frame object, or NULL.
}
\item{}{
\code{values(x), values(x) <- value}:
Alternative to \code{elementMetadata} functions.
}
\item{}{
\code{names(x)}, \code{names(x) <- value}:
Gets or sets the names of the elements.
Expand Down Expand Up @@ -397,7 +401,7 @@
# Summarizing elements
table(seqnames(gr))
sum(width(gr))
summary(elementMetadata(gr)[,"score"])
summary(elementMetadata(gr)[,"score"]) # or values(gr)
coverage(gr)

# Changing sequence name
Expand Down
9 changes: 9 additions & 0 deletions man/GRangesList-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@
Gets or sets the seqlengths. \code{value} can be a named non-negative
integer or numeric vector.
}
\item{}{
\code{elementMetadata(x)}, \code{elementMetadata(x) <- value}:
Gets or sets the optional data columns for the GRangesList elements.
\code{value} can be a DataFrame, data.frame object, or NULL.
}
\item{}{
\code{values(x), values(x) <- value}:
Alternative to \code{elementMetadata} functions.
}
}
}

Expand Down

0 comments on commit 8e72d66

Please sign in to comment.