code: def calc_coverage(ref, start, end, length, nucs):
      
      ref = ref[start - 1:end]
      bases = 0
      for pos in ref:
          for base, count in list(pos.items()):
              if base in nucs:
                  bases += count
      return float(bases)/float(length)
docs: calculate coverage for positions in range start -> end