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

dataRoot parameter can't be reconfigured #627

Closed
cmdcolin opened this Issue Jul 31, 2015 · 10 comments

Comments

Projects
None yet
4 participants
@cmdcolin
Copy link
Contributor

cmdcolin commented Jul 31, 2015

I didn't want to hijack a different issue that was regarding the dataRoot parameter, but essentially the dataRoot parameter doesn't work if you change it's default value. I had noted this awhile back, and it's not super critical since it would probably not be used very often, but here is a way it can be reproduced.

In jbrowse.conf, dataRoot is defined as

dataRoot=data

In addition, in configDefaults

dataRoot: 'data'

So, the fact that this parameter is available in jbrowse.conf implies that it can be reconfigured, however, in practice, if you set it to a different value, like dataRoot=newdata, it doesn't really end up working. It basically will still be looking in the old data/ folder for the refseqs file 'data/seq/refSeqs.json"

So essentially, the refseqs will be loaded from the data/ folder, but the annotations from newdata/ are loaded

The likely cause is that the refSeqs parameter in the configDefaults uses

{dataRoot}/seq/refSeqs.json

This requires that at some point in the config loader, that the dataRoot "template" is filled in by the new value, but it is not being updated in the right order (?), so it is ends up being parameterized as data/seq/refSeqs.json instead of the new dataRoot value

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

cmdcolin commented Jul 31, 2015

I described some basic ideas about dataRoot in #625

@ihh

This comment has been minimized.

Copy link
Member

ihh commented Nov 20, 2015

@cmdcolin this seems odd because for the default demo, the URL parameter overrides dataRoot and sets it equal to sample_data/json/volvox or whatever, and it works OK... I have not tested this but does it definitely fail if dataRoot is specified in the config file, but succeed if it's specified as a URL parameter?

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

cmdcolin commented Nov 20, 2015

@ihh yep. It only fails if you try and set it in the config file (for example, from where it is defined in jbrowse.conf, that will be ignored). Settings it via the URL is fine (via ?data=)

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

cmdcolin commented Aug 12, 2016

The specific issue for this is a little obscure related to how configs are merged together. Will just close for now

@cmdcolin cmdcolin closed this Aug 12, 2016

@terrymun

This comment has been minimized.

Copy link

terrymun commented Aug 18, 2016

I didn't mean to hijack this closed thread—I'm more than happy to open a new issue if it is distinct from the one you're facing, @cmdcolin.

Basically when I attempt to change the value of dataRoot in the jBrowse .conf file, the genome dataset selection becomes sticky. For example, if I set dataRoot = genomes/lj/v3.0 and I have other datasets defined, no matter which genome I choose from the dropdown, I will be redirected to dataRoot = genomes/lj/v3.0 no matter what. Inspecting all the XHR headers reveals that the reference sequence, and all the .conf and .json files loaded, are from the "sticky" genome set from dataRoot attribute.

Therefore it seems that there is indeed some issue with overriding default values of the default data directory. When dataRoot is commented out, I can again switch freely between genomes.

I have tested this issue on both a private and shared development servers, and can confirm the reproduction of this issue. I am running v1.12.0.

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

cmdcolin commented Aug 18, 2016

Hmm. In my experience here, setting dataRoot in the config file had no effect, but it does appear to have one in yours. The details of why this happens I believe are a little technical and has to do with the order of how the config gets merged together. I'll re-open, if you have any more details or are interested in getting to the bottom of it that would be awesome!

@cmdcolin cmdcolin reopened this Aug 18, 2016

@terrymun

This comment has been minimized.

Copy link

terrymun commented Aug 19, 2016

Thanks for the reply @cmdcolin. I don't know much of what is going behind the scenes in JBrowse, but I do agree with your suspicion that the {dataRoot} variable is not being overwritten correctly.

If you have any pointers on how I can help with troubleshooting, do let me know—I'd be more than happy to help!

p/s: A hack-ish fix right now is the following, for a setup that I am using right now. I have two genomes that I want to display (Lotus japonicus genomes v2.5 and v3.0), but I want the latest (i.e. v3.0) to be the default one. The ideal directory structure will be storing all the genomes into a folder (genomes/lotus-japonicus/v[number]). However, v3.0 will be forced to reside in the data directory since the dataRoot = data line, once changed, will cause issues.

  1. Leave the line dataRoot = data commented (i.e. use JBrowse defaults)
  2. Define all the genomes available in the JBrowse.conf file as usual
  3. Use .htaccess to map the ideal directory of a designated default genome to data.

A sample JBrowse.conf:

[datasets.lj_v25]
url = ?data=genomes/lotus-japonicus/v2.5
name = <em>L. japonicus</em> v2.5

[datasets.lj_v30]
url = ?data=genomes/lotus-japonicus/v3.0
name = <em>L. japonicus</em> v3.0

For my .htaccess redirect:

# Redirect Lj v3.0 to default data directory of JBrowse
RewriteBase /
RewriteRule ^genome/genomes/lotus-japonicus/v3\.0/(.*)$ /genome/data/$1 [R=301,NC,L]

Right now, the v3.0 genome will be accessible with either data query parameter values: ?data=data or ?data=genomes%2Flotus-japonicus%2Fv3.0.

@rbuels

This comment has been minimized.

Copy link
Collaborator

rbuels commented Jan 30, 2018

Is this still an issue? Does anybody want to take a crack at it, or write a test case against the volvox test data that demonstrates it happening?

@terrymun

This comment has been minimized.

Copy link

terrymun commented Feb 8, 2018

@rbuels I haven't dared to touch the config since then. Has this been fixed in recent releases?

@rbuels

This comment has been minimized.

Copy link
Collaborator

rbuels commented Feb 8, 2018

@rbuels rbuels removed the needs review label Jul 11, 2018

@rbuels rbuels added this to the 1.15.1 milestone Jul 11, 2018

@wafflebot wafflebot bot added the in progress label Jul 26, 2018

@rbuels rbuels closed this in #1144 Jul 30, 2018

rbuels added a commit that referenced this issue Jul 30, 2018

Merge pull request #1144 from GMOD/fix_dataroot_config
Fix problem with dataRoot in config, fixes #627

@wafflebot wafflebot bot removed the in progress label Jul 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.