public TreeSet<FrequentSequenceItem> getGloballyFrequentItems(int minSupport) {
		Map<SequenceItem, Integer> itemBag = new HashMap<SequenceItem, Integer>();
		TreeSet<FrequentSequenceItem> frequentItemSet = new TreeSet<FrequentSequenceItem>();
		//count all items
		for (Sequence seq : sequences) {
			for (int i = 0; i < sequenceLength; ++i) {
				SequenceItem fItem = new SequenceItem(seq.getSequenceAsString().substring(i, i + 1), i);
				Integer count = itemBag.get(fItem);
				if (count == null) {
					itemBag.put(fItem, Integer.valueOf(seq.getCount()));
				}
				else {
					itemBag.put(fItem, count + seq.getCount());
				}
			}
		}

		//iterate through itemBag and save the frequent items
		for (Entry<SequenceItem, Integer> itemAndCount : itemBag.entrySet()) {
			int count = itemAndCount.getValue();
			if (count >= minSupport) {
				frequentItemSet.add(new FrequentSequenceItem(count, itemAndCount.getKey()));
			}
		}
		return frequentItemSet;
	}
returns the set of all items occuring in at least {@code minSupport} sequences
in the database.
@param minSupport minimum number of sequences that must contain an item
@return set of frequent items
Ghidra/Features/BytePatterns/src/main/java/ghidra/closedpatternmining/SequenceDatabase.java