code: def seqrecord2sequence(record, qlen, index):
      
      # aligned_len = sum(map(str.isupper, str(record.seq)))
      # assert qlen == aligned_len, (
      #         "Aligned sequence length %s, query %s\n%s"
      #         % (aligned_len, qlen, str(record)))
  
      description = (record.description.split(' ', 1)[1]
              if ' ' in record.description
              else ' ')
      return dict(index=index,
                  id=record.id,
                  description=description,
                  dbxrefs={},
                  phylum='',
                  taxchar='',
                  head_len=None,
                  tail_len=None,
                  head_seq='',
                  tail_seq='',
                  length=len(record.seq) - record.seq.count('-'),
                  seq=str(record.seq),
                  )
docs: Convert a Biopython SeqRecord to a esbglib.cma block.
  
      Indels (gaps, casing) must have already been handled in the record.