if (longChromosomeNames == null) {
longChromosomeNames = new ArrayList<String>(getAllChromosomeNames().size());
long genomeLength = getTotalLength();
int maxChromoLength = -1;
for (String chrName : getAllChromosomeNames()) {
Chromosome chr = getChromosome(chrName);
int length = chr.getLength();
maxChromoLength = Math.max(maxChromoLength, length);
if (length > (genomeLength / 3000)) {
longChromosomeNames.add(chrName);
}
}
/**
* At this point, we should have some long chromosome names.
* However, some genomes (draft ones perhaps) maybe have many small ones
* which aren't big enough. We arbitrarily take those which are above
* half the size of the max, only if the first method didn't work.
*/
if (longChromosomeNames.size() == 0) {
for (String chrName : getAllChromosomeNames()) {
Chromosome chr = getChromosome(chrName);
int length = chr.getLength();
if (length > maxChromoLength / 2) {
longChromosomeNames.add(chrName);
}
}
}