#!usr/bin/perl
open FA,"$ARGV[0]";
$/=">";
<FA>;
while(<FA>){
chomp;
my ($id,$seq)=split/\n/,$_,2;
$seq=~s/\n//g;
$seq=~s/\s//g;
$len=length $seq;
print "$id\t$len\n";
}
实战演练
(base) [qtxu@mn02 test]$ perl count.pl ~/Rice_ref_genome/Rice_Tigr7.0_chipseq_Ref/Rice_Ref.fa
Chr1 43270923
Chr2 35937250
Chr3 36413819
Chr4 35502694
Chr5 29958434
Chr6 31248787
Chr7 29697621
Chr8 28443022
Chr9 23012720
Chr10 23207287
Chr11 29021106
Chr12 27531856
ChrUn 633585
ChrSy 592136
网友评论