Skip to content

Commit

Permalink
resync with stuff moving from IRanges to S4Vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Apr 17, 2014
1 parent 74476bd commit 79ab292
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Description: The ability to efficiently represent and manipulate genomic
intervals. Specialized containers for representing and manipulating
short alignments against a reference genome are defined in the
GenomicAlignments package.
Version: 1.17.5
Version: 1.17.6
Author: P. Aboyoun, H. Pages and M. Lawrence
Maintainer: Bioconductor Package Maintainer <[email protected]>
biocViews: Genetics, Infrastructure, Sequencing, Annotation
Depends: R (>= 2.10), methods, BiocGenerics (>= 0.7.7), IRanges (>= 1.23.5),
GenomeInfoDb (>= 0.99.17)
Depends: R (>= 2.10), methods, BiocGenerics (>= 0.7.7),
S4Vectors, IRanges (>= 1.99.0), GenomeInfoDb (>= 0.99.17)
Imports: methods, utils, stats, BiocGenerics, IRanges, XVector
LinkingTo: IRanges, XVector (>= 0.3.4)
LinkingTo: S4Vectors, IRanges, XVector (>= 0.5.2)
Suggests: AnnotationDbi (>= 1.21.1), AnnotationHub,
BSgenome, BSgenome.Hsapiens.UCSC.hg19,
BSgenome.Scerevisiae.UCSC.sacCer2,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import(methods)
import(utils) # for as.roman()
importFrom(stats, setNames)
import(BiocGenerics)
import(S4Vectors)
import(IRanges)
import(XVector) # only for the "Views" method for integer vectors, the
# XIntegerViews class, and the "viewMins", "viewMaxs", and
Expand Down
2 changes: 1 addition & 1 deletion R/GRanges-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ newGRanges <- ## hidden constructor shared with other GRanges-like objects
if (!is.factor(runValue(strand)) ||
!identical(levels(runValue(strand)), levels(strand())))
runValue(strand) <- strand(runValue(strand))
if (IRanges:::anyMissing(runValue(strand))) {
if (S4Vectors:::anyMissing(runValue(strand))) {
warning("missing values in strand converted to \"*\"")
runValue(strand)[is.na(runValue(strand))] <- "*"
}
Expand Down
10 changes: 5 additions & 5 deletions R/GenomicRanges-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ setMethod("fixedColumnNames", "GenomicRanges", function(x) {
{
if (!is.factor(runValue(seqnames(x))))
return("'seqnames' should be a 'factor' Rle")
if (IRanges:::anyMissing(runValue(seqnames(x))))
if (S4Vectors:::anyMissing(runValue(seqnames(x))))
return("'seqnames' contains missing values")
NULL
}
Expand All @@ -153,7 +153,7 @@ setMethod("fixedColumnNames", "GenomicRanges", function(x) {
")")
return(paste(msg, collapse=""))
}
if (IRanges:::anyMissing(runValue(strand(x))))
if (S4Vectors:::anyMissing(runValue(strand(x))))
return("'strand' contains missing values")
NULL
}
Expand Down Expand Up @@ -492,7 +492,7 @@ setReplaceMethod("start", "GenomicRanges",
starts <- start(ranges)
starts[] <- value
## TODO: Revisit this to handle circularity (maybe).
if (!IRanges:::anyMissing(seqlengths(x))) {
if (!S4Vectors:::anyMissing(seqlengths(x))) {
if (IRanges:::anyMissingOrOutside(starts, 1L)) {
warning("trimmed start values to be positive")
starts[starts < 1L] <- 1L
Expand All @@ -513,7 +513,7 @@ setReplaceMethod("end", "GenomicRanges",
ends[] <- value
seqlengths <- seqlengths(x)
## TODO: Revisit this to handle circularity.
if (!IRanges:::anyMissing(seqlengths)) {
if (!S4Vectors:::anyMissing(seqlengths)) {
seqlengths <- seqlengths[seqlevels(x)]
maxEnds <- seqlengths[as.integer(seqnames(x))]
trim <- which(ends > maxEnds)
Expand All @@ -532,7 +532,7 @@ setReplaceMethod("width", "GenomicRanges",
{
if (!is.integer(value))
value <- as.integer(value)
if (!IRanges:::anyMissing(seqlengths(x))) {
if (!S4Vectors:::anyMissing(seqlengths(x))) {
end(x) <- start(x) + (value - 1L)
} else {
ranges <- ranges(x)
Expand Down
6 changes: 3 additions & 3 deletions R/intra-range-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ setMethod("flank", "GenomicRanges",
ranges <-
flank(ranges(x), width=width, start=start, both=both,
use.names=use.names)
if (!IRanges:::anyMissing(seqlengths(x))) {
if (!S4Vectors:::anyMissing(seqlengths(x))) {
start(x) <- start(ranges)
end(x) <- end(ranges)
} else {
Expand Down Expand Up @@ -159,7 +159,7 @@ setMethod("resize", "GenomicRanges",
}
ranges <-
resize(ranges(x), width=width, fix=fix, use.names=use.names)
if (!IRanges:::anyMissing(seqlengths(x))) {
if (!S4Vectors:::anyMissing(seqlengths(x))) {
start(x) <- start(ranges)
end(x) <- end(ranges)
} else {
Expand Down Expand Up @@ -265,7 +265,7 @@ setMethod("trim", "GenomicRanges",
setMethod("Ops", c("GenomicRanges", "numeric"),
function(e1, e2)
{
if (IRanges:::anyMissing(e2))
if (S4Vectors:::anyMissing(e2))
stop("NA not allowed as zoom factor")
e2 <- recycleNumericArg(e2, "e2", length(e1))
if (.Generic == "*") {
Expand Down
8 changes: 4 additions & 4 deletions R/strand-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ setMethod("compatibleStrand", c("factor", "factor"), # not exported
y <- as.integer(as.character(y))

ans <- x * y != -1L
if (IRanges:::anyMissing(ans)) {
if (S4Vectors:::anyMissing(ans)) {
fix <- which(is.na(ans))
ans[fix] <- (x[fix] == 0L) | (y[fix] == 0L)
if (IRanges:::anyMissing(ans))
if (S4Vectors:::anyMissing(ans))
ans[is.na(ans)] <- FALSE
}
ans
Expand All @@ -145,11 +145,11 @@ setMethod("compatibleStrand", c("Rle", "Rle"), # not exported
runValue(y) <- as.integer(as.character(runValue(y)))

ans <- x * y != -1L
if (IRanges:::anyMissing(runValue(ans))) {
if (S4Vectors:::anyMissing(runValue(ans))) {
fix <- which(is.na(runValue(ans)))
runValue(ans)[fix] <-
(runValue(x) == 0L)[fix] | (runValue(y)[fix] == 0L)
if (IRanges:::anyMissing(runValue(ans)))
if (S4Vectors:::anyMissing(runValue(ans)))
runValue(ans)[is.na(runValue(ans))] <- FALSE
}
ans
Expand Down
4 changes: 2 additions & 2 deletions man/constraint.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ setMethod("checkConstraint", c("GenomicRanges", "HasRangeTypeCol"),
rangeType <- x_mcols[[idx]]
.LEVELS <- c("gene", "transcript", "exon", "cds", "5utr", "3utr")
if (!is(rangeType, "Rle") ||
IRanges:::anyMissing(runValue(rangeType)) ||
S4Vectors:::anyMissing(runValue(rangeType)) ||
!identical(levels(rangeType), .LEVELS))
{
msg <- c("'mcols(x)$rangeType' must be a ",
Expand Down Expand Up @@ -270,7 +270,7 @@ setMethod("checkConstraint", c("GenomicRanges", "HasGCCol"),
}
GC <- x_mcols[[idx]]
if (!is.numeric(GC) ||
IRanges:::anyMissing(GC) ||
S4Vectors:::anyMissing(GC) ||
any(GC < 0) || any(GC > 1))
{
msg <- c("'mcols(x)$GC' must be a numeric vector ",
Expand Down

0 comments on commit 79ab292

Please sign in to comment.