def make_fasta(rec):
 gi = rec.annotations.get('gi', '')
 org = rec.annotations.get('organism', '')
 date = rec.annotations.get('date', '')
 head = ('>gi:%s, id:%s, org:%s, date:%s\n' % (gi, rec.id, org, date))
 body = '\n'.join(textwrap.wrap(rec.seq.data, width=80))
 return (head, body)

def make_fasta ( rec ) : gi = rec . annotations . get ( 'gi' , '' ) org = rec . annotations . get ( 'organism' , '' ) date = rec . annotations . get ( 'date' , '' ) head = ( '>gi:%s, id:%s, org:%s, date:%s\n' % ( gi , rec . id , org , date ) ) body = '\n' . join ( textwrap . wrap ( rec . seq . data , width = 80 ) ) return ( head , body )
creates fasta format from a record .