Discussion:
[Gmod-gbrowse] Feature ID Call back
Robert Petera
2014-04-21 16:26:12 UTC
Permalink
Hello,

I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far

sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;

my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";

my $part1 = "<a href='http://tet.ciliate.org/index.php/feature/details/";
my $part2 = "\'>View This Gene\'s Page</a>";

my $result = join "", $details, $part1, $final, $part2;

return $result;
}

The issue I am currently having is the feature_id part of the url, it uses
the feature name instead of the primary id from the database. I have tried
load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.

The backend i am using is Bio::DB::SeqFeature::Store and here is a sample
of the gff3 file

supercontig2.1 BROAD gene 37065 42616 . - .
ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + .
ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + .
ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + .
ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + .
ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein


Thanks,

Robert Petera
Scott Cain
2014-04-22 17:42:44 UTC
Permalink
Hi Robert,

What you using for a backend for your Bio::DB::SeqFeature::Store database?
My recollection is that the load_id method isn't universally supported
(specifically, I don't think it works with the memory/file adaptor).

Scott
Post by Robert Petera
Hello,
I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far
sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;
my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";
my $part1 = "<a href='http://tet.ciliate.org/index.php/feature/details/";
my $part2 = "\'>View This Gene\'s Page</a>";
my $result = join "", $details, $part1, $final, $part2;
return $result;
}
The issue I am currently having is the feature_id part of the url, it uses
the feature name instead of the primary id from the database. I have tried
load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.
The backend i am using is Bio::DB::SeqFeature::Store and here is a sample
of the gff3 file
supercontig2.1 BROAD gene 37065 42616 . - . ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + . ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + . ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + . ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + . ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein
Thanks,
Robert Petera
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gmod-gbrowse mailing list
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain dot
net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
Scott Cain
2014-04-22 18:27:59 UTC
Permalink
Hi Robert,

Let's back up a few steps: what are you trying to accomplish? Is this
going into a bubble that will have a few links in it (just want to make
sure I'm heading in the right direction)?

I'm a little worried about the "name=;" in the url you're generating. The
name method (which is an alias for the display_name method) won't do what
you expect since tag names are case sensitive: "name" is not the same as
"Name" and the GFF spec requires "Name". Even if it were Name, it still
doesn't look like your split call would do anything, but perhaps there are
other names in the GFF file that it would work on. The same is true for
the note tag; it should be Note. (I realize you didn't ask about any of
this, but you're likely to run into problems with it in the future; you
should complain to the Broad about them making non-compliant GFF3).

Now, back to things that you're asking about: I'm not sure I see the
problem. The id method gets an internal id so that you can easily uniquely
identify the feature, which is exactly what you want for the
gbrowse_details page. Since you have that id, you can leave out a lot of
the other stuff from the url you're generating (class, start, end, ref,
name) and the url should still work.

Scott
MySql is the backend I am using
Post by Scott Cain
Hi Robert,
What you using for a backend for your Bio::DB::SeqFeature::Store
database? My recollection is that the load_id method isn't universally
supported (specifically, I don't think it works with the memory/file
adaptor).
Scott
Post by Robert Petera
Hello,
I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far
sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;
my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";
my $part1 = "<a href='http://tet.ciliate.org/index.php/feature/details/
";
my $part2 = "\'>View This Gene\'s Page</a>";
my $result = join "", $details, $part1, $final, $part2;
return $result;
}
The issue I am currently having is the feature_id part of the url, it
uses the feature name instead of the primary id from the database. I have
tried load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.
The backend i am using is Bio::DB::SeqFeature::Store and here is a
sample of the gff3 file
supercontig2.1 BROAD gene 37065 42616 . - . ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + . ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + . ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + . ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + . ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein
Thanks,
Robert Petera
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gmod-gbrowse mailing list
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain
dot net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain dot
net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
Robert Petera
2014-04-22 20:46:06 UTC
Permalink
Ok so I am trying to accomplish a balloon popup that has two links, one to
the gbrowse gene details page, and one to the wiki. The link to the wiki
needs a name change from TTHMIC to TTHERM so that the url to the wiki page
is correct. The gene details page is is from gbrowse like when you click on
a track gene and it brings you to that gene details page. The issue is that
the variables that I call for the url generation, one of them is not what
is supposed to be called. Whenever i call the id i get the name instead,
not the primary key from the database. Here is what i get for my url from
my subroutine:

gbrowse_details/tetrahymena_MIC?ref=supercontig2.1;start=43023;end=44543;name=;class=Sequence;feature_id=TTHMIC_00290610;db_id=general

now this is the one that is correct by using default settings:

gbrowse_details/tetrahymena_MIC?ref=supercontig2.1;start=43023;end=44543;name=TTHMIC_00290610;class=Sequence;feature_id=1468;db_id=tetrahymenaMic%3Adatabase

