[Bioperl-l] Extracting gene seq from Bio::DB::GFF

Chris Fields cjfields at uiuc.edu
Fri Aug 11 19:27:21 UTC 2006


Marco,

I guess Bio::DB::GFF::Feature objects are PrimarySeqI?  Looking at
SeqIO::fasta write_seq(), the descriptor is based on the preferred_id_type
and the sequence is obtained from the seq() method. 

Does 'ref($_->seq())' give you Bio::PrimarySeq?  If it does, maybe you
should be using '$out->write_seq($_->seq())' instead, though I don't know if
that will work either.

Chris

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Marco Blanchette
> Sent: Friday, August 11, 2006 1:31 PM
> To: bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] Extracting gene seq from Bio::DB::GFF
> 
> Dear all,
> 
> I used to use this very simple script to extract the gene sequence as a
> fasta flat file from a Bio::DB::GFF database containing the GadFly 4.3
> annotations
> 
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> use Bio::DB::GFF;
> use Bio::SeqIO;
> 
> my $out = Bio::SeqIO->new(    -fh => \*STDOUT,
>                             -format => 'fasta');
> 
> my $db = Bio::DB::GFF->new( -adaptor => 'dbi::mysql',
>                               -dsn => 'dbi:mysql:database=dmel_43_LS');
> 
> while (<>){
>     chomp;
>     my @feat = $db->get_feature_by_name($_);
>     $out->write_seq($_) for @feat;
> }
> 
> Somehow I now get the following output instead of the actual sequences:
> >FBgn0024988 gene:.(FBgn0024988)
> Bio::PrimarySeq=HASH(0x19fd3d8)
> >FBgn0041184 gene:.(FBgn0041184)
> Bio::PrimarySeq=HASH(0x19fa684)
> >FBgn0033636 gene:.(FBgn0033636)
> Bio::PrimarySeq=HASH(0x19e1908)
> 
> What change and what would be the right way to get what I want?
> 
> Many thanks
> 
> Marco
> ______________________________
> Marco Blanchette, Ph.D.
> 
> mblanche at uclink.berkeley.edu
> 
> Donald C. Rio's lab
> Department of Molecular and Cell Biology
> 16 Barker Hall
> University of California
> Berkeley, CA 94720-3204
> 
> Tel: (510) 642-1084
> Cell: (510) 847-0996
> Fax: (510) 642-6062
> --
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list