code: def sequence(self, f, asstring=True):
          
  
          assert 'chr' in f, "`chr` field required"
          name = f['chr']
  
          assert name in self, "feature: %s not in `%s`" % \
                  (f, self.filename)
  
          fasta = self[f['chr']]
  
          seq = Fasta.subseq(fasta,
                  f.get('start'), f.get('stop'), f.get('strand'))
  
          if asstring:
              return str(seq)
  
          return seq
docs: Emulate brentp's pyfasta/fasta.py sequence() methods
  
          take a feature and use the start/stop or exon_keys to return
          the sequence from the assocatied fasta file:
  
          f: a feature
          asstring: if true, return the sequence as a string
                  : if false, return as a biopython Seq
  
          >>> f = Fasta('tests/data/three_chrs.fasta')
          >>> f.sequence({'start':1, 'stop':2, 'strand':1, 'chr': 'chr1'})
          'AC'
          >>> f.sequence({'start':1, 'stop':2, 'strand': -1, 'chr': 'chr1'})
          'GT'