I can see why name would cause a problem and i will see what i can do about
that. As you can see the feature_id in the url differs which cause the page
not to load. I use the id variable given by your wiki page, but it gives me
the gene name instead of the primary key id.
Post by Scott Cain
Hi Robert,
Let's back up a few steps: what are you trying to accomplish? Is this
going into a bubble that will have a few links in it (just want to make
sure I'm heading in the right direction)?
I'm a little worried about the "name=;" in the url you're generating. The
name method (which is an alias for the display_name method) won't do what
you expect since tag names are case sensitive: "name" is not the same as
"Name" and the GFF spec requires "Name". Even if it were Name, it still
doesn't look like your split call would do anything, but perhaps there are
other names in the GFF file that it would work on. The same is true for
the note tag; it should be Note. (I realize you didn't ask about any of
this, but you're likely to run into problems with it in the future; you
should complain to the Broad about them making non-compliant GFF3).
Now, back to things that you're asking about: I'm not sure I see the
problem. The id method gets an internal id so that you can easily uniquely
identify the feature, which is exactly what you want for the
gbrowse_details page. Since you have that id, you can leave out a lot of
the other stuff from the url you're generating (class, start, end, ref,
name) and the url should still work.
Scott
MySql is the backend I am using
Post by Scott Cain
Hi Robert,
What you using for a backend for your Bio::DB::SeqFeature::Store
database? My recollection is that the load_id method isn't universally
supported (specifically, I don't think it works with the memory/file
adaptor).
Scott
On Mon, Apr 21, 2014 at 12:26 PM, Robert Petera <
Post by Robert Petera
Hello,
I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far
sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;
my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";
my $part1 = "<a href='
http://tet.ciliate.org/index.php/feature/details/";
my $part2 = "\'>View This Gene\'s Page</a>";
my $result = join "", $details, $part1, $final, $part2;
return $result;
}
The issue I am currently having is the feature_id part of the url, it
uses the feature name instead of the primary id from the database. I have
tried load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.
The backend i am using is Bio::DB::SeqFeature::Store and here is a
sample of the gff3 file
supercontig2.1 BROAD gene 37065 42616 . - . ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + . ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + . ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + . ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + . ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein
Thanks,
Robert Petera
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gmod-gbrowse mailing list
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain
dot net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain
dot net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
Robert Petera
2014-04-22 17:45:20 UTC
Permalink
MySql is the backend I am using
Post by Scott Cain
Hi Robert,
What you using for a backend for your Bio::DB::SeqFeature::Store database?
My recollection is that the load_id method isn't universally supported
(specifically, I don't think it works with the memory/file adaptor).
Scott
Post by Robert Petera
Hello,
I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far
sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;
my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";
my $part1 = "<a href='http://tet.ciliate.org/index.php/feature/details/
";
my $part2 = "\'>View This Gene\'s Page</a>";
my $result = join "", $details, $part1, $final, $part2;
return $result;
}
The issue I am currently having is the feature_id part of the url, it
uses the feature name instead of the primary id from the database. I have
tried load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.
The backend i am using is Bio::DB::SeqFeature::Store and here is a sample
of the gff3 file
supercontig2.1 BROAD gene 37065 42616 . - . ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + . ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + . ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + . ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + . ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein
Thanks,
Robert Petera
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gmod-gbrowse mailing list
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain
dot net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
Scott Cain
2014-04-25 17:56:30 UTC
Permalink
Hi Robert,

The gbrowse_details cgi will generally do the best it can with what you
give it. For example, this URL works:


http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?name=TTHMIC_00290610;db_id=general

so as long as name is unique in the database, you can use that. Is that
good enough for you? (I realize that this is really a work around to
something that feels like a bug, but so it goes.)

Scott
Post by Robert Petera
Hello,
I am a student at Bradley University working the TGD model organism
database. I am having an issue with id callbacks in my subroutine. Here is
my subroutine so far
sub {
my $f = shift;
my $name = $f->name;
my $ref = $f->ref;
my $start = $f->start;
my $end = $f->end;
my $class = $f->class;
my $id = $f->id;
my $ttherm = "TTHERM_";
my($first, $rest) = split(/_/, $name, 2);
my $final = $ttherm . $rest;
my $details = "<a href='
http://www.ciliate.org/gb2/gbrowse_details/tetrahymena_MIC?ref=$ref;start=$start;end=$end;name=;class=$class;feature_id=$id;db_id=general'>View
Gene Details</a><br/>";
my $part1 = "<a href='http://tet.ciliate.org/index.php/feature/details/";
my $part2 = "\'>View This Gene\'s Page</a>";
my $result = join "", $details, $part1, $final, $part2;
return $result;
}
The issue I am currently having is the feature_id part of the url, it uses
the feature name instead of the primary id from the database. I have tried
load_id and it gives me the same result. Any help on this would be
appreciated. You can ignore the part1 and part2 strings as they are not a
part of the problem.
The backend i am using is Bio::DB::SeqFeature::Store and here is a sample
of the gff3 file
supercontig2.1 BROAD gene 37065 42616 . - . ID=TTHMIC_02655509;name=02655509;note=hypothetical
protein
supercontig2.1 BROAD gene 43023 44543 . + . ID=TTHMIC_00290610;name=00290610;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 49932 50240 . + . ID=TTHMIC_00290620;name=00290620;note=hypothetical
protein
supercontig2.1 BROAD gene 52924 54424 . + . ID=TTHMIC_02655510;name=02655510;note=leishmanolysin
family protein
supercontig2.1 BROAD gene 65346 66180 . + . ID=TTHMIC_02655511;name=02655511;note=leishmanolysin-like
protein
Thanks,
Robert Petera
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gmod-gbrowse mailing list
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain dot
net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
Loading...