Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with custom organism bandfiles #307

Closed
NicoNekoru opened this issue Jul 22, 2022 · 0 comments
Closed

Issue with custom organism bandfiles #307

NicoNekoru opened this issue Jul 22, 2022 · 0 comments

Comments

@NicoNekoru
Copy link
Contributor

Using the band file cicer-arietinum.json in ./data/bands/cicer-arietinum.json

{
  "chrBands": [
    "1   1 48359943 1 48359943 gpos50", 
    "2   1 36634854 1 36634854 gpos50", 
    "3   1 39989001 1 39989001 gpos50", 
    "4   1 49191682 1 49191682 gpos50", 
    "5   1 48169137 1 48169137 gpos50", 
    "6   1 59463898 1 59463898 gpos50", 
    "7   1 48961560 1 48961560 gpos50", 
    "8   1 16477302 1 16477302 gpos50"
  ]
}

And the ideogram config

var config = {
	organism: 'cicer-arietinum',
	orientation: 'vertical',
	dataDir: './data/bands/',
	rotatable: false,
	showBandLabels: true,
	showNonNuclearChromosomes: false,
	container: '.ideogram-container',
	debug: true
}

I get the error

Uncaught (in promise) TypeError: Cannot create property 'chrIndex' on string '1'
    at ql.ac [as getChromosomeModel] (chromosome-model.js:176:7)
    at li (init.js:31:21)
    at ql.hi [as initDrawChromosomes] (init.js:85:5)
    at ql.Jr [as finishInit] (finish-init.js:91:8)
    at ql.ii [as writeContainer] (write-container.js:113:8)
    at init.js:234:10

with no Ideogram displayed. When logging (chr, bands, chrName, ) in the getChromosomeModel function before chr = getChrModelScaffold(chr, bands, chrName, ideo); I get the output

{} undefined '1' 

and when logging chr after the getChrModelScaffold I get

1

as described in the error.
If I do not provide dataDir the output instead becomes

{} undefined {name: 'Ca1', length: 48359943, type: 'nuclear'} 

which is the expected output and also creates the ideogram with expected behavior

Issue seems to stem from when organism has no bandsArray AND a string array of chromosome names for ideogram.config.chromosomes like

> ideogram.bandsArray
{3827: undefined}
> ideogram.config.chromosomes
{3827: (8) ['1', '2', '3', '4', '5', '6', '7', '8']}

instead of

> ideogram.bandsArray
{3827: undefined}
> ideogram.config.chromosomes
{"3827": [
    {...},
    {...},
    {...},
    {...},
    {...},
    {...},
    {...},
    {...},
]}

or

> ideogram.bandsArray
{3827: [
    [{}]
    [{}]
    [{}]
    [{}]
    [{}]
    [{}]
    [{}]
    [{}]
]}
> ideogram.config.chromosomes
{3827: (8) ['1', '2', '3', '4', '5', '6', '7', '8']}
@eweitz eweitz closed this as completed in 36e8d2c Jul 23, 2022
eweitz added a commit that referenced this issue Jul 23, 2022
Fix #307 with an optional config parameter `organismMetadata`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant