diff --git a/DESCRIPTION b/DESCRIPTION index fca0f92..0df0058 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ Maintainer: Bioconductor Package Maintainer biocViews: Genetics, Infrastructure, Sequencing, Annotation, Coverage, GenomeAnnotation Depends: R (>= 2.10), methods, BiocGenerics (>= 0.11.3), S4Vectors (>= - 0.2.3), IRanges (>= 1.99.28), GenomeInfoDb (>= 1.1.20) + 0.2.3), IRanges (>= 2.1.2), GenomeInfoDb (>= 1.1.20) Imports: utils, stats, XVector LinkingTo: S4Vectors, IRanges Suggests: AnnotationDbi (>= 1.21.1), AnnotationHub, BSgenome, @@ -27,7 +27,7 @@ Suggests: AnnotationDbi (>= 1.21.1), AnnotationHub, BSgenome, pasillaBamSubset, RUnit, digest, BiocStyle License: Artistic-2.0 Collate: utils.R phicoef.R transcript-utils.R constraint.R - makeSeqnameIds.R strand-utils.R range-squeezers.R + strand-utils.R range-squeezers.R GenomicRanges-class.R GRanges-class.R DelegatingGenomicRanges-class.R GIntervalTree-class.R GenomicRanges-comparison.R GenomicRangesList-class.R diff --git a/NAMESPACE b/NAMESPACE index ff68409..7a6cc7d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -74,7 +74,7 @@ exportMethods( elementMetadata, "elementMetadata<-", mcols, "mcols<-", values, "values<-", - relistToClass, splitAsListReturnedClass, + relistToClass, compare, ranges, "ranges<-", trim, ngap, @@ -85,7 +85,7 @@ exportMethods( punion, pintersect, psetdiff, pgap, findOverlaps, countOverlaps, overlapsAny, subsetByOverlaps, precede, follow, nearest, distance, distanceToNearest, - map, mapCoords, + mapCoords, tile, subset, subjectHits, queryHits, @@ -103,7 +103,6 @@ exportMethods( export( phicoef, - makeSeqnameIds, GRanges, GRangesList, GenomicRangesList, GIntervalTree, .DollarNames.GenomicRanges, makeGRangesFromDataFrame, diff --git a/R/GRangesList-class.R b/R/GRangesList-class.R index fcd85b9..e253b6a 100644 --- a/R/GRangesList-class.R +++ b/R/GRangesList-class.R @@ -492,10 +492,6 @@ setReplaceMethod("[[", "GRangesList", .dBracketReplaceGRList) setMethod("relistToClass", "GRanges", function(x) "GRangesList") -setMethod("splitAsListReturnedClass", "GRanges", - function(x) {.Defunct("relistToClass"); "GRangesList"} -) - ### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ### show method. diff --git a/R/inter-range-methods.R b/R/inter-range-methods.R index db41cab..6808657 100644 --- a/R/inter-range-methods.R +++ b/R/inter-range-methods.R @@ -42,17 +42,15 @@ } .interIntervalGenomicRanges2 <- function(x, FUN, - with.revmap=FALSE, with.mapping=FALSE, + with.revmap=FALSE, ignore.strand=FALSE, ...) { x <- clone(x) mcols(x) <- NULL f <- .interIntervalSplitVariable(x, ignore.strand=ignore.strand) xIRangesList <- split(unname(ranges(x)), f) - if (with.revmap || with.mapping) { - ansIRangesList <- FUN(xIRangesList, - with.revmap=with.revmap, - with.mapping=with.mapping, ...) + if (with.revmap) { + ansIRangesList <- FUN(xIRangesList, with.revmap=with.revmap, ...) } else { ansIRangesList <- FUN(xIRangesList, ...) } @@ -74,19 +72,14 @@ ans_mcols <- new("DataFrame", nrows=length(ans_seqnames)) } else { mcols(ans_ranges) <- NULL - if (with.revmap || with.mapping) { - if (with.revmap) { - revmap_colname <- "revmap" - } else { - revmap_colname <- "mapping" - } - revmap_unlisted <- ans_mcols[[revmap_colname]] + if (with.revmap) { + revmap_unlisted <- ans_mcols[["revmap"]] revmap_partitioning <- PartitioningByEnd(ansIRangesList) old2new <- splitAsList(seq_along(x), f) revmap_unlisted2 <- .translateRevmap(revmap_unlisted, revmap_partitioning, old2new) - ans_mcols[[revmap_colname]] <- revmap_unlisted2 + ans_mcols[["revmap"]] <- revmap_unlisted2 } } if (length(extraColumnSlotNames(x)) > 0L) @@ -152,7 +145,7 @@ setMethod("range", "GRangesList", setMethod("reduce", "GenomicRanges", function(x, drop.empty.ranges=FALSE, min.gapwidth=1L, - with.revmap=FALSE, with.mapping=FALSE, + with.revmap=FALSE, with.inframe.attrib=FALSE, ignore.strand=FALSE) { if (!identical(with.inframe.attrib, FALSE)) @@ -165,8 +158,7 @@ setMethod("reduce", "GenomicRanges", .interIntervalGenomicRanges2(x, reduce, drop.empty.ranges=drop.empty.ranges, min.gapwidth=min.gapwidth, - with.revmap=with.revmap, - with.mapping=with.mapping) + with.revmap=with.revmap) } ) diff --git a/R/makeSeqnameIds.R b/R/makeSeqnameIds.R deleted file mode 100644 index ff72b7e..0000000 --- a/R/makeSeqnameIds.R +++ /dev/null @@ -1,8 +0,0 @@ -makeSeqnameIds <- function(seqnames, X.is.sexchrom=NA) -{ - txt <- "'makeSeqnameIds' is deprecated. - Use 'rankSeqlevels()' in 'GenomeInfoDb' instead." - .Defunct("rankSeqlevels", msg=paste(strwrap(txt), collapse="\n")) - rankSeqlevels(seqnames, X.is.sexchrom=NA) -} - diff --git a/R/mapCoords-methods.R b/R/mapCoords-methods.R index ffacf06..14b7765 100644 --- a/R/mapCoords-methods.R +++ b/R/mapCoords-methods.R @@ -31,10 +31,6 @@ relist(gr[ord], x) } -setMethod("map", c("GenomicRanges", "GRangesList"), function(from, to) { - .Defunct(msg="map() is defunct. Use mapCoords() instead.") -}) - setMethod("mapCoords", c("GenomicRanges", "GRangesList"), function(x, to, ..., ignore.strand = FALSE, elt.loc = FALSE, elt.hits = FALSE) { diff --git a/man/GRangesList-class.Rd b/man/GRangesList-class.Rd index 84c6d12..816e73b 100644 --- a/man/GRangesList-class.Rd +++ b/man/GRangesList-class.Rd @@ -45,7 +45,6 @@ % extractList() and family: \alias{relistToClass,GRanges-method} -\alias{splitAsListReturnedClass,GRanges-method} % show method: \alias{show,GRangesList-method} diff --git a/man/deprecated.Rd b/man/deprecated.Rd deleted file mode 100644 index 9c24829..0000000 --- a/man/deprecated.Rd +++ /dev/null @@ -1,24 +0,0 @@ -\name{GenomicRanges-deprecated} -\alias{GenomicRanges-deprecated} -\title{Deprecated Functions in package \pkg{GenomicRanges}} - -\alias{makeSeqnameIds} - -\description{ - The functions or variables listed here have been deprecated and should no - longer be used. -} - -\details{ - - The following functions are deprecated and will be made defunct; use - the replacement indicated below: - \itemize{ - - \item{makeSeqnameIds: \code{\link[GenomeInfoDb]{rankSeqlevels}}} - } -} - -\seealso{ - \code{\link{Deprecated}} -} diff --git a/man/inter-range-methods.Rd b/man/inter-range-methods.Rd index 589b23c..d06cd94 100644 --- a/man/inter-range-methods.Rd +++ b/man/inter-range-methods.Rd @@ -46,7 +46,7 @@ \S4method{range}{GRangesList}(x, ..., na.rm=FALSE) \S4method{reduce}{GenomicRanges}(x, drop.empty.ranges=FALSE, min.gapwidth=1L, - with.revmap=FALSE, with.mapping=FALSE, with.inframe.attrib=FALSE, + with.revmap=FALSE, with.inframe.attrib=FALSE, ignore.strand=FALSE) \S4method{reduce}{GRangesList}(x, drop.empty.ranges=FALSE, min.gapwidth=1L, with.inframe.attrib=FALSE) @@ -64,7 +64,7 @@ \arguments{ \item{x}{A \link{GenomicRanges} object.} - \item{drop.empty.ranges, min.gapwidth, with.revmap, with.mapping, with.inframe.attrib, start, end}{ + \item{drop.empty.ranges, min.gapwidth, with.revmap, with.inframe.attrib, start, end}{ See \code{?`\link[IRanges]{inter-range-methods}`} in the IRanges package. } \item{ignore.strand}{ diff --git a/man/map-methods.Rd b/man/map-methods.Rd deleted file mode 100644 index 0be511b..0000000 --- a/man/map-methods.Rd +++ /dev/null @@ -1,70 +0,0 @@ -\name{map-methods} - -\alias{map-methods} -\alias{map,GenomicRanges,GRangesList-method} - -\title{Mapping ranges between sequences} - -\description{ - \code{map} is defunct. Use \code{mapCoords} instead. - - A method for translating a set of input ranges through a - \link{GRangesList} object. Returns a GRangesMapping object. - - NOTE: The \code{\link[IRanges]{map}} generic function is defined and - documented in the \pkg{IRanges} package. - A method for translating a set of input ranges through a - \link[GenomicAlignments]{GAlignments} object is defined and - documented in the \pkg{GenomicAlignments} package. -} - -\usage{ -\S4method{map}{GenomicRanges,GRangesList}(from, to) -} - -\arguments{ - \item{from}{The input ranges to map, usually - a \code{\linkS4class{GenomicRanges}}} - - \item{to}{The alignment between the sequences in \code{from} and the - sequences in the result.} -} - -\value{ - An object of class GRangesMapping which contains both a - \linkS4class{Hits} instance and a \linkS4class{GRanges} instance. - - \itemize{ - \item \code{hits}: - Contains the matching (overlaps) from ranges in \code{from} - to the ranges in \code{to}. Matching can be many-to-one or - one-to-many. See \code{?`{\link{Hits}}`} for details. - - \item \code{GRanges}: - Contains the mapped coordinates for ranges in \code{from} that - are `within` ranges in \code{to}. Length of the GRanges is the - same as the \code{Hits} object and contains one row for each overlap. - Strand corresponds to the strand of the range in \code{to}. - } -} - -\details{ - Each element in \code{to} is taken to represent an alignment - of a sequence on a genome. The typical case is a set of transcript - models, as might be obtained via \code{GenomicFeatures::exonsBy}. - The method translates the input ranges to be relative to the transcript - start. This is useful, for example, when predicting coding consequences - of changes to the genomic sequence. Note that output is produced only - for ranges in \code{from} that fall completely `within` ranges in - \code{to}. -} - -\seealso{ - The GRangesMapping class is the typical return value. -} - -\examples{ -## See ?mapCoords for examples -} - -\author{M. Lawrence}