[Bioperl-l] Bio::Graphics : To change scale color & sort and add direction to SeqFeature
Shameer Khadar
shameer at ncbs.res.in
Mon Aug 13 15:16:33 UTC 2007
Chris,
Thanks for your detailed reply.
I will read up the docs and try different options using ur code snippets
as starting point. I will get back to the list with my results.
Thanks
--
Shameer
>
> On Aug 13, 2007, at 6:07 AM, Shameer Khadar wrote:
>
>> Dear All,
>>
>> I am generating images based on Transcription Factor binding site data
>> using bio::graphics module.
>> I created my images using program : version-2
>> [http://stein.cshl.org/genome_informatics/BioGraphics/] (Courtsey : L.
>> Stein ). I attaching one of the image with this mail.
>>
>> I need to make 3 changes to this image
>>
>> 1. to color the 'scale'
>> Color the scale in two different colors ie, from start 1.0k - color
>> blue
>> from 101 - till end of the scale green (I thoroghly checked the
>> Bio::Graphics document, I couldnt find an option to do this )
>
> Much of the documentation you need is available via 'perldoc
> Bio::Graphics::Panel' and the various Bio::Graphics::Glyph classes.
> The above may be possible using two seqfeatures instead of one or
> maybe a split location with a callback (not sure, haven't tried
> either, mileage may vary, batteries not included, warranty void if
> packaging is opened, etc). Might be worth checking out the POD for
> the arrow glyph to see what's possible.
>
>> 2. to sort the Transcription factors based on the z_score
>
> In Bio::Graphics::Panel POD under 'Glyph Options', there is
> documentation for 'sort_order' which accepts callbacks. According to
> the docs you would basically do something like the following (the
> prototype is required; note the score):
>
> -sort_order => sub ($$) {
> my ($glyph1,$glyph2) = @_;
> my $a = $glyph1->feature;
> my $b = $glyph2->feature;
> ( $b->score/log($b->length)
> <=>
> $a->score/log($a->length) )
> ||
> ( $a->start <=> $b->start )
> }
>
> Again, haven't tried.
>
>> 3. to give forward/reverse [> or < ]direction for the black boxes
>
> I think you first need to ensure the glyph will accept strandedness,
> though I think most do. Then you would set either the 'strand_arrow'
> or 'stranded' option to 1 (they are synonyms). Again, see
> Bio::Graphics::Panel POD under Glyph Options, specifically the
> parameter 'stranded' or 'strand_arrow'.
>
--
Shameer Khadar
Lab (# 25) The Computational Biology Group
National Centre for Biological Sciences (TIFR)
GKVK Campus, Bellary Road, Bangalore - 65, Karnataka - India
T - 91-080-23666001 EXT - 6251
W - http://www.ncbs.res.in
More information about the Bioperl-l
mailing list