public int getChromosomeLength(){
return getChromosomeLength(this.chrName);
}
private static int getChromosomeLength(String chrName) {
Genome genome = getGenome();
if (genome == null) {
return 1;
}
if (chrName.equals("All")) {
// TODO -- remove the hardcoded unit divider ("1000")
return (int) (genome.getNominalLength() / 1000);
} else {
Chromosome chromosome = genome.getChromosome(chrName);
if (chromosome == null) {
log.error("Null chromosome: " + chrName);
if (genome.getChromosomes().size() == 0) {
return 1;
} else {
return genome.getChromosomes().iterator().next().getLength();
}
}
return chromosome.getLength();
}
}