quick and dirty adding gbrowse iframe to gene page

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

quick and dirty adding gbrowse iframe to gene page

Scott Cain
Hi all,

Is there a quick and dirty way to add an iframe to the gene nodes that
will put a dynamic url src for gbrowse_img (or jbrowse for that
matter, I don't care) in an iframe on the page?  I'm guessing I'd have
to start editing php code.

Scott


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

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal
Reply | Threaded
Open this post in threaded view
|

Re: quick and dirty adding gbrowse iframe to gene page

Stephen Ficklin-2
Hi Scott,

I believe you can do this by editing the template file for features (no iframe needed).   But, yes, it will require a bit of  coding

Try adding a line like this to the theme_tripal/node-chado-feature.tpl.php template file:

<img src="<gbrowse_link>?name=$feature->name;type=<track1>+<track2>+<track3>;" border="0">

substitute the URL for your gbrowse setup for <gbrowse_link> and substitute the tracks you want to show in the image for the <track1>. <track2> etc.

If your Tripal installation shows more than just 'genes' then you may want to wrap that <img> stanza in an if statement checking on the value of the $feature->cvname field before displaying.

Does that make sense?

Stephen




On Wed, Sep 8, 2010 at 3:42 PM, Scott Cain <[hidden email]> wrote:
Hi all,

Is there a quick and dirty way to add an iframe to the gene nodes that
will put a dynamic url src for gbrowse_img (or jbrowse for that
matter, I don't care) in an iframe on the page?  I'm guessing I'd have
to start editing php code.

Scott


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

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal
Reply | Threaded
Open this post in threaded view
|

Re: quick and dirty adding gbrowse iframe to gene page

Scott Cain
Hi Stephen,

Yes, that makes perfect sense; with a little (or possibly a lot) of
fiddling, I could probably even get it to respect the image map that
gbrowse_img makes, but that is for another time.  I ended up doing
this:

  <a href="/cgi-bin/gb2/gbrowse/chado/?name=<?php print
$feature->featurename; ?>" target="_blank"><img
src="/cgi-bin/gb2/gbrowse_img/chado/?name=<?php print
$feature->featurename;
?>;l=Genes%1ECDS%1Eest2genome%1Eblastnest%1Eprotein2genome%1Eblastxmatch;width=400"
border="0"></a>

so that a click on the image opens a new tab to GBrowse for the same
region.  I had to experiment a little with the parameters, as I think
they changed a little since GBrowse1 (which is the last time I used it
in any programmatic sense).  I know from a thread on the GBrowse
mailing list that I should probably add the "id" parameter to get
gbrowse_img to cache the image; I may futz with that if I have time.

Thanks,
Scott


On Wed, Sep 8, 2010 at 7:06 PM, Stephen Ficklin <[hidden email]> wrote:

> Hi Scott,
> I believe you can do this by editing the template file for features (no
> iframe needed).   But, yes, it will require a bit of  coding
> Try adding a line like this to the theme_tripal/node-chado-feature.tpl.php
> template file:
> <img
> src="<gbrowse_link>?name=$feature->name;type=<track1>+<track2>+<track3>;"
> border="0">
> substitute the URL for your gbrowse setup for <gbrowse_link> and substitute
> the tracks you want to show in the image for the <track1>. <track2> etc.
> If your Tripal installation shows more than just 'genes' then you may want
> to wrap that <img> stanza in an if statement checking on the value of the
> $feature->cvname field before displaying.
> Does that make sense?
> Stephen
>
>
>
> On Wed, Sep 8, 2010 at 3:42 PM, Scott Cain <[hidden email]> wrote:
>>
>> Hi all,
>>
>> Is there a quick and dirty way to add an iframe to the gene nodes that
>> will put a dynamic url src for gbrowse_img (or jbrowse for that
>> matter, I don't care) in an iframe on the page?  I'm guessing I'd have
>> to start editing php code.
>>
>> Scott
>>
>>
>> --
>> ------------------------------------------------------------------------
>> Scott Cain, Ph. D.                                   scott at scottcain
>> dot net
>> GMOD Coordinator (http://gmod.org/)                     216-392-3087
>> Ontario Institute for Cancer Research
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net Dev2Dev email is sponsored by:
>>
>> Show off your parallel programming skills.
>> Enter the Intel(R) Threading Challenge 2010.
>> http://p.sf.net/sfu/intel-thread-sfd
>> _______________________________________________
>> Gmod-tripal mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-tripal
>
>



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

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal
Reply | Threaded
Open this post in threaded view
|

Re: quick and dirty adding gbrowse iframe to gene page

Stephen Ficklin-2
Oops, I forgot to put the references to the $feature variable inside <?php> blocks but you corrected that.  Sorry about that.

Stephen

On Thu, Sep 9, 2010 at 12:00 AM, Scott Cain <[hidden email]> wrote:
Hi Stephen,

Yes, that makes perfect sense; with a little (or possibly a lot) of
fiddling, I could probably even get it to respect the image map that
gbrowse_img makes, but that is for another time.  I ended up doing
this:

 <a href="/cgi-bin/gb2/gbrowse/chado/?name=<?php print
$feature->featurename; ?>" target="_blank"><img
src="/cgi-bin/gb2/gbrowse_img/chado/?name=<?php print
$feature->featurename;
?>;l=Genes%1ECDS%1Eest2genome%1Eblastnest%1Eprotein2genome%1Eblastxmatch;width=400"
border="0"></a>

so that a click on the image opens a new tab to GBrowse for the same
region.  I had to experiment a little with the parameters, as I think
they changed a little since GBrowse1 (which is the last time I used it
in any programmatic sense).  I know from a thread on the GBrowse
mailing list that I should probably add the "id" parameter to get
gbrowse_img to cache the image; I may futz with that if I have time.

Thanks,
Scott


On Wed, Sep 8, 2010 at 7:06 PM, Stephen Ficklin <[hidden email]> wrote:
> Hi Scott,
> I believe you can do this by editing the template file for features (no
> iframe needed).   But, yes, it will require a bit of  coding
> Try adding a line like this to the theme_tripal/node-chado-feature.tpl.php
> template file:
> <img
> src="<gbrowse_link>?name=$feature->name;type=<track1>+<track2>+<track3>;"
> border="0">
> substitute the URL for your gbrowse setup for <gbrowse_link> and substitute
> the tracks you want to show in the image for the <track1>. <track2> etc.
> If your Tripal installation shows more than just 'genes' then you may want
> to wrap that <img> stanza in an if statement checking on the value of the
> $feature->cvname field before displaying.
> Does that make sense?
> Stephen
>
>
>
> On Wed, Sep 8, 2010 at 3:42 PM, Scott Cain <[hidden email]> wrote:
>>
>> Hi all,
>>
>> Is there a quick and dirty way to add an iframe to the gene nodes that
>> will put a dynamic url src for gbrowse_img (or jbrowse for that
>> matter, I don't care) in an iframe on the page?  I'm guessing I'd have
>> to start editing php code.
>>
>> Scott
>>
>>
>> --
>> ------------------------------------------------------------------------
>> Scott Cain, Ph. D.                                   scott at scottcain
>> dot net
>> GMOD Coordinator (http://gmod.org/)                     216-392-3087
>> Ontario Institute for Cancer Research
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net Dev2Dev email is sponsored by:
>>
>> Show off your parallel programming skills.
>> Enter the Intel(R) Threading Challenge 2010.
>> http://p.sf.net/sfu/intel-thread-sfd
>> _______________________________________________
>> Gmod-tripal mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-tripal
>
>



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


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal