\HeaderA{reverse}{Reverse an IRanges object}{reverse}
\aliasA{reverse,IRanges-method}{reverse}{reverse,IRanges.Rdash.method}
\aliasA{reverse,MaskCollection-method}{reverse}{reverse,MaskCollection.Rdash.method}
\aliasA{reverse,NormalIRanges-method}{reverse}{reverse,NormalIRanges.Rdash.method}
\aliasA{reverse,SharedRaw-method}{reverse}{reverse,SharedRaw.Rdash.method}
\aliasA{reverse,SharedVector\_Pool-method}{reverse}{reverse,SharedVector.Rul.Pool.Rdash.method}
\keyword{methods}{reverse}
\keyword{manip}{reverse}
\begin{Description}\relax
This operation is not intended to be used directly.
\end{Description}
\begin{Usage}
\begin{verbatim}
  reverse(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An IRanges object.

\item[\code{...}] Additional arguments to be passed to or from methods.

\end{ldescription}
\end{Arguments}
\begin{Value}
An object of the same class and length as the original object.
\end{Value}
\begin{Examples}
\begin{ExampleCode}
  ## WARNING: The examples here are not relevant anymore and will be
  ## updated soon.
  x <- IRanges(start=c(-2L, 6L, 9L, -4L, 1L, 0L, -6L, 10L),
               width=c( 5L, 0L, 6L,  1L, 4L, 3L,  2L,  3L))
  reverse(x, start=-6, end=20)

  ## When omitted, 'start' and 'end' are considered to be 'min(start(x))'
  ## and 'max(end(x))', respectively:
  reverse(x)

  reverse(shift(x, 2), start=-6, end=20)
  reverse(restrict(x, 1, 10), start=-6, end=20)
  reverse(reduce(x), start=-6, end=20)
  reverse(gaps(x, start=-6, end=20), start=-6, end=20)

  mask1 <- Mask(mask.width=29, start=c(11, 25, 28), width=c(5, 2, 2))
  mask2 <- Mask(mask.width=29, start=c(3, 10, 27), width=c(5, 8, 1))
  mask3 <- Mask(mask.width=29, start=c(7, 12), width=c(2, 4))
  mymasks <- append(append(mask1, mask2), mask3)
  reverse(mymasks)
\end{ExampleCode}
\end{Examples}

