Created
January 25, 2010 21:38
-
-
Save jhannah/286277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use Bio::SeqIO; | |
my @files = `find /home/obcarter/2010/bacteria/ -name "*.gbk"`; | |
foreach my $file (@files) { | |
chomp $file; | |
my $in = Bio::SeqIO->new(-file => $file, -format => 'genbank'); | |
while (my $seq = $in->next_seq) { | |
my @features = $seq->get_SeqFeatures(); # just top level | |
foreach my $feat ( @features ) { | |
next unless ($feat->primary_tag eq "CDS"); | |
my ($gene) = $feat->get_tag_values("gene"); | |
next unless ($gene); | |
my ($translation) = $feat->get_tag_values("translation"); | |
my $start = $feat->location->start; | |
my $end = $feat->location->end; | |
print join "\t", | |
$seq->id, $gene, $start, $end, | |
entropy($translation), | |
#$translation, | |
; | |
print "\n"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment