Skip to content

Commit

Permalink
bug fix -- getChromsomeNames() was called on cytoband objects that do…
Browse files Browse the repository at this point in the history
… not support it
  • Loading branch information
jrobinso committed Feb 6, 2025
1 parent 5c936c8 commit 7c554c7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions js/genome/genome.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,18 @@ class Genome {

if (config.cytobandBbURL) {
this.cytobandSource = new CytobandFileBB(config.cytobandBbURL, Object.assign({}, config), this)
if (!this.chromosomeNames) {
this.chromosomeNames = await this.cytobandSource.getChromosomeNames()
}
} else if (config.cytobandURL) {
this.cytobandSource = new CytobandFile(config.cytobandURL, Object.assign({}, config))
if (!this.chromosomeNames) {
this.chromosomeNames = await this.cytobandSource.getChromosomeNames()
}
if (this.chromosomes.size === 0) {
const c = await this.cytobandSource.getChromosomes()
for (let chromosome of c) {
this.chromosomes.set(c.name, c)
}
}

// Last resort for chromosome information -- retrieve it from the cytoband source if supported
if (!this.chromosomeNames && typeof this.cytobandSource.getChromosomeNames === 'function') {
this.chromosomeNames = await this.cytobandSource.getChromosomeNames()
}
if (this.chromosomes.size === 0 && typeof this.cytobandSource.getChromosomes === 'function') {
const c = await this.cytobandSource.getChromosomes()
for (let chromosome of c) {
this.chromosomes.set(c.name, c)
}
}

Expand Down

0 comments on commit 7c554c7

Please sign in to comment.