\HeaderA{IRanges-class}{IRanges and NormalIRanges objects}{IRanges.Rdash.class}
\aliasA{c,IRanges-method}{IRanges-class}{c,IRanges.Rdash.method}
\aliasA{class:IRanges}{IRanges-class}{class:IRanges}
\aliasA{class:NormalIRanges}{IRanges-class}{class:NormalIRanges}
\aliasA{coerce,integer,IRanges-method}{IRanges-class}{coerce,integer,IRanges.Rdash.method}
\aliasA{coerce,integer,NormalIRanges-method}{IRanges-class}{coerce,integer,NormalIRanges.Rdash.method}
\aliasA{coerce,logical,IRanges-method}{IRanges-class}{coerce,logical,IRanges.Rdash.method}
\aliasA{coerce,logical,NormalIRanges-method}{IRanges-class}{coerce,logical,NormalIRanges.Rdash.method}
\aliasA{coerce,numeric,IRanges-method}{IRanges-class}{coerce,numeric,IRanges.Rdash.method}
\aliasA{coerce,numeric,NormalIRanges-method}{IRanges-class}{coerce,numeric,NormalIRanges.Rdash.method}
\aliasA{coerce,Ranges,IRanges-method}{IRanges-class}{coerce,Ranges,IRanges.Rdash.method}
\aliasA{end<-,IRanges-method}{IRanges-class}{end<.Rdash.,IRanges.Rdash.method}
\aliasA{isEmpty,NormalIRanges-method}{IRanges-class}{isEmpty,NormalIRanges.Rdash.method}
\aliasA{isNormal,IRanges-method}{IRanges-class}{isNormal,IRanges.Rdash.method}
\aliasA{max,NormalIRanges-method}{IRanges-class}{max,NormalIRanges.Rdash.method}
\aliasA{min,NormalIRanges-method}{IRanges-class}{min,NormalIRanges.Rdash.method}
\aliasA{names,IRanges-method}{IRanges-class}{names,IRanges.Rdash.method}
\aliasA{names<-,IRanges-method}{IRanges-class}{names<.Rdash.,IRanges.Rdash.method}
\aliasA{NormalIRanges}{IRanges-class}{NormalIRanges}
\aliasA{NormalIRanges-class}{IRanges-class}{NormalIRanges.Rdash.class}
\aliasA{seqselect,IRanges-method}{IRanges-class}{seqselect,IRanges.Rdash.method}
\aliasA{seqselect<-,IRanges-method}{IRanges-class}{seqselect<.Rdash.,IRanges.Rdash.method}
\aliasA{start,IRanges-method}{IRanges-class}{start,IRanges.Rdash.method}
\aliasA{start<-,IRanges-method}{IRanges-class}{start<.Rdash.,IRanges.Rdash.method}
\aliasA{update,IRanges-method}{IRanges-class}{update,IRanges.Rdash.method}
\aliasA{width,IRanges-method}{IRanges-class}{width,IRanges.Rdash.method}
\aliasA{width<-,IRanges-method}{IRanges-class}{width<.Rdash.,IRanges.Rdash.method}
\aliasA{window,IRanges-method}{IRanges-class}{window,IRanges.Rdash.method}
\aliasA{[,IRanges-method}{IRanges-class}{[,IRanges.Rdash.method}
\aliasA{[<-,IRanges-method}{IRanges-class}{[<.Rdash.,IRanges.Rdash.method}
\keyword{methods}{IRanges-class}
\keyword{classes}{IRanges-class}
\begin{Description}\relax
The IRanges class is a simple implementation of the \LinkA{Ranges}{Ranges}
container where 2 integer vectors of the same length are used to
store the start and width values.
See the \LinkA{Ranges}{Ranges} virtual class for a formal definition of
\LinkA{Ranges}{Ranges} objects and for their methods (all of them should
work for IRanges objects).

Some subclasses of the IRanges class are: NormalIRanges,
\LinkA{Views}{Views}, etc...

A NormalIRanges object is just an IRanges object that is guaranteed
to be "normal". See the Normality section in the man page for
\LinkA{Ranges}{Ranges} objects for the definition and properties
of "normal" \LinkA{Ranges}{Ranges} objects.
\end{Description}
\begin{Section}{Constructor}
See \code{?`\LinkA{IRanges-constructor}{IRanges.Rdash.constructor}`}.
\end{Section}
\begin{Section}{Coercion}
\describe{
\item[] \code{as(from, "IRanges")}: Creates an IRanges instance from a Ranges
object, logical vector, or integer vector. When \code{from} is a logical
vector, the resulting IRanges object contains the indices for the runs
of \code{TRUE} values. When \code{from} is an integer vector, the
elements are either singletons or "increase by 1" sequences.

\item[] \code{as(from, "NormalIRanges")}: Creates a NormalIRanges instance
from a logical or integer vector. When \code{from} is an integer vector,
the elements must be strictly increasing.

}
\end{Section}
\begin{Section}{Methods for NormalIRanges objects}
\describe{
\item[] \code{max(x)}:
The maximum value in the finite set of integers represented by \code{x}.

\item[] \code{min(x)}:
The minimum value in the finite set of integers represented by \code{x}.

}
\end{Section}
\begin{Author}\relax
H. Pages
\end{Author}
\begin{SeeAlso}\relax
\LinkA{Ranges-class}{Ranges.Rdash.class},
\LinkA{Ranges-utils}{Ranges.Rdash.utils},
\LinkA{IRanges-constructor}{IRanges.Rdash.constructor},
\LinkA{IRanges-utils}{IRanges.Rdash.utils},
\LinkA{IRanges-setops}{IRanges.Rdash.setops}.

Some direct subclasses of the IRanges class (other than NormalIRanges):
\LinkA{Views-class}{Views.Rdash.class}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  showClass("IRanges")  # shows (some of) the known subclasses

  ## ---------------------------------------------------------------------
  ## A. MANIPULATING IRanges OBJECTS
  ## ---------------------------------------------------------------------
  ## All the methods defined for Ranges objects work on IRanges objects.
  ## See ?Ranges for some examples.
  ## Also see ?`IRanges-utils` and ?`IRanges-setops` for additional
  ## operations on IRanges objects.

  ## ---------------------------------------------------------------------
  ## B. A NOTE ABOUT PERFORMANCE
  ## ---------------------------------------------------------------------
  ## Using an IRanges object for storing a big set of ranges is more
  ## efficient than using a standard R data frame:
  N <- 2000000L  # nb of ranges
  W <- 180L      # width of each range
  start <- 1L
  end <- 50000000L
  set.seed(777)
  range_starts <- sort(sample(end-W+1L, N))
  range_widths <- rep.int(W, N)
  ## Instantiation is faster
  system.time(x <- IRanges(start=range_starts, width=range_widths))
  system.time(y <- data.frame(start=range_starts, width=range_widths))
  ## Subsetting is faster
  system.time(x16 <- x[c(TRUE, rep.int(FALSE, 15))])
  system.time(y16 <- y[c(TRUE, rep.int(FALSE, 15)), ])
  ## Internal representation is more compact
  object.size(x16)
  object.size(y16)
\end{ExampleCode}
\end{Examples}

