Get scaffold name

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

Get scaffold name

Alexey Morozov
Dear colleagues,
how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:

balloon click = sub
        {
        my $feature=shift;
        my $text=$feature->name.'<br>';
        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
        return $text;
        }


I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
$feature->location->seq_id doesn't work.

And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Get scaffold name

Timothy Parnell
Alexey,

The feature returned is going to be some Bio::SeqFeatureI compliant object, so you should be able to simply call the seq_id method to retrieve the chromosome name. Look at the API documentation for Bio::SeqFeatureI and Bio::SeqFeature::Lite for more information and examples.

There are five values that are passed to the subroutine. The feature object is the first of them. They are detailed here
http://gmod.org/wiki/GBrowse_2.0_HOWTO#Advanced_Datasource_Configuration_Topics

Balloons get some simple variables for substitution without having to write a perl subroutine. I’m not sure if seq_id is one of them or not. You can try. More info here
http://gmod.org/wiki/GBrowse_Configuration/Balloons

I hope that helps.
Tim


On Aug 27, 2014, at 1:52 AM, Alexey Morozov <[hidden email]<mailto:[hidden email]>> wrote:

Dear colleagues,
how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:

balloon click = sub
        {
        my $feature=shift;
        my $text=$feature->name.'<br>';
        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
        return $text;
        }


I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
$feature->location->seq_id doesn't work.

And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Get scaffold name

Scott Cain
I can't look it up at the moment, but I think $ref is one of the "simple" variables you can use without a callback, in addition to $name, $description, $start and $end.

Scott


Sent from my iPhone

> On Aug 27, 2014, at 12:27 PM, Timothy Parnell <[hidden email]> wrote:
>
> Alexey,
>
> The feature returned is going to be some Bio::SeqFeatureI compliant object, so you should be able to simply call the seq_id method to retrieve the chromosome name. Look at the API documentation for Bio::SeqFeatureI and Bio::SeqFeature::Lite for more information and examples.
>
> There are five values that are passed to the subroutine. The feature object is the first of them. They are detailed here
> http://gmod.org/wiki/GBrowse_2.0_HOWTO#Advanced_Datasource_Configuration_Topics
>
> Balloons get some simple variables for substitution without having to write a perl subroutine. I’m not sure if seq_id is one of them or not. You can try. More info here
> http://gmod.org/wiki/GBrowse_Configuration/Balloons
>
> I hope that helps.
> Tim
>
>
> On Aug 27, 2014, at 1:52 AM, Alexey Morozov <[hidden email]<mailto:[hidden email]>> wrote:
>
> Dear colleagues,
> how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:
>
> balloon click = sub
>        {
>        my $feature=shift;
>        my $text=$feature->name.'<br>';
>        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
>        return $text;
>        }
>
>
> I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
> $feature->location->seq_id doesn't work.
>
> And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
> --
> Alexey Morozov,
> LIN SB RAS, bioinformatics group.
> Irkutsk, Russia.
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/_______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Get scaffold name

Alexey Morozov
Thanks Timothy, $feature->seq_id really is present in the feature and returns the sequence feature is on. In case someone else needs it, neither $ref, nor $name or $start are defined within balloon call (and presumably other glyph-specific calls).


2014-08-28 3:00 GMT+09:00 Scott Cain <[hidden email]>:
I can't look it up at the moment, but I think $ref is one of the "simple" variables you can use without a callback, in addition to $name, $description, $start and $end.

Scott


Sent from my iPhone

> On Aug 27, 2014, at 12:27 PM, Timothy Parnell <[hidden email]> wrote:
>
> Alexey,
>
> The feature returned is going to be some Bio::SeqFeatureI compliant object, so you should be able to simply call the seq_id method to retrieve the chromosome name. Look at the API documentation for Bio::SeqFeatureI and Bio::SeqFeature::Lite for more information and examples.
>
> There are five values that are passed to the subroutine. The feature object is the first of them. They are detailed here
> http://gmod.org/wiki/GBrowse_2.0_HOWTO#Advanced_Datasource_Configuration_Topics
>
> Balloons get some simple variables for substitution without having to write a perl subroutine. I’m not sure if seq_id is one of them or not. You can try. More info here
> http://gmod.org/wiki/GBrowse_Configuration/Balloons
>
> I hope that helps.
> Tim
>
>
> On Aug 27, 2014, at 1:52 AM, Alexey Morozov <[hidden email]<mailto:[hidden email]>> wrote:
>
> Dear colleagues,
> how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:
>
> balloon click = sub
>        {
>        my $feature=shift;
>        my $text=$feature->name.'<br>';
>        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
>        return $text;
>        }
>
>
> I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
> $feature->location->seq_id doesn't work.
>
> And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
> --
> Alexey Morozov,
> LIN SB RAS, bioinformatics group.
> Irkutsk, Russia.
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/_______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Get scaffold name

Scott Cain
Hi Alexey,

Just to be clear, what Tim and I were referring to were special variables that are used outside of callbacks to make writing things like links and balloons easier.  See the tutorial for more info:


Scott



On Thu, Aug 28, 2014 at 12:32 AM, Alexey Morozov <[hidden email]> wrote:
Thanks Timothy, $feature->seq_id really is present in the feature and returns the sequence feature is on. In case someone else needs it, neither $ref, nor $name or $start are defined within balloon call (and presumably other glyph-specific calls).


2014-08-28 3:00 GMT+09:00 Scott Cain <[hidden email]>:

I can't look it up at the moment, but I think $ref is one of the "simple" variables you can use without a callback, in addition to $name, $description, $start and $end.

Scott


Sent from my iPhone

> On Aug 27, 2014, at 12:27 PM, Timothy Parnell <[hidden email]> wrote:
>
> Alexey,
>
> The feature returned is going to be some Bio::SeqFeatureI compliant object, so you should be able to simply call the seq_id method to retrieve the chromosome name. Look at the API documentation for Bio::SeqFeatureI and Bio::SeqFeature::Lite for more information and examples.
>
> There are five values that are passed to the subroutine. The feature object is the first of them. They are detailed here
> http://gmod.org/wiki/GBrowse_2.0_HOWTO#Advanced_Datasource_Configuration_Topics
>
> Balloons get some simple variables for substitution without having to write a perl subroutine. I’m not sure if seq_id is one of them or not. You can try. More info here
> http://gmod.org/wiki/GBrowse_Configuration/Balloons
>
> I hope that helps.
> Tim
>
>
> On Aug 27, 2014, at 1:52 AM, Alexey Morozov <[hidden email]<mailto:[hidden email]>> wrote:
>
> Dear colleagues,
> how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:
>
> balloon click = sub
>        {
>        my $feature=shift;
>        my $text=$feature->name.'<br>';
>        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
>        return $text;
>        }
>
>
> I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
> $feature->location->seq_id doesn't work.
>
> And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
> --
> Alexey Morozov,
> LIN SB RAS, bioinformatics group.
> Irkutsk, Russia.
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/_______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.



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

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Get scaffold name

Alexey Morozov
Ah, got it. I sort of got it mixed with perl variables and/or methods defined within callbacks (which was what I actually needed).


2014-08-28 22:03 GMT+09:00 Scott Cain <[hidden email]>:
Hi Alexey,

Just to be clear, what Tim and I were referring to were special variables that are used outside of callbacks to make writing things like links and balloons easier.  See the tutorial for more info:


Scott



On Thu, Aug 28, 2014 at 12:32 AM, Alexey Morozov <[hidden email]> wrote:
Thanks Timothy, $feature->seq_id really is present in the feature and returns the sequence feature is on. In case someone else needs it, neither $ref, nor $name or $start are defined within balloon call (and presumably other glyph-specific calls).


2014-08-28 3:00 GMT+09:00 Scott Cain <[hidden email]>:

I can't look it up at the moment, but I think $ref is one of the "simple" variables you can use without a callback, in addition to $name, $description, $start and $end.

Scott


Sent from my iPhone

> On Aug 27, 2014, at 12:27 PM, Timothy Parnell <[hidden email]> wrote:
>
> Alexey,
>
> The feature returned is going to be some Bio::SeqFeatureI compliant object, so you should be able to simply call the seq_id method to retrieve the chromosome name. Look at the API documentation for Bio::SeqFeatureI and Bio::SeqFeature::Lite for more information and examples.
>
> There are five values that are passed to the subroutine. The feature object is the first of them. They are detailed here
> http://gmod.org/wiki/GBrowse_2.0_HOWTO#Advanced_Datasource_Configuration_Topics
>
> Balloons get some simple variables for substitution without having to write a perl subroutine. I’m not sure if seq_id is one of them or not. You can try. More info here
> http://gmod.org/wiki/GBrowse_Configuration/Balloons
>
> I hope that helps.
> Tim
>
>
> On Aug 27, 2014, at 1:52 AM, Alexey Morozov <[hidden email]<mailto:[hidden email]>> wrote:
>
> Dear colleagues,
> how do I programmatically get a name of the scaffold my feature is on? I'm writing a bubble click sub and it goes like this:
>
> balloon click = sub
>        {
>        my $feature=shift;
>        my $text=$feature->name.'<br>';
>        $text.='<a href=/gb2/gbrowse/subset/?q=scaffold00001:'.$feature->start.'..'.$feature->end.'>Zoom to feature</a><br><a href=/IPS/'.$feature->name.'-mRNA-1.html>IPS results</a><br>';
>        return $text;
>        }
>
>
> I want to replace currently hardcoded 'scaffold00001' to something that will give me an actual scaffold name.
> $feature->location->seq_id doesn't work.
>
> And expanding the question, is the API available from inside *.conf files described somewhere? Like, what modules are loaded, what varibles are available and so on.
> --
> Alexey Morozov,
> LIN SB RAS, bioinformatics group.
> Irkutsk, Russia.
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/_______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.



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



--
Alexey Morozov,
LIN SB RAS, bioinformatics group.
Irkutsk, Russia.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse