#gawk script $Revision: 1.3 $ to generate random DNA/RNA string #ADPC RNAfold does not care if RNA or DNA base sequence BEGIN { v = "$Revision: 1.3 $"; if(seed=="") seed = 10175103; if(total=="") total = 1; srand(seed); if(N=="") N = 120; } END{ #print "seed="seed,"N=",N; for(k=1;k<=total;k++) { printf(">rand_dna.awk %s %d %s\n",substr(v,2,length(v)-2),k,strftime()); for(i=1;i<=N;i++) printf("%s",base(int(rand()*4))); printf("\n\n"); } } function base(k) { if(k==0) return "A"; if(k==1) return "C"; if(k==2) return "G"; if(k==3) return "T"; return "N"; #opps }