code: def count_flag_reads(self, file_name, flag, paired_end):
          
  
          param = " -c -f" + str(flag)
          if file_name.endswith("sam"):
              param += " -S"
          return self.samtools_view(file_name, param=param)
docs: Counts the number of reads with the specified flag.
  
          :param str file_name: name of reads file
          :param str flag: sam flag value to be read
          :param bool paired_end: This parameter is ignored; samtools automatically correctly responds depending
              on the data in the bamfile. We leave the option here just for consistency, since all the other
              counting functions require the parameter. This makes it easier to swap counting functions during
              pipeline development.