#!/usr/bin/perl -w
print"input your file,then press Enter!\n";
$file=;
open IN,"$file";
open OUT,">rsult";
while(){
chomp;
if (/>/){
$head=$_;}else{
$seq{$head}.=$_;}
}
local $/=undef;
foreach $line(values %seq){
$count=0;
$num=length$line;
for ($i=0;$i<$num;$i++){
$word=substr($line,$i,1);
if ($word=~/[GC]/){
$count++;
}else{$ratio=$count/$num;}
}
print OUT "$ratio\n";
}
exit;
####这个是简单版,比较麻烦### 请看下一个
阅读(2016) | 评论(0) | 转发(0) |