[Bioperl-l] What's wrong with the script about module Bio::SeqFeature::Gene::GeneStructure

Tao Zhu tzhu at mail.bnu.edu.cn
Fri Mar 18 00:33:32 EDT 2011


I wrote my script like this,

#!/usr/bin/perl -w
use Bio::SeqIO;
my $catch_seq = Bio::SeqIO -> new(-file => 'test.gbk',-format=>
'genbank');
while( my $seq_obj = $catch_seq -> next_seq)
{
	my @all_mRNA_features = grep {$_->primary_tag eq 'mRNA'} $seq_obj ->
get_SeqFeatures;
	for my $mRNA_feature (@all_mRNA_features)
	{
			if($mRNA_feature->isa('Bio::SeqFeature::Gene::GeneStructure'))
		{
			@exons=$mRNA_feature->exons;
			$exon_number = scalar(@exons);
			print "$exon_number\n";
		}
	}
}

I hope to count exon number in every mRNA. But it print nothing(You can
arbitrarily get a genbank file to test it). What's wrong?


-- 
Tao Zhu, College of Life Sciences, Beijing Normal University, Beijing
100875, China
Email: tzhu at mail.bnu.edu.cn
Website: http://bnuzt.org (mainly written in Chinese)




More information about the Bioperl-l mailing list