def create_clip_xml_info(readlen, adapl, adapr, quall, qualr):
 to_print = ['']
 if (adapr >= readlen):
  adapr = 0
 if (qualr >= readlen):
  qualr = 0
 if (adapr < 0):
  adapr = 0
 if (qualr < 0):
  qualr = 0
 if (adapl < 0):
  adapl = 0
 if (quall < 0):
  quall = 0
 if quall:
  to_print.append('        <clip_quality_left>')
  to_print.append(str(quall))
  to_print.append('</clip_quality_left>\n')
 if qualr:
  to_print.append('        <clip_quality_right>')
  to_print.append(str(qualr))
  to_print.append('</clip_quality_right>\n')
 if adapl:
  to_print.append('        <clip_vector_left>')
  to_print.append(str(adapl))
  to_print.append('</clip_vector_left>\n')
 if adapr:
  to_print.append('        <clip_vector_right>')
  to_print.append(str(adapr))
  to_print.append('</clip_vector_right>\n')
 return ''.join(to_print)

def create_clip_xml_info ( readlen , adapl , adapr , quall , qualr ) : to_print = [ '' ] if ( adapr >= readlen ) : adapr = 0 if ( qualr >= readlen ) : qualr = 0 if ( adapr < 0 ) : adapr = 0 if ( qualr < 0 ) : qualr = 0 if ( adapl < 0 ) : adapl = 0 if ( quall < 0 ) : quall = 0 if quall : to_print . append ( '        <clip_quality_left>' ) to_print . append ( str ( quall ) ) to_print . append ( '</clip_quality_left>\n' ) if qualr : to_print . append ( '        <clip_quality_right>' ) to_print . append ( str ( qualr ) ) to_print . append ( '</clip_quality_right>\n' ) if adapl : to_print . append ( '        <clip_vector_left>' ) to_print . append ( str ( adapl ) ) to_print . append ( '</clip_vector_left>\n' ) if adapr : to_print . append ( '        <clip_vector_right>' ) to_print . append ( str ( adapr ) ) to_print . append ( '</clip_vector_right>\n' ) return '' . join ( to_print )
takes the clip values of the read and formats them into xml corrects "wrong" values that might have resulted through simplified calculations earlier in the process of conversion .