docs: def bam_to_bigwig(
              self, input_bam, output_bigwig, genome_sizes, genome,
              tagmented=False, normalize=False, norm_factor=1000):
          """
          Convert a BAM file to a bigWig file.
  
          :param str input_bam: path to BAM file to convert
          :param str output_bigwig: path to which to write file in bigwig format
          :param str genome_sizes: path to file with chromosome size information
          :param str genome: name of genomic assembly
          :param bool tagmented: flag related to read-generating protocol
          :param bool normalize: whether to normalize coverage
          :param int norm_factor: number of bases to use for normalization
          :return list[str]: sequence of commands to execute
          """
          # TODO:
          # addjust fragment length dependent on read size and real fragment size
          # (right now it asssumes 50bp reads with 180bp fragments)
          cmds = list()
          transient_file = os.path.abspath(re.sub("\.bigWig", "", output_bigwig))
          cmd1 = self.tools.bedtools + " bamtobed -i {0} |".format(input_bam)
          if not tagmented:
              cmd1 += " " + self.tools.bedtools + " slop -i stdin -g {0} -s -l 0 -r 130 |".format(genome_sizes)
              cmd1 += " fix_bedfile_genome_boundaries.py {0} |".format(genome)
          cmd1 += " " + self.tools.genomeCoverageBed + " {0}-bg -g {1} -i stdin > {2}.cov".format(
              "-5 " if tagmented else "",
              genome_sizes,
              transient_file
          )
          cmds.append(cmd1)
          if normalize:
              cmds.append("""awk 'NR==FNR{{sum+= $4; next}}{{ $4 = ($4 / sum) * {1}; print}}' {0}.cov {0}.cov | sort -k1,1 -k2,2n > {0}.normalized.cov""".format(transient_file, norm_factor))
          cmds.append(self.tools.bedGraphToBigWig + " {0}{1}.cov {2} {3}".format(transient_file, ".normalized" if normalize else "", genome_sizes, output_bigwig))
          # remove tmp files
          cmds.append("if [[ -s {0}.cov ]]; then rm {0}.cov; fi".format(transient_file))
          if normalize:
              cmds.append("if [[ -s {0}.normalized.cov ]]; then rm {0}.normalized.cov; fi".format(transient_file))
          cmds.append("chmod 755 {0}".format(output_bigwig))
          return cmds