[Bioperl-l] Please help with Bio::Graphics

Jason Stajich jason at cgt.mc.duke.edu
Mon Feb 3 21:26:49 EST 2003


This is probably because the dna glyph is really intended to work with
Bio::DB::GFF directly which has features which have a dna() method.

The best way I could think to do this would be :

#!/usr/bin/perl -w
use strict;

package DNAFeature;
use Bio::SeqFeature::Generic;

use vars qw(@ISA);
@ISA = qw(Bio::SeqFeature::Generic);

sub dna{
    my $self = shift;

    return $self->{'dna'} = shift if @_;
    return $self->{'dna'};
}

package main;

my $gcfeature = DNAFeature->new(-start => 1, -end => $seq->length,-primary_tag => 'gcfeature');

$gcfeature->dna($seq->seq());

...

But I didn't have much luck in getting it to render either but perhaps
Lincoln has better ideas.

-jason

On Mon, 3 Feb 2003, Lucas Quincy Ton wrote:

> Dear all,
>      I have recently started using the Bio::Graphics module to render a png
> picture from an embl-formatted file.  Everything so far looks fine but when I
> coded the 'dna' glyph to render GC-content plot, I get the plot but with just
> a straight line in the middle (50%) from lelf to right.  Would someone please
> gear me to the right direction?  My code is as follow:
>
> #I create a SeqFeature::Generic object
> my $gcfeature = Bio::SeqFeature::Generic->new(-start=>1,
> 					      -end=>$seq->length,);
> #here I attach the whole DNA sequence referenced by $seq to the feature
> #I do this because I read perldoc on dna.pm which specified that "the feature
> #must return a DNA sequence string in response to the dna() method -- so I
> made
> #my best guess as to its meaning
> $gcfeature->attach_seq($seq);
> #now I create a track for GC content
> $panel->add_track($gcfeature,
>      -glyph	=> 'dna',
>      -fgcolor => 'black',
>      -height => 100,
>      -bgcolor => 'red',
>      -do_gc	=> 'true',
>      -gc_bins => 10,
>      -axis_color=> 'blue',
>      -strand => 'forward',);
>
> Any response will be greatly appreciated.
> Lucas Ton.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list