[Bioperl-l] Bio::DB::GFF problem

Lincoln Stein lstein at cshl.edu
Thu Sep 11 21:07:57 EDT 2003


The enclosed script and its output illustrates what you need to do.  Your 
mistake was to fetch "gene_density" features, which are the unaggregated 
subparts.  You want to fetch features of type "density".  This is the method 
name that you gave to the aggregator, and so is the method name that you need 
to fetch.

Also, you don't need to create an aggregator object.  This shortcut works just 
fine:

	 $db     = Bio::DB::GFF->new(-adaptor    => 'memory',
			      			   -aggregator => 'density{gene_density}');

The ability to use IO::String as input to load_gff() is a relatively new 
feature.

Lincoln

On Wednesday 10 September 2003 05:58 pm, Matthias Wahl wrote:
>   Hi Lincoln,
>
> Thank you very much for your input. The $gff_db->segment call now works
> fine.
>
> However, I am still not able to generate an xyplot. Using the following
> GFF file:
>
> 1    chromosome    Component    1    195869683    .    .    .
> Sequence "1"
> 1    EnsEMBL    gene_density    1    200000    0    .    .
> gene_density "1.density"
> 1    EnsEMBL    gene_density    200001    400000    0    .    .
> gene_density "1.density"
> 1    EnsEMBL    gene_density    400001    600000    0    .    .
> gene_density "1.density"
> 1    EnsEMBL    gene_density    600001    800000    0    .    .
> gene_density "1.density"
> 1    EnsEMBL    gene_density    800001    1000000    0    .    .
> gene_density "1.density"
> 1    EnsEMBL    gene_density    1000001    1200000    0    .    .
> gene_density "1.density"
> ..
>
> I tried to aggregate all gene_density features
>
>   my $aggregator = Bio::DB::GFF::Aggregator->new(-method    => 'density'
>
>                                             -sub_parts => 'gene_density');
>
>   my $gff_db = Bio::DB::GFF->new(-adaptor =>'dbi::mysqlopt',
>
> -dsn=>'dbi:mysql:Mus_musculus_GFF',
>                                                             -user =>
> 'XXXXX',
>                                                             -pass =>
> 'XXXXX, -aggregator => $aggregator,
>                                                             );
>   my $gene_density = $gff_db->segment($chromosome_name) or die "Can not
> retrieve GFF segment: ".$gff_db->error;
>   my @features = $gene_density->features('gene_density');
>
> This all works fine. But when I try to draw a xyplot
>
>   $picture->add_track(\@features,
>                       -glyph => 'xyplot');
>
> I end up with bars in my image, but no plot!
>
> Could you by chance tell me what I am doing wrong?
>
> Many thanks
>
> Matthias
>
> Lincoln Stein wrote:
> >Hi,
> >
> >I'm catching up on my bioperl mail after being on vacation for August. 
> > The problem is that you need an entry for the whole chromosome because
> > the segment() call needs to retrieve it in order to get the length. 
> > Something like this will do the trick:
> >
> >1 EnsEMBL chromosome 1 1502911 . . . Chromosome 1
> >
> >Lincoln
> >
> >On Wednesday 13 August 2003 07:02 pm, Matthias Wahl wrote:
> >>Hi all!
> >>
> >>I have trouble in using Bio::DB::GFF with the following code:
> >>
> >>my $aggregator = Bio::DB::GFF::Aggregator->new(-method    =>
> >> 'gene_density' -sub_parts =>
> >>'EnsEMBL:gene_density');
> >>
> >>my $gff_db = Bio::DB::GFF->new(-adaptor =>'dbi::mysqlopt',
> >>                               -dsn=>'dbi:mysql:Mus_musculus_GFF',
> >>                               -user => 'xxxxx',
> >>			       -pass => 'xxxxx',
> >>			       -aggregator => $aggregator
> >>			       );
> >>
> >>
> >>Calling
> >>
> >>$gff_db->segment(-class=>'Chromosome',
> >>                 -value=>'1');
> >>
> >>always returns undef (whatever arguments I use)!
> >>The database has been generated by loading a GFF file of the following
> >>format:
> >>
> >>1	EnsEMBL gene_density    1000001 2000000 0
> >>Chromosome 1
> >>
> >>1       EnsEMBL gene_density    2000001 3000000 0
> >>Chromosome 1
> >>
> >>1       EnsEMBL gene_density    3000001 4000000 1
> >>Chromosome 1
> >>
> >>1       EnsEMBL gene_density    4000001 5000000 12
> >>Chromosome 1
> >>
> >>1       EnsEMBL gene_density    5000001 6000000 4
> >>Chromosome 1
> >>
> >>with load_gff.PLS (columns are tab-seperated, the 9th column consists of
> >>'Chromosome' and name, seperated by space), both with and without the
> >>associated sequence file.
> >>
> >>Calling
> >>
> >>$gff_db->features()
> >>
> >>works fine. But I need aggregated features for generating a
> >>Bio::Graphics xyplot (to plot the gene density for a particular
> >>chromosome).
> >>
> >>Many thanks,
> >>
> >>Matthias

-- 
Lincoln Stein
lstein at cshl.edu
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gene_density_histo.pl
Type: text/x-perl
Size: 1168 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20030911/e0e4affa/gene_density_histo.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: histogram.png
Type: image/png
Size: 1100 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20030911/e0e4affa/histogram.png


More information about the Bioperl-l mailing list