[Gmod-tripal-devel] GBrowse, JBrowse and Tripal integration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-tripal-devel] GBrowse, JBrowse and Tripal integration

Scott Cain
Hi Stephen and all,

I'm looking a way to put GBrowse and JBrowse iframes in feature pages, presumably as separate tabs (added to the list of resources things that would go along with relationships, annotated sequence, etc).  I would like to do this for the GMOD in the Cloud/Box and would like for it to remain usable from one point release to the next.  I'm guessing there is documentation on how to do something like this; could you please point it out for me?

Also, I want to make links in GBrowse and JBrowse that go to the feature pages in Tripal.  Are the URLs always like lowercase(genus/genus_species/uniquename)?

Thanks,
Scott


--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Gmod-tripal-devel] GBrowse, JBrowse and Tripal integration

Stephen Ficklin-2
Hi Scott,

Would you like for GBrowse or JBrowse to automatically show the feature and all alignments, something like this page: 

http://www.rosaceae.org/prunus/prunus_persica/ppa000475m?block=alignments

But, rather than just an image, you would like the application visible in an iFrame with the feature automatically in view?

I believe you may be able to do this with minimal coding using CCK elements.  Tripal already uses CCK elements to allow for easy addition of new items to the Resources right-sidebar.   Instructions for doing this are on the Tripal v1.1 tutorial:    http://www.gmod.org/wiki/Tripal_Tutorial_v1.1#Adding_New_Resources_To_Pages.   Unfortunately, I have never tried to add a bit of PHP code to the CCK field, which is what you'd need to do to be able to generate a URL for the iFrame for the specific feature shown on the page.  I think it can be done and if you'd like to go this route I can try to help figure out how to do it.

Second, you can do this by creating a custom template file.   There are instructions on the Tripal Developer's Handbook (http://www.gmod.org/wiki/Tripal_Developer's_Handbook) for how to add new template files and using the Tripal API to get data.  In short, here is what you'd do:

1)  Copy all of the templates from the Tripal theme into your default theme directory.  This way, when Tripal is updated your custom templates won't be overwritten
2)  In the tripal_theme/tripal_feature directory, add a new subtemplate file for your iframe content.
3)  Add an 'include' statement in the node-chado_feature.tpl.php file to include your new subtemplate file
4)  Add code to your subtepmlate file for creating the iFrame with the proper URL for displaying the feature.

Once you get used to how the templates work, it is very easy to add new templates, and the Tripal API makes it relatively easy to get data. You shouldn't have to do any SQL queries at all in the template files.   I can provide more specific details depending on how you want to go with this.

Hope this helps,
Stephen


On 10/11/2013 12:46 PM, Scott Cain wrote:
Hi Stephen and all,

I'm looking a way to put GBrowse and JBrowse iframes in feature pages, presumably as separate tabs (added to the list of resources things that would go along with relationships, annotated sequence, etc).  I would like to do this for the GMOD in the Cloud/Box and would like for it to remain usable from one point release to the next.  I'm guessing there is documentation on how to do something like this; could you please point it out for me?

Also, I want to make links in GBrowse and JBrowse that go to the feature pages in Tripal.  Are the URLs always like lowercase(genus/genus_species/uniquename)?

Thanks,
Scott


--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk


_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Gmod-tripal-devel] GBrowse, JBrowse and Tripal integration

Scott Cain
Hi Stephen,

Actually, I don't think it needs to be an iframe--that's just the way I think sometimes.  An image generated by gbrowse_img would be fine, though in addition to what you have in rosaceae, I'd think it would make sense for the image to be a link to the same display in GBrowse (probably opening in a separate window, but those are details).

Also, I want to make sure I understand: you're saying there are two ways I could do it, either by using CCK or by creating a subtemplate, right, I don't do both?  Which is easier and/or more maintainable?

Thanks,
Scott



On Mon, Oct 14, 2013 at 12:00 PM, Stephen Ficklin <[hidden email]> wrote:
Hi Scott,

Would you like for GBrowse or JBrowse to automatically show the feature and all alignments, something like this page: 

http://www.rosaceae.org/prunus/prunus_persica/ppa000475m?block=alignments

But, rather than just an image, you would like the application visible in an iFrame with the feature automatically in view?

I believe you may be able to do this with minimal coding using CCK elements.  Tripal already uses CCK elements to allow for easy addition of new items to the Resources right-sidebar.   Instructions for doing this are on the Tripal v1.1 tutorial:    http://www.gmod.org/wiki/Tripal_Tutorial_v1.1#Adding_New_Resources_To_Pages.   Unfortunately, I have never tried to add a bit of PHP code to the CCK field, which is what you'd need to do to be able to generate a URL for the iFrame for the specific feature shown on the page.  I think it can be done and if you'd like to go this route I can try to help figure out how to do it.

Second, you can do this by creating a custom template file.   There are instructions on the Tripal Developer's Handbook (http://www.gmod.org/wiki/Tripal_Developer's_Handbook) for how to add new template files and using the Tripal API to get data.  In short, here is what you'd do:

1)  Copy all of the templates from the Tripal theme into your default theme directory.  This way, when Tripal is updated your custom templates won't be overwritten
2)  In the tripal_theme/tripal_feature directory, add a new subtemplate file for your iframe content.
3)  Add an 'include' statement in the node-chado_feature.tpl.php file to include your new subtemplate file
4)  Add code to your subtepmlate file for creating the iFrame with the proper URL for displaying the feature.

Once you get used to how the templates work, it is very easy to add new templates, and the Tripal API makes it relatively easy to get data. You shouldn't have to do any SQL queries at all in the template files.   I can provide more specific details depending on how you want to go with this.

Hope this helps,
Stephen



