def append_to_flowgram_file(identifier, flowgram, fh, trim=False):
 if trim:
  flowgram = flowgram.getQualityTrimmedFlowgram()
 if (not hasattr(flowgram, 'spaced_flowgram')):
  spaced_flowgram_seq = ' '.join(map(str, flowgram.flowgram))
  flowgram.spaced_flowgram = spaced_flowgram_seq
 else:
  spaced_flowgram_seq = flowgram.spaced_flowgram
 fh.write(('%s %d %s\n' % (identifier, len(flowgram), spaced_flowgram_seq)))

def append_to_flowgram_file ( identifier , flowgram , fh , trim = False ) : if trim : flowgram = flowgram . getQualityTrimmedFlowgram ( ) if ( not hasattr ( flowgram , 'spaced_flowgram' ) ) : spaced_flowgram_seq = ' ' . join ( map ( str , flowgram . flowgram ) ) flowgram . spaced_flowgram = spaced_flowgram_seq else : spaced_flowgram_seq = flowgram . spaced_flowgram fh . write ( ( '%s %d %s\n' % ( identifier , len ( flowgram ) , spaced_flowgram_seq ) ) )
adds one flowgram to an open plain flowgram file .