Re: [請益] 有關寫入檔案
use Bio::SeqIO;
use Bio::Tools::SeqWords;
my $in = Bio::SeqIO->new( -file => "prot.seq", -format => 'Fasta' );
while ( my $seq = $in->next_seq() ) {
print $seq->id . "\n";
my $hash_ref = Bio::Tools::SeqWords->count_words( $seq, 1 );
my %hash = %$hash_ref;
foreach my $key ( sort keys %hash ) {
print "$key $hash{$key}\n";
}
}
OUTPUT:
randomseq1
A 10
C 9
D 14
E 13
F 9
G 6
H 10
I 10
K 10
L 10
M 11
N 11
P 4
Q 8
R 13
S 10
T 12
V 12
W 9
Y 9
--
我是瓶男~我很難懂!
http://blog.yam.com/chhuang
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.84.89
※ 編輯: chhuang 來自: 61.62.84.89 (06/10 02:05)
討論串 (同標題文章)
Perl 近期熱門文章
PTT數位生活區 即時熱門文章