[Gmod-help] insert size dependent color in gbrowse
Scott Cain
scott at scottcain.net
Tue Apr 27 10:19:19 EDT 2010
Hello Marvin,
I'm cc'ing this to the GBrowse mailing list, since there are lots of
Sam users on the list, and my knowledge of the internals of
Bio::DB::Sam is fairly weak. That said, I'm going to take a crack at
this, and it may even work!
When you are executing a callback like the one you wrote below, it is
being executed on an individual feature, and it doesn't know anything
about it's mated pair. However, it is the child of a feature that
encompasses both of the features in the pair. In other contexts, the
parents method will return the parent object, so you can try it here
too:
fgcolor = sub {
my $f = shift;
my $parent = $f->parent;
my $insertsize = $parent->length;
...
}
I haven't tried this, but I give it a better than 50% chance of working :-)
Scott
On Tue, Apr 27, 2010 at 2:55 AM, Mundry, Marvin <mundry at uni-muenster.de> wrote:
> hi,
> i am visualizing illumia paired end reads using Bio::DB::Sam.
> i would like to set the fgcolor of the pairs according to the insert size in order to easily identify structural variation.
>
> fgcolor = sub {
> my insertsize=???
> if (insertsize>350) {
> return 'red';
> }else{
> if (insertsize<300) {
> return 'red';
> }else{
> return 'green';
> }
> }
> }
>
> how can i retrieve the insert size?
>
> regards,
>
> Marvin Mundry
> Evolutionary Bioinformatics
> Institute for Evolution and Biodiversity
> Huefferstrasse 1, D-48149 Muenster, Germany
> Phone: +49-251-83-21633
> Fax: +49-251-83-24668
> http://www.uni-muenster.de/Evolution.ebb
>
--
------------------------------------------------------------------------
Scott Cain, Ph. D. scott at scottcain dot net
GMOD Coordinator (http://gmod.org/) 216-392-3087
Ontario Institute for Cancer Research
More information about the Gmod-help
mailing list