[Bioperl-l] About graphic rendering

Lincoln Stein lincoln.stein at gmail.com
Thu Dec 4 18:11:52 UTC 2008


My mistake. The glyph is named "heterogeneous_segments" with an "s"

Lincoln

On Thu, Dec 4, 2008 at 1:07 PM, Paolo Pavan <paolo.pavan at tecnoparco.org>wrote:

> Hi Lincoln, thank you for your answer.
> It actually seems that I don't have a glyph called "heterogeneous_segment",
> maybe is it a BioPerl version problem? I have 1.5.2 installed.
> ( MSG: The requested glyph class, ``heterogeneous_segment'' is not
> available: Can't locate Bio/Graphics/Glyph/heterogeneous_segment.pm in
> @INC ... )
>
> However, I could even use a generic glyph if I can change the color of the
> external features. I tried to use a bump = 0 but this cause to collapse more
> segments I would like to add.
> This is the graphic initialization part of the code:
>
>         my $axis = Bio::SeqFeature::Generic-> new(
>                              -start => 0,
>                              -end => $database_seq->length
>                                   );
>
>         my $panel = Bio::Graphics::Panel->new (
>                             -length => $database_seq->length,
>                             -width     => $graphic_length,
>                             -pad_left => 10,
>                             -pad_right => 10
>                             );
>
>         $panel->add_track(            $axis,
>                             -glyph    =>'arrow',
>                             -tick    =>2,
>                             -fgcolor=>'black',
>                             -double    =>1
>                             );
>         my $track = $panel->add_track(
>                             -glyph     => 'generic',
>                             -label     => 1,
>                             -bgcolor =>'blue',
>                             #-bump =>1
>                             );
>
> Maybe isn't clear the idea of the final picture I would like to obtain?
>
> Thank you again.
>
> 2008/12/4 Lincoln Stein <lincoln.stein at gmail.com>
>
> Which glyph are you using to display these features? You may wish to set
>> the bump property to zero so that the features don't spread out vertically;
>> this happens automatically with some of the glyphs such as
>> "heterogeneous_segment"
>>
>> Lincoln
>>
>> On Wed, Dec 3, 2008 at 1:21 PM, Paolo Pavan <paolo.pavan at tecnoparco.org>wrote:
>>
>>> Hi everybody,
>>> I've a question about a Bio::Graphics rendering. I would like to display
>>> a
>>> blast HSP on a track but I would like to draw the "tails" of my mapping
>>> sequence that don't match the subject. So I instantiate these 3 object
>>> that
>>> represent all the three segments I want to display:
>>>
>>> my $feature = Bio::SeqFeature::Generic->new(
>>>                                    -display_name
>>> =>$sequence_to_map->display_id,
>>>                                    -start        =>$hsp->sbjct->start,
>>>                                    -end        =>$hsp->sbjct->end,
>>>                                    );
>>> my $feature_pre = Bio::SeqFeature::Generic->new(
>>>                                    -start        =>($hsp->sbjct->start -
>>> $hsp->query->start),
>>>                                    -end        =>$hsp->sbjct->start-1
>>>                                    );
>>> my $feature_post = Bio::SeqFeature::Generic->new(
>>>                                     -start        => $hsp->sbjct->end+1,
>>>                                     -end        => $hsp->sbjct->end +
>>> $sequence_to_map->length - $hsp->query->end
>>>                                    );
>>>
>>> now I have to add these features to my $track in a manner that the
>>> $feature_pre and $feature_post paint or color in a different way than
>>> $feature but align horizontally.
>>> I tried with:
>>>
>>> $feature->add_sub_SeqFeature($feature_pre, 'EXPAND');
>>> $feature->add_sub_SeqFeature($feature_post, 'EXPAND');
>>>
>>> $track->add_feature($feature);
>>>
>>> This does not work, because the features spread vertically, and more I
>>> cannot change the glyph because seems to be a track property, not a
>>> feature
>>> one.
>>>  Any idea?
>>>
>>> Thank you for your help,
>>> Paolo
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
>>
>>
>>
>> --
>> Lincoln D. Stein
>>
>> Ontario Institute for Cancer Research
>> 101 College St., Suite 800
>> Toronto, ON, Canada M5G0A3
>> 416 673-8514
>> Assistant: Stacey Quinn <Stacey.Quinn at oicr.on.ca>
>>
>> Cold Spring Harbor Laboratory
>> 1 Bungtown Road
>> Cold Spring Harbor, NY 11724 USA
>> (516) 367-8380
>> Assistant: Sandra Michelsen <michelse at cshl.edu>
>>
>
>


-- 
Lincoln D. Stein

Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Stacey Quinn <Stacey.Quinn at oicr.on.ca>

Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724 USA
(516) 367-8380
Assistant: Sandra Michelsen <michelse at cshl.edu>



More information about the Bioperl-l mailing list