Skip to content
Snippets Groups Projects
Commit c3c2b9e2 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Loop over all transcripts, rather than gene by gene, as it's much faster.

parent 582a9a84
No related branches found
No related tags found
No related merge requests found
......@@ -57,23 +57,22 @@ for my $dbname ( @dbnames ) {
}
my %biotypes = ();
print STDERR "Finding frameshifts in $dbname, creating transcript attributes ...\n";
print STDERR "Attributes will not be stored in database\n" if ($nostore);
my $count = 0;
# get all transcripts for each gene, then look at each of their introns in turn
foreach my $gene (@{$gene_adaptor->fetch_all()}) {
# get all transcripts then look at each of their introns in turn
my @transcripts = @{$transcript_adaptor->fetch_all()};
my $gene_has_short_introns = undef;
foreach my $transcript (@transcripts) {
foreach my $transcript (@{$gene->get_all_Transcripts()}) {
#print "Transcript " . $trans_no++ . " of " . scalar(@transcripts) . "\n";
my $intron_number = 1;
my $intron_number = 1;
foreach my $intron (@{$transcript->get_all_Introns()}) {
foreach my $intron (@{$transcript->get_all_Introns()}) {
# only interested in the short ones
if ($intron->length() < 6 && $intron->length() != 3) {
......@@ -89,8 +88,6 @@ for my $dbname ( @dbnames ) {
$attribute_adaptor->store_on_Transcript($transcript->dbID, \@attribs) if (!$nostore);
$gene_has_short_introns = 1;
$count++;
}
......@@ -101,22 +98,11 @@ for my $dbname ( @dbnames ) {
} # foreach transcript
$biotypes{$gene->biotype()}++ if ($gene_has_short_introns);
} # foreach gene
if ($count) {
print "$count short intron attributes\n";
print "Attributes not stored in database\n" if ($nostore);
print "Biotypes of affected genes:\n";
foreach my $biotype (keys %biotypes) {
print $biotype . "\t" . $biotypes{$biotype} . "\n";
}
print "\n";
} else {
print "No frameshift introns found!\n";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment