[Gmod-gbrowse] [Gmod-help] insert size dependent color in gbrowse

Keiran Raine kr2 at sanger.ac.uk
Tue Apr 27 10:31:54 EDT 2010


Hi all,

The insert size is an element of an individual SAM read, but at  
present I am not aware of a method which returns this value.

One thing to note is that the ISIZE (column 9 of a SAM record) is the  
distance between the two 5' ends of the sequencing direction, so for  
Illumina the method below is correct but may not be the case for all  
methods (see the sam format specification for full details), you will  
also need to take into account that the value can be negative.

Ideally having access to the ISIZE field would be a much better option  
as platform/method issues are then not the responsibility of  
Bio::DB::Sam or the person implementing the GBrowse callbacks.

Regards,

Keiran Raine
Senior Computer Biologist
The Cancer Genome Project
Ext: 2100
kr2 at sanger.ac.uk




On 27 Apr 2010, at 15:19, Scott Cain wrote:

> 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
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-gbrowse mailing list
> Gmod-gbrowse at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the Gmod-help mailing list