open FA,"$ARGV[0]";
while(<FA>){
chomp;
if (exists $hash{$_}){
$hash{$_}+=1;
}
else{
$hash{$_}=1;
}
}
open OU1,">$ARGV[1]";
foreach(sort {$hash{$a}<=>$hash{$b} }keys %hash){
#print"$_\n";
print OU1 "$_\t$hash{$_}\n";
}
Input file
cytoplasm
plasma membrane
chloroplast
nucleus
cytoplasm
cytoplasm
cytoplasm
output file
"cytoplasm,plasma membrane" 1
"nucleus,plasma membrane" 1
"cytoplasm,nucleus" 4
"chloroplast,mitochondria" 4
Golgi apparatus 7
peroxisome 19
endoplasmic reticulum 26
cytoskeleton 35
vacuolar membrane 57
mitochondria 127
extracellular 148
plasma membrane 170
nucleus 440
cytoplasm 637
chloroplast 1132
网友评论