nodes: 0, module; 1, function_definition; 2, function_name:merge_bams; 3, parameters; 4, block; 5, identifier:self; 6, identifier:input_bams; 7, identifier:merged_bam; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, if_statement; 14, comment:# Handle more intuitive boolean argument.; 15, if_statement; 16, expression_statement; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, expression_statement; 21, expression_statement; 22, expression_statement; 23, expression_statement; 24, if_statement; 25, return_statement; 26, identifier:in_sorted; 27, string:"TRUE"; 28, identifier:tmp_dir; 29, None; 30, comment:"""
          Combine multiple files into one.
  
          The tmp_dir parameter is important because on poorly configured
          systems, the default can sometimes fill up.
  
          :param Iterable[str] input_bams: Paths to files to combine
          :param str merged_bam: Path to which to write combined result.
          :param bool | str in_sorted: Whether the inputs are sorted
          :param str tmp_dir: Path to temporary directory.
          """; 31, not_operator; 32, block; 33, assignment; 34, boolean_operator; 35, block; 36, comparison_operator:in_sorted in [False, True]; 37, block; 38, assignment; 39, assignment; 40, augmented_assignment; 41, augmented_assignment; 42, augmented_assignment; 43, augmented_assignment; 44, augmented_assignment; 45, augmented_assignment; 46, identifier:tmp_dir; 47, block; 48, identifier:cmd; 49, comparison_operator:len(input_bams) > 1; 50, expression_statement; 51, return_statement; 52, pattern_list; 53, call; 54, identifier:outdir; 55, not_operator; 56, expression_statement; 57, expression_statement; 58, identifier:in_sorted; 59, list; 60, expression_statement; 61, identifier:input_string; 62, binary_operator:" INPUT=" + " INPUT=".join(input_bams); 63, identifier:cmd; 64, binary_operator:self.tools.java + " -Xmx" + self.pm.javamem; 65, identifier:cmd; 66, binary_operator:" -jar " + self.tools.picard + " MergeSamFiles"; 67, identifier:cmd; 68, identifier:input_string; 69, identifier:cmd; 70, binary_operator:" OUTPUT=" + merged_bam; 71, identifier:cmd; 72, binary_operator:" ASSUME_SORTED=" + str(in_sorted); 73, identifier:cmd; 74, string:" CREATE_INDEX=TRUE"; 75, identifier:cmd; 76, string:" VALIDATION_STRINGENCY=SILENT"; 77, expression_statement; 78, call; 79, integer:1; 80, call; 81, integer:0; 82, identifier:outdir; 83, identifier:_; 84, attribute; 85, argument_list; 86, call; 87, call; 88, call; 89, False; 90, True; 91, assignment; 92, string:" INPUT="; 93, call; 94, binary_operator:self.tools.java + " -Xmx"; 95, attribute; 96, binary_operator:" -jar " + self.tools.picard; 97, string:" MergeSamFiles"; 98, string:" OUTPUT="; 99, identifier:merged_bam; 100, string:" ASSUME_SORTED="; 101, call; 102, augmented_assignment; 103, identifier:len; 104, argument_list; 105, identifier:print; 106, argument_list; 107, attribute; 108, identifier:split; 109, identifier:merged_bam; 110, attribute; 111, argument_list; 112, identifier:print; 113, argument_list; 114, attribute; 115, argument_list; 116, identifier:in_sorted; 117, conditional_expression:"TRUE" if in_sorted else "FALSE"; 118, attribute; 119, argument_list; 120, attribute; 121, string:" -Xmx"; 122, attribute; 123, identifier:javamem; 124, string:" -jar "; 125, attribute; 126, identifier:str; 127, argument_list; 128, identifier:cmd; 129, binary_operator:" TMP_DIR=" + tmp_dir; 130, identifier:input_bams; 131, string:"No merge required"; 132, identifier:os; 133, identifier:path; 134, attribute; 135, identifier:exists; 136, identifier:outdir; 137, call; 138, identifier:os; 139, identifier:makedirs; 140, identifier:outdir; 141, string:"TRUE"; 142, identifier:in_sorted; 143, string:"FALSE"; 144, string:" INPUT="; 145, identifier:join; 146, identifier:input_bams; 147, attribute; 148, identifier:java; 149, identifier:self; 150, identifier:pm; 151, attribute; 152, identifier:picard; 153, identifier:in_sorted; 154, string:" TMP_DIR="; 155, identifier:tmp_dir; 156, identifier:os; 157, identifier:path; 158, attribute; 159, argument_list; 160, identifier:self; 161, identifier:tools; 162, identifier:self; 163, identifier:tools; 164, string:"Creating path to merge file's folder: '{}'"; 165, identifier:format; 166, identifier:outdir
code: def merge_bams(self, input_bams, merged_bam, in_sorted="TRUE", tmp_dir=None):
          """
          Combine multiple files into one.
  
          The tmp_dir parameter is important because on poorly configured
          systems, the default can sometimes fill up.
  
          :param Iterable[str] input_bams: Paths to files to combine
          :param str merged_bam: Path to which to write combined result.
          :param bool | str in_sorted: Whether the inputs are sorted
          :param str tmp_dir: Path to temporary directory.
          """
          if not len(input_bams) > 1:
              print("No merge required")
              return 0
  
          outdir, _ = os.path.split(merged_bam)
          if outdir and not os.path.exists(outdir):
              print("Creating path to merge file's folder: '{}'".format(outdir))
              os.makedirs(outdir)
  
          # Handle more intuitive boolean argument.
          if in_sorted in [False, True]:
              in_sorted = "TRUE" if in_sorted else "FALSE"
  
          input_string = " INPUT=" + " INPUT=".join(input_bams)
          cmd = self.tools.java + " -Xmx" + self.pm.javamem
          cmd += " -jar " + self.tools.picard + " MergeSamFiles"
          cmd += input_string
          cmd += " OUTPUT=" + merged_bam
          cmd += " ASSUME_SORTED=" + str(in_sorted)
          cmd += " CREATE_INDEX=TRUE"
          cmd += " VALIDATION_STRINGENCY=SILENT"
          if tmp_dir:
              cmd += " TMP_DIR=" + tmp_dir
          return cmd