ReadSeq                package:GeneR                R Documentation

_R_e_a_d _a _s_e_q_u_e_n_c_e _f_r_o_m _a _F_a_s_t_a, _E_m_b_l _o_r _G_e_n_e_B_a_n_k _f_i_l_e.

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

     Read a sequence from  a Fasta, Embl or GeneBank file, and put it
     in a buffer.

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

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

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

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

    file: file of the bank

    name: Name of the sequence in the bank (default: first sequence)

    path: Path to the bank

   upper: if TRUE: all sequence is converted to upper case (default),
          else sequence is read directly (only implemented for Fasta). 

    type: One of: "F" -> fasta. "E" -> embl.

   seqno: Integer. Number of bufseq where the sequence will be stored

 from,to: Begining and ending of sequence, can be vectors. 0 represent
          the last nucleotide and 1 the first one. 

   index: "ix": name is accn of sequence. 
           "id" : name is id of sequence. 

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

     integer: 1 if if get the sequence; -1 if error. strReadEmbl return
     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",path=".",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')

