code: def get_seqstarts(bamfile, N):
      
      import pysam
      bamfile = pysam.AlignmentFile(bamfile, "rb")
      seqsize = {}
      for kv in bamfile.header["SQ"]:
          if kv["LN"] < 10 * N:
              continue
          seqsize[kv["SN"]] = kv["LN"] / N + 1
  
      allseqs = natsorted(seqsize.keys())
      allseqsizes = np.array([seqsize[x] for x in allseqs])
      seqstarts = np.cumsum(allseqsizes)
      seqstarts = np.roll(seqstarts, 1)
      total_bins = seqstarts[0]
      seqstarts[0] = 0
      seqstarts = dict(zip(allseqs, seqstarts))
  
      return seqstarts, seqsize, total_bins
docs: Go through the SQ headers and pull out all sequences with size
      greater than the resolution settings, i.e. contains at least a few cells