<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)