2 # Copyright (C) 2005-2009, Parrot Foundation.
5 # fasta.pir N (N = 2500000 for shootout)
7 # modified by karl : fixed bug in default value (N=1000) assignment
10 # 48.2 sec on AMD@2000/512K cache
20 unless i < count goto endfor
37 unless r < $N0 goto endif
45 unless hi > $I0 goto endwhile
49 unless r < $N0 goto else_1
61 .const int LINE_LENGTH = 60
80 unless todo > 0 goto endfor
82 unless todo < LINE_LENGTH goto else
91 unless i < m goto endfor_1
92 $S0 = selectRandom(genelist, count)
111 .local int todo, k, kn, m
123 unless todo > 0 goto endfor
125 unless todo < LINE_LENGTH goto else
134 unless m >= $I0 goto endwhile
153 .macro InitStruct (iub, i, char, num)
154 $P0 = new 'FixedPMCArray'
165 # stdout is linebuffered per default - make it block buffered
167 stdout.'buffer_size'(40960)
169 if $I0 > 1 goto argsok
177 iub = new 'FixedPMCArray'
179 .InitStruct(iub, 0, "a", 0.27)
180 .InitStruct(iub, 1, "c", 0.12)
181 .InitStruct(iub, 2, "g", 0.12)
182 .InitStruct(iub, 3, "t", 0.27)
184 .InitStruct(iub, 4, "B", 0.02)
185 .InitStruct(iub, 5, "D", 0.02)
186 .InitStruct(iub, 6, "H", 0.02)
187 .InitStruct(iub, 7, "K", 0.02)
188 .InitStruct(iub, 8, "M", 0.02)
189 .InitStruct(iub, 9, "N", 0.02)
190 .InitStruct(iub, 10, "R", 0.02)
191 .InitStruct(iub, 11, "S", 0.02)
192 .InitStruct(iub, 12, "V", 0.02)
193 .InitStruct(iub, 13, "W", 0.02)
194 .InitStruct(iub, 14, "Y", 0.02)
196 .local pmc homosapiens
197 homosapiens = new 'FixedPMCArray'
199 .InitStruct(homosapiens, 0, "a", 0.3029549426680)
200 .InitStruct(homosapiens, 1, "c", 0.1979883004921)
201 .InitStruct(homosapiens, 2, "g", 0.1975473066391)
202 .InitStruct(homosapiens, 3, "t", 0.3015094502008)
205 alu = "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
207 makeCumulative(iub, 15)
208 makeCumulative(homosapiens, 4)
211 makeRepeatFasta("ONE", "Homo sapiens alu", alu, $I0)
213 makeRandomFasta ("TWO", "IUB ambiguity codes", iub, 15, $I0)
215 makeRandomFasta ("THREE", "Homo sapiens frequency", homosapiens, 4, $I0)
218 .const num IM = 139968.0
219 .const num IA = 3877.0
220 .const num IC = 29573.0
245 # vim: expandtab shiftwidth=4 ft=pir: