\HeaderA{xscat}{Concatenate sequences contained in XString, XStringSet
and/or XStringViews objects}{xscat}
\keyword{methods}{xscat}
\keyword{manip}{xscat}
\begin{Description}\relax
This function mimics the semantic of \code{paste(..., sep="")}
but accepts \LinkA{XString}{XString}, \LinkA{XStringSet}{XStringSet} or \LinkA{XStringViews}{XStringViews}
arguments and returns an \LinkA{XString}{XString} or \LinkA{XStringSet}{XStringSet} object.
\end{Description}
\begin{Usage}
\begin{verbatim}
  xscat(...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] One or more character vectors (with no NAs), \LinkA{XString}{XString},
\LinkA{XStringSet}{XStringSet} or \LinkA{XStringViews}{XStringViews} objects.

\end{ldescription}
\end{Arguments}
\begin{Value}
An \LinkA{XString}{XString} object if all the arguments are either \LinkA{XString}{XString}
objects or character strings.
An \LinkA{XStringSet}{XStringSet} object otherwise.
\end{Value}
\begin{Author}\relax
H. Pages
\end{Author}
\begin{SeeAlso}\relax
\LinkA{XString-class}{XString.Rdash.class},
\LinkA{XStringSet-class}{XStringSet.Rdash.class},
\LinkA{XStringViews-class}{XStringViews.Rdash.class},
\code{\LinkA{paste}{paste}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  ## Return a BString object:
  xscat(BString("abc"), BString("EF"))
  xscat(BString("abc"), "EF")
  xscat("abc", "EF")

  ## Return a BStringSet object:
  xscat(BStringSet("abc"), "EF")

  ## Return a DNAStringSet object:
  xscat(c("t", "a"), DNAString("N"))

  ## Arguments are recycled to the length of the longest argument:
  xscat("x", LETTERS, c("3", "44", "555")) 

  ## Concatenating big XStringSet objects:
  library(drosophila2probe)
  probes <- DNAStringSet(drosophila2probe)
  mm <- complement(narrow(probes, start=13, end=13))
  left <- narrow(probes, end=12)
  right <- narrow(probes, start=14)
  xscat(left, mm, right)

  ## Collapsing an XStringSet (or XStringViews) object with a small
  ## number of elements:
  probes1000 <- as.list(probes[1:1000])
  y1 <- do.call(xscat, probes1000)
  y2 <- do.call(c, probes1000)  # slightly faster than the above
  y1 == y2  # TRUE
  ## Note that this method won't be efficient when the number of
  ## elements to collapse is big (> 10000) so we need to provide a
  ## collapse() (or xscollapse()) function in Biostrings that will
  ## be efficient at doing this. Please complain on the Bioconductor
  ## mailing list (http://bioconductor.org/docs/mailList.html) if you
  ## need this.
\end{ExampleCode}
\end{Examples}

