[Bioperl-l] GFF synopsis code question

Lincoln Stein lstein at cshl.edu
Thu Mar 18 09:05:25 EST 2004


Thanks for catching that.  This is a typo in the synopsis.  It should 
read:

	my $upstream = $exons[0]->subseq(-1000,0);

Lincoln

On Thursday 18 March 2004 07:30 am, Sean Davis wrote:
> I have been learning to use Bio::DB::GFF and had a question about
> the synopsis code from Bio::DB::GFF.  The section of code is:
>
> -------From Synopsis-------
>   # pull out all transcript features
>   my @transcripts = $segment->features('transcript');
>
>   # for each transcript, total the length of the introns
>   my %totals;
>   for my $t (@transcripts) {
>     my @introns = $t->Intron;
>     $totals{$t->name} += $_->length foreach @introns;
>   }
>
>   # Sort the exons of the first transcript by position
>   my @exons = sort {$a->start <=> $b->start} $transcripts[0]->Exon;
>
>   # Get a region 1000 bp upstream of first exon
>   my $upstream = $exons[0]->segment(-1000,0);
>
>   # get its DNA
>   my $dna = $upstream->dna;
> -------------------------------
>
> It seems here that $exons[0] is a feature, so does not have a
> segment method?  Instead, one can get the segment of interest by:
>
> my $upstream = $db->segment($exons[0],-1000=>0)
>
> Am I mistaken?  I only bring it up as a documentation issue, as the
> code I give works for me.
>
> Sean
>
> _______________________________________________
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20040318/6f86592c/attachment.bin


More information about the Bioperl-l mailing list