parameters: (filename)
return_statement: return zip(res_name, res_seq)
docstring: Returns list of FASTA entries (in tuples: name, seq)
docstring_summary: Returns list of FASTA entries (in tuples: name, seq)
docstring_tokens: Returns list of FASTA entries ( in tuples : name seq )
function: def read_fasta(filename):
      """
          Returns list of FASTA entries (in tuples: name, seq)
      """
      res_name = []
      res_seq = []
      first = True
      seq = ''
      fastafile = file
      file_ext = os.path.splitext(filename)[1]
      if file_ext == ".gz":
          import gzip
          fastafile = gzip.open(filename)
      else:
          fastafile = open(filename)
  
      for line in fastafile:
          if line[0] == '>':
              res_name.append(line.strip())
              if not first:
                  res_seq.append(seq)
              else:
                  first = False
              seq = ''
          else:
              seq += line.strip()
      res_seq.append(seq)
      return zip(res_name, res_seq)
function_tokens: def read_fasta ( filename ) : res_name = [ ] res_seq = [ ] first = True seq = '' fastafile = file file_ext = os . path . splitext ( filename ) [ 1 ] if file_ext == ".gz" : import gzip fastafile = gzip . open ( filename ) else : fastafile = open ( filename ) for line in fastafile : if line [ 0 ] == '>' : res_name . append ( line . strip ( ) ) if not first : res_seq . append ( seq ) else : first = False seq = '' else : seq += line . strip ( ) res_seq . append ( seq ) return zip ( res_name , res_seq )