[Bioperl-l] finding sequence 2000 bp upstream in bioperl?

Kevin Brown Kevin.M.Brown at asu.edu
Wed Jul 2 15:36:43 EDT 2008


Get the start point for a Sequence Feature and request a subseq of the
main object that starts 2000 above that.

my $gb  = new Bio::DB::GenBank;
$entry = $gb->get_Seq_by_id($id);
foreach my $f ($entry->all_SeqFeatures())
{
	if ($f->primary_tag eq 'CDS')
	{
		my $seq = $entry->subseq($f->start - 2000,$f->start -
1);
		$out->write_seq($seq);
	}
}

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of 
> RICHARD GREEN
> Sent: Wednesday, July 02, 2008 11:10 AM
> To: bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] finding sequence 2000 bp upstream in bioperl?
> 
> Howdy Bioperlers,
> 
> Quick question, I have scripts that pull out a sequence from 
> genbank, but I am looking for a command that would extract 
> 2000 base pairs upstream of the sequence. Is there a way to 
> extract just the Gene promoter region from genbank? Any 
> advice that folks can give me a is muchly appreciated.
> 
> Thanks again
> 
> -Rich Green
> 
> 
> 
> 
> _______________________________________________
> 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