nodes: 0, module; 1, function_definition; 2, function_name:shred; 3, parameters; 4, block; 5, identifier:args; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, comment:"""
      %prog shred unitigfile
  
      Shred the unitig into one fragment per unitig to fix. This is the last
      resort as a desperate fix.
      """; 15, assignment; 16, assignment; 17, comparison_operator:len(args) != 1; 18, block; 19, assignment; 20, assignment; 21, call; 22, call; 23, identifier:p; 24, call; 25, pattern_list; 26, call; 27, call; 28, integer:1; 29, expression_statement; 30, pattern_list; 31, identifier:args; 32, identifier:u; 33, call; 34, attribute; 35, argument_list; 36, attribute; 37, argument_list; 38, identifier:OptionParser; 39, argument_list; 40, identifier:opts; 41, identifier:args; 42, attribute; 43, argument_list; 44, identifier:len; 45, argument_list; 46, call; 47, identifier:s; 48, identifier:UnitigLayout; 49, argument_list; 50, identifier:u; 51, identifier:shred; 52, identifier:u; 53, identifier:print_to_file; 54, keyword_argument; 55, attribute; 56, identifier:p; 57, identifier:parse_args; 58, identifier:args; 59, identifier:args; 60, attribute; 61, argument_list; 62, identifier:s; 63, identifier:inplace; 64, True; 65, identifier:shred; 66, identifier:__doc__; 67, identifier:sys; 68, identifier:exit; 69, not_operator; 70, call; 71, attribute; 72, argument_list; 73, identifier:p; 74, identifier:print_help
code: def shred(args):
      """
      %prog shred unitigfile
  
      Shred the unitig into one fragment per unitig to fix. This is the last
      resort as a desperate fix.
      """
      p = OptionParser(shred.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      s, = args
      u = UnitigLayout(s)
      u.shred()
      u.print_to_file(inplace=True)