[Bioperl-l] Bio::SeqIO::entrezgene refseq question

Stefan Kirov skirov at utk.edu
Wed Jun 8 10:12:32 EDT 2005

Here it is:
my $seqio = Bio::SeqIO->new(-format => 'entrezgene',
                               -file => $file,
                               -debug => 'on');
   my ($gene,$genestructure,$uncaptured) = $seqio->next_seq;

The object you need is $genestructure- it has all sequence related data- 
genomic contigs,  Refseq, GenBank.
Then to get the data you ask for:
my @seobj=$struct->get_members();
foreach my $seq(@seqobj) {
    next unless (($contig->namespace eq 
'refseq')&&($contig->authority=~/mrna/i)); #skip unless refseq 
transcript, alternatively you can read the protein as well and put it in 
a hash/array
     my @prod=$contig->annotation->get_Annotations('product');
    my $protid=$prod[0]->value if ($prod[0]);#I would expect only one 
Then if you wish you can get the whole record for the protein out of @seqobj
It is not your fault, just the docs are not there yet (any moment now  
:-) )...
Let me know if this helps and if you need anything else.

Sean Davis wrote:

> Stefan and Mingyi,
> I don't think I have officially thanked you both for a nice 
> contribution for those of use using annotation heavily.  I am just 
> picking up with using the new parsers.  Just a quick question:  How 
> would I get something like the gene2refseq file out of the parser?  In 
> particular, I would like to get all rna/protein pairs (as pairs) where 
> they exist, as well as rna and protein that do not have pairs.  I 
> guess I haven't waded into the object structure far enough, yet.
> Thanks,
> Sean
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list