Closed srobb1 closed 2 years ago
One possible way, you can replace the "ref renaming behavior" of jbrowse
I tried for example, changing a gff in our volvox test data to say "testingA" instead of "ctgA"
Then I made a custom ref renaming function in jbrowse.conf to say this:
replaceRefRename=function(ref) {
if(ref==='testingA') { return 'ctgA' }
else return ref;
}
See replaceRefRename https://jbrowse.org/docs/global_options.html
note that the closing semi colon is spaced away from the left most column, a way to make multiline callbacks in the conf format :)
note that replaceRefRename is only added in JBrowse 1.16.10 though https://jbrowse.org/blog/2020/09/24/jbrowse-1-16-10.html
Can I create my own custom function like you have above and add it into my functions.conf file? Or will I need to update to 1.16.10? I should update anyway...
Yes, just put it in a [GENERAL] section e.g.
[GENERAL]
replaceRefRename=function(ref) {
/* your code here, make sure to use proper semi-colons and js syntax */
}
and make sure the code follows guidelines like this if using the conf format https://jbrowse.org/docs/configuration_file_formats.html#callback-function-specific-considerations-for-the-text-based-conf-format-
but in order to use replaceRefRename you will need 1.16.10, not able to use that in 1.16.9
I updated to 1.16.11, created a function with my names and ran a test. It works great!
Thank you again @cmdcolin
Sofia
cool :) i wasn't even sure this would work at first but glad it does
I only tested with one alias, but it seems logical that adding in more conditional statements will also work. I don't have a working list from the group yet, but wanted to see if I could get this working before I told them it was possible :)
glad this helped...maybe can close for now!
Hello all,
Is there a way to use and index aliases for reference sequences? I am using JBrowse version: 1.16.9. I have a large assembly for which the group is considering renaming a dozen scaffolds. I thought I have seen a way to include a list of names and aliases for references, but I can only find it for JB2.
Thank you, Sofia