BStringViews-io          package:Biostrings          R Documentation

_I_n_p_u_t/_o_u_t_p_u_t _o_f _B_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:

     Functions to create a BStringViews object by reading a file or to
     write a BStringViews object to a file.

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

       read.BStringViews(file, format, subjectClass, collapse="")
       write.BStringViews(x, file="", format, width=80)

       FASTArecordsToCharacter(FASTArecs, use.names=TRUE)
       CharacterToFASTArecords(x)
       FASTArecordsToBStringViews(FASTArecs, subjectClass, collapse="")
       BStringViewsToFASTArecords(x)

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

    file: Either a character string naming a file or a connection open
          for reading or writing. If '""' (the default for
          'write.BStringViews'), 'write.BStringViews' writes to the
          standard output connection (the console) unless redirected by
          'sink'. 

  format: Only '"fasta"' is supported for now. 

subjectClass: The class to be given to the subject of the BStringViews
          object created and returned by the function. Must be
          '"BString"' or one of its subclasses: '"DNAString"',
          '"RNAString"' or '"AAString"'. 

collapse: An optional character string to be inserted between the views
          of the BStringViews object created and returned by the
          function. 

       x: For 'write.BStringViews', the BStringViews object to be
          written to 'file'. For 'CharacterToFASTArecords', the
          (possibly named) character vector to be converted to a list
          of FASTA records as one returned by 'readFASTA'. For
          'BStringViewsToFASTArecords', the BStringViews object to be
          converted to a list of FASTA records as one returned by
          'readFASTA'. 

   width: Only relevant if 'format' is '"fasta"'. The maximum number of
          letters per line of sequence. 

FASTArecs: A list of FASTA records as one returned by 'readFASTA'. 

use.names: Whether or not the 'desc' component of the FASTA records
          should be used to set the names of the returned vector. 

_D_e_t_a_i_l_s:

     Only FASTA files are supported for now.

     'read.BStringViews' creates a BStringViews object by reading a
     file.

     'write.BStringViews' writes a BStringViews object to a file or
     connection.

     'FASTArecordsToCharacter', 'CharacterToFASTArecords',
     'FASTArecordsToBStringViews' and 'BStringViewsToFASTArecords' are
     convenience functions used internally by 'read.BStringViews' and
     'write.BStringViews' for switching between different
     representations of the same object.

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

     'readFASTA', 'writeFASTA', BStringViews-class, BString-class,
     DNAString-class, RNAString-class, AAString-class

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

       file <- system.file("Exfiles", "someORF.fsa", package="Biostrings")
       x <- read.BStringViews(file, "fasta", "DNAString")
       write.BStringViews(x, format="fasta") # writes to the console

       ## Converting 'x'...
       ## ... to a list of FASTA records (as one returned by the "readFASTA" function)
       x1 <- BStringViewsToFASTArecords(x)
       ## ... to a named character vector
       x2 <- FASTArecordsToCharacter(x1) # same as 'as.character(x)'

