code: def reduceloci(clus_obj,  path):
      
      filtered = {}
      n_cluster = 0
      large = 0
      current = clus_obj.clusid
      logger.info("Number of loci: %s" % len(clus_obj.loci.keys()))
      bar = ProgressBar(maxval=len(current))
      bar.start()
      bar.update(0)
      for itern, idmc in enumerate(current):
          bar.update(itern)
          logger.debug("_reduceloci: cluster %s" % idmc)
          c = copy.deepcopy(list(current[idmc]))
  
          n_loci = len(c)
          if n_loci < 1000:
              filtered, n_cluster = _iter_loci(c, clus_obj.clus, (clus_obj.loci, clus_obj.seq), filtered, n_cluster)
          else:
              large += 1
              n_cluster += 1
              _write_cluster(c, clus_obj.clus, clus_obj.loci, n_cluster, path)
              filtered[n_cluster] = _add_complete_cluster(n_cluster, c, clus_obj.clus)
      clus_obj.clus = filtered
  
      seqs = 0
      for idc in filtered:
          seqs += len(filtered[idc].idmembers)
      logger.info("seqs in clusters %s" % (seqs))
  
      logger.info("Clusters too long to be analized: %s" % large)
      logger.info("Number of clusters removed because low number of reads: %s" % REMOVED)
      logger.info("Number of clusters with conflicts: %s" % CONFLICT)
      return clus_obj
docs: reduce number of loci a cluster has
      :param clus_obj: cluster object object
      :param path: output path