[Bioperl-l] Bio::Graphics::Panel

Lincoln Stein lstein at cshl.edu
Mon May 23 13:04:01 EDT 2005


You can't mix connectors like that, but you can pass a callback to 
-connector=> that will work just as well.  The other problem you're 
experiencing is from using Bio::Seq, rather than Bio::SeqFeature::Generic.

Lincoln

On Thursday 14 April 2005 09:38 am, Horvath Tamas wrote:
> I gather information about certain sequences from some different files,
> and I want to display the gathered information. Therefore I create a
> Bio::Seq object, add features to it, and then I try to display it.
> Here's the code, that supposed to do that:
>
>      my @features = ();
>      my $id = $record->{SEQ_ID};
>      #I had to type in a fake code, otherwise the script stopped
> complaining #that the 'abc' couldn't be guessed
>      $seqobj = Bio::Seq->new( -seq =>
> 'ATCTGATTAGGCTAGCATAATTTGGCATGCATGCATGCATCGACTAGCATCGATCAGATCGAGCATCGATCAGC
>ATCGATC', -id  => $id,
>                  -accession_number => $id,
>                    );
>      push( @features, new Bio::SeqFeature::Generic(-start   =>
> $record->{L_TIR_START},
>                                        -end     => $record->{L_TIR_END},
>                                        -primary => 'repeat_L',
>                                        -source  => 'internal' ) );
>
>      foreach $exon (@{$record->{EXON_LIST}}) {
>
>          push( @features, new Bio::SeqFeature::Generic(-start   =>
> $exon->{START},
>                                        -end     => $exon->{END},
>                                        -primary => 'exon',
>                                        -source  => 'internal' ) );
>         }
>      push( @features, new Bio::SeqFeature::Generic(-start   =>
> $record->{R_TIR_START},
>                                        -end     => $record->{R_TIR_END},
>                                        -primary => 'repeat_R',
>                                        -source  => 'internal' ) );
>
>      foreach $feat (@features) {$seqobj->add_SeqFeature($feat);}
>
>      my %glypher = (
>                     repeat_L => 'arrow',
>                     exon => 'generic',
>                     repeat_R => 'arrow'
>                    );
>      #would this work afterall? I know I can mix features, but can I mix
> connectors as               #well?
>      my %connector= (
>                       repeat_L => 'none',
>                       exon => 'hat',
>                       repeat_R => 'none'
>                     );
>
>      #the following add_track function will cause the error
>      $panel->add_track($seqobj,
>            -glyph  => \%glypher,
>            -bgcolor => 'green',
>            -connector => \%connector,
>            -label  => 0,
>           );
>     print "track finished\n";
>
> The error is:
> Can't locate object method "seq_id" via package "Bio::Seq" at
> /usr/lib/perl5/site_perl/5.8.5/Bio/Graphics/Feature.pm line 269, <DATA>
> line 191.
>
> Can u suggest me what the problem can be, or some other way you would do
> the same thing (displaying the info)
>
> Thanks,
> Hota
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724


More information about the Bioperl-l mailing list