public long rankSum() {
		// Sanity check
		if (!geneSets.isRanked()) throw new RuntimeException("Cannot calculate rank: This is not a ranked gene set ('" + name + "')!");

		if (rankSum >= 0) return rankSum;
		rankSum = 0;
		rankedGenesCount = 0;
		maxRank = 0;
		GeneSetsRanked geneSetsRanked = (GeneSetsRanked) geneSets;
		for (String gene : getInterestingGenes()) {
			int r = geneSetsRanked.getRank(gene);
			if (r > 0) {
				rankedGenesCount++;
				rankSum += r;
			} else throw new RuntimeException("This should never happen!!! Ranked symbol " + gene + " has rank = 0");

			if (maxRank < r) maxRank = r;
		}

		return rankSum;
	}