def writerec(outrec, handle, fields=GAF20FIELDS):
 outstr = ''
 for field in fields[:(-1)]:
  if isinstance(outrec[field], list):
   for subfield in outrec[field]:
    outstr += (subfield + '|')
   outstr = (outstr[:(-1)] + ' DCTB ')
  else:
   outstr += (outrec[field] + ' DCTB ')
 outstr += (outrec[fields[(-1)]] + '\n')
 handle.write(('%s' % outstr))

def writerec ( outrec , handle , fields = GAF20FIELDS ) : outstr = '' for field in fields [ : ( - 1 ) ] : if isinstance ( outrec [ field ] , list ) : for subfield in outrec [ field ] : outstr += ( subfield + '|' ) outstr = ( outstr [ : ( - 1 ) ] + ' DCTB ' ) else : outstr += ( outrec [ field ] + ' DCTB ' ) outstr += ( outrec [ fields [ ( - 1 ) ] ] + '\n' ) handle . write ( ( '%s' % outstr ) )
write a single uniprot-goa record to an output stream .