On 10/11/2013 12:46 PM, Scott Cain wrote:
Hi Stephen and all,

I'm looking a way to put GBrowse and JBrowse iframes in feature pages, presumably as separate tabs (added to the list of resources things that would go along with relationships, annotated sequence, etc).  I would like to do this for the GMOD in the Cloud/Box and would like for it to remain usable from one point release to the next.  I'm guessing there is documentation on how to do something like this; could you please point it out for me?

Also, I want to make links in GBrowse and JBrowse that go to the feature pages in Tripal.  Are the URLs always like lowercase(genus/genus_species/uniquename)?

Thanks,
Scott


--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     <a href="tel:216-392-3087" value="+12163923087" target="_blank">216-392-3087
Ontario Institute for Cancer Research


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk


_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel




--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Gmod-tripal-devel] GBrowse, JBrowse and Tripal integration

Stephen Ficklin-2
Hi Scott,

Yes, that's right, you don't do both.    My preference would be to go the route of the template file to add this type of thing.  In both cases you need to add some PHP code, but it makes more sense to me to have all code in a single place.   If you would like for the GBrowse image to appear on the alignment page, similar to the GDR page I linked to before, then that is probably the easiest way to go as you don't need to add a new template file, just copy the tripal_feature directory to your default theme and edit the file tripal_feature/tripal_feature_alignments.tpl.php.  You can use the Tripal API http://www.gmod.org/wiki/Tripal_Developer%27s_Handbook#Accessing_Chado_Data to access the fields from the feature table you need to generate the URL for the image and for the link.   It would be nice if Lacey's GBrowse module could automatically add the image for us, so you don't have to add any code.  If she's following along on the mailing list, perhaps she can chime in if it does this already.

Also, I forgot to answer your other question about the URL for features.   If you go to the feature configuration page at 'Administer' -> 'Tripal Management' -> 'Features' -> 'Configuration' you can see several options that you can set the URLs for features.  So, they do not have go be: http://your.tripal.site/genus/genus_species/uniquename.  You can set it to just be http://your.tripal.site/name or http://your.tripal.site/uniquename of the feature if you know there will never be duplicate names in the database. 

Additionally,  Tripal also has a generic way to link to features.  If you just use this URL, http://your.tripal.site/feature/<name>, where <name> is the name, uniquename, or synonym of the feature.  If more than one feature match the name then the user will be given a list to select from.  If only one feature matches then it will automatically redirect you to the feature page. 

Stephen


On 10/14/2013 2:30 PM, Scott Cain wrote:
Hi Stephen,

Actually, I don't think it needs to be an iframe--that's just the way I think sometimes.  An image generated by gbrowse_img would be fine, though in addition to what you have in rosaceae, I'd think it would make sense for the image to be a link to the same display in GBrowse (probably opening in a separate window, but those are details).

Also, I want to make sure I understand: you're saying there are two ways I could do it, either by using CCK or by creating a subtemplate, right, I don't do both?  Which is easier and/or more maintainable?

Thanks,
Scott



On Mon, Oct 14, 2013 at 12:00 PM, Stephen Ficklin <[hidden email]> wrote:
Hi Scott,

Would you like for GBrowse or JBrowse to automatically show the feature and all alignments, something like this page: 

http://www.rosaceae.org/prunus/prunus_persica/ppa000475m?block=alignments

But, rather than just an image, you would like the application visible in an iFrame with the feature automatically in view?

I believe you may be able to do this with minimal coding using CCK elements.  Tripal already uses CCK elements to allow for easy addition of new items to the Resources right-sidebar.   Instructions for doing this are on the Tripal v1.1 tutorial:    http://www.gmod.org/wiki/Tripal_Tutorial_v1.1#Adding_New_Resources_To_Pages.   Unfortunately, I have never tried to add a bit of PHP code to the CCK field, which is what you'd need to do to be able to generate a URL for the iFrame for the specific feature shown on the page.  I think it can be done and if you'd like to go this route I can try to help figure out how to do it.

Second, you can do this by creating a custom template file.   There are instructions on the Tripal Developer's Handbook (http://www.gmod.org/wiki/Tripal_Developer's_Handbook) for how to add new template files and using the Tripal API to get data.  In short, here is what you'd do:

1)  Copy all of the templates from the Tripal theme into your default theme directory.  This way, when Tripal is updated your custom templates won't be overwritten
2)  In the tripal_theme/tripal_feature directory, add a new subtemplate file for your iframe content.
3)  Add an 'include' statement in the node-chado_feature.tpl.php file to include your new subtemplate file
4)  Add code to your subtepmlate file for creating the iFrame with the proper URL for displaying the feature.

Once you get used to how the templates work, it is very easy to add new templates, and the Tripal API makes it relatively easy to get data. You shouldn't have to do any SQL queries at all in the template files.   I can provide more specific details depending on how you want to go with this.

Hope this helps,
Stephen



On 10/11/2013 12:46 PM, Scott Cain wrote:
Hi Stephen and all,

I'm looking a way to put GBrowse and JBrowse iframes in feature pages, presumably as separate tabs (added to the list of resources things that would go along with relationships, annotated sequence, etc).  I would like to do this for the GMOD in the Cloud/Box and would like for it to remain usable from one point release to the next.  I'm guessing there is documentation on how to do something like this; could you please point it out for me?

Also, I want to make links in GBrowse and JBrowse that go to the feature pages in Tripal.  Are the URLs always like lowercase(genus/genus_species/uniquename)?

Thanks,
Scott


--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     <a moz-do-not-send="true" href="tel:216-392-3087" value="+12163923087" target="_blank">216-392-3087
Ontario Institute for Cancer Research


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk


_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel




--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-tripal-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal-devel