xscat               package:Biostrings               R Documentation

_C_o_n_c_a_t_e_n_a_t_e _s_e_q_u_e_n_c_e_s _c_o_n_t_a_i_n_e_d _i_n _X_S_t_r_i_n_g, _X_S_t_r_i_n_g_S_e_t
_a_n_d/_o_r _X_S_t_r_i_n_g_V_i_e_w_s _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function mimics the semantic of 'paste(..., sep="")' but
     accepts XString, XStringSet or XStringViews arguments and returns
     an XString or XStringSet object.

_U_s_a_g_e:

       xscat(...)

_A_r_g_u_m_e_n_t_s:

     ...: One or more character vectors (with no NAs), XString,
          XStringSet or XStringViews objects. 

_V_a_l_u_e:

     An XString object if all the arguments are either XString objects
     or character strings. An XStringSet object otherwise.

_A_u_t_h_o_r(_s):

     H. Pages

_S_e_e _A_l_s_o:

     XString-class, XStringSet-class, XStringViews-class, 'paste'

_E_x_a_m_p_l_e_s:

       ## 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$sequence)
       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.

