readSeq                package:GeneR                R Documentation

_S_e_q_u_e_n_c_e _e_x_t_r_a_c_t_i_o_n _f_r_o_m _a _b_a_n_k

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

     These functions load a sequence from a Fasta, Embl or GeneBank
     sequence bank file into a GeneR sequence buffer or as a character
     string..

     readSeq is the generic function, readFasta, readGbk and readEmbl
     are aliases.

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

     readSeq(file,name=NA, type="F", seqno=0, 
             from=1, to=0,upper=TRUE, index="ix")
     readFasta(file,name=NA, seqno=0,
             from=1, to=0,upper = TRUE, index="ix")
     strReadFasta (file, name = NA, from = 1,
                              to = 0,upper = TRUE) 
     readGbk(file,name=NA, seqno=0, from=1, to=0,upper = TRUE,index="ix")
     strReadGbk (file, name = NA, from = 1,
                              to = 0,upper = TRUE) 
     readEmbl(file,name=NA, seqno=0, from=1, to=0,upper = TRUE,index="ix")
     strReadEmbl (file, name = NA, from = 1,
                              to = 0,upper = TRUE, index = "ix") 

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

    file: String/scalar, File name of the bank

    name: String/scalar, Sequence name (default : first sequence)

   upper: upper case letters conversion (TRUE: The whole sequence is
          converted to upper case letters, FALSE : no conversion (only
          implemented for Fasta sequence)). 

    type: String/scalar, Bank format ("F" -> fasta. "E" -> embl, "G" ->
          GenBank)

   seqno: Integer/scalar, Sequence number (buffer number) 

from, to: Integer/scalar, Absolute addresses of the begin and the end
          of the fragment, (1 means the first nucleotide and 0
          conventionally the last one;  from must not be larger than
          to)

   index: String/scalar, type of index ( "ix" -> sequence name is the
          accession number 
           "id" -> sequence name is the identifier) 

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

     integer: 1 if OK; -1 if error. strReadFasta, strReadGbk and
     strReadEmbl returns the sequence as character string.

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

     L.Cottret, A. Lucas.

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

     'GeneR', 'globals', 'readEmblLocation', 'readGbkLocation',
     'getSeq',  'sizeSeqEmbl', 'sizeSeqFasta'

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

     ## Get a sequence from Ncbi
     seqNcbi("BY608190",file="BY608190.gbk",type="G")

     ## Read Gbk file to buffer 0
     readGbk("BY608190.gbk")

     ## Or to a character string
     strReadGbk("BY608190.gbk")

     ## Write to Fasta file
     writeFasta(file='toto.fa')

     ## Make an index to this file
     indexFasta('toto.fa')
     readFasta (file="toto.fa",seqno=0,from=1,to=159)

     ## Show seqence on buffer 0
     getSeq()

     ## Make a Fake file
     writeEmblLine(file='toto.embl',code='AC',header='tmp',append=FALSE)
     writeEmblSeq(file='toto.embl')

     ## Make index on file toto.embl
     indexEmbl('toto.embl')

     ## Read Embl file to buffer 0
     readEmbl('toto.embl')

     ## Or read "directly"
     strReadEmbl('toto.embl')

