[ensembl-dev] Gene get_all_Transcripts returns null second time

cj5 at sanger.ac.uk cj5 at sanger.ac.uk
Thu Jul 7 10:12:42 BST 2011


Hi,
Could somebody please advise why calling get_all_Transcripts for the same
gene fails the second time in the following code:

my $gene_id = 'ENSG00000223972';
my $gene = $gene_adaptor->fetch_by_stable_id($gene_id);
print "GENE: ". $gene->stable_id ." start ". $gene->start . " end ". 
$gene->end ."\n";

my $transcripts = $gene->get_all_Transcripts();
print "RETRIEVED TRANSCRIPTS:" . scalar(@{$transcripts})."\n";
while ( my $tr = shift @{$transcripts} ) {
    print "TRANSCRIPT:" . $tr->stable_id ." start ". $tr->seq_region_start
." end ". $tr->seq_region_end ."\n";
}

$gene = $gene_adaptor->fetch_by_stable_id($gene_id);
$transcripts = $gene->get_all_Transcripts();
print "RETRIEVED TRANSCRIPTS:" . scalar(@{$transcripts})."\n";
while ( my $tr = shift @{$transcripts} ) {
    print "TRANSCRIPT:" . $tr->stable_id ." start ". $tr->seq_region_start
." end ". $tr->seq_region_end ."\n";
}

ie output is
GENE: ENSG00000223972 start 11869 end 14409
RETRIEVED TRANSCRIPTS:2
TRANSCRIPT:ENST00000456328 start 11869 end 14409
TRANSCRIPT:ENST00000450305 start 12010 end 13670
RETRIEVED TRANSCRIPTS:0
I'm using ensembl version 62
Thanks



-- 
Chris Joyce
Team 136, Medical Sequencing
Wellcome Trust Sanger Institute
Tel: 01223 834244 Ext. 6859







More information about the Dev mailing list