nodes: 0, module; 1, function_definition; 2, function_name:samtools_view; 3, parameters; 4, block; 5, identifier:self; 6, identifier:file_name; 7, identifier:param; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:postpend; 13, string:""; 14, comment:"""
          Run samtools view, with flexible parameters and post-processing.
  
          This is used internally to implement the various count_reads functions.
  
          :param str file_name: file_name
          :param str param: String of parameters to pass to samtools view
          :param str postpend: String to append to the samtools command;
              useful to add cut, sort, wc operations to the samtools view output.
          """; 15, assignment; 16, call; 17, identifier:cmd; 18, call; 19, attribute; 20, argument_list; 21, attribute; 22, argument_list; 23, identifier:subprocess; 24, identifier:check_output; 25, identifier:cmd; 26, keyword_argument; 27, string:"{} view {} {} {}"; 28, identifier:format; 29, attribute; 30, identifier:param; 31, identifier:file_name; 32, identifier:postpend; 33, identifier:shell; 34, True; 35, attribute; 36, identifier:samtools; 37, identifier:self; 38, identifier:tools
code: def samtools_view(self, file_name, param, postpend=""):
          """
          Run samtools view, with flexible parameters and post-processing.
  
          This is used internally to implement the various count_reads functions.
  
          :param str file_name: file_name
          :param str param: String of parameters to pass to samtools view
          :param str postpend: String to append to the samtools command;
              useful to add cut, sort, wc operations to the samtools view output.
          """
          cmd = "{} view {} {} {}".format(
                  self.tools.samtools, param, file_name, postpend)
          return subprocess.check_output(cmd, shell=True)