<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://dynamo.iro.umontreal.ca/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;feed=atom&amp;action=history</id>
		<title>Programming language shootout: fasta - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;action=history"/>
		<updated>2013-05-21T03:46:17Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.4</generator>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=244&amp;oldid=prev</id>
		<title>Bjlucier at 00:53, 30 June 2008</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=244&amp;oldid=prev"/>
				<updated>2008-06-30T00:53:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:53, 30 June 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 143:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 143:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Running==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Running==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;gsi fasta 25000000 &amp;gt; /dev/null&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;==Building the input for [[Programming language shootout: k-nucleotide| k-nucleotide]]==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;gsi fasta 1000000 &amp;gt; knucleotide-input1000000.txt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;gsi fasta 1000000 &amp;gt; knucleotide-input1000000.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The file knucleotide-input1000000.txt is used by [[Programming language shootout: k-nucleotide| k-nucleotide]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The file knucleotide-input1000000.txt is used by [[Programming language shootout: k-nucleotide| k-nucleotide]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=64&amp;oldid=prev</id>
		<title>Bjlucier: correct link to alioth</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=64&amp;oldid=prev"/>
				<updated>2008-02-22T21:56:36Z</updated>
		
		<summary type="html">&lt;p&gt;correct link to alioth&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 21:56, 22 February 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gp4&lt;/del&gt;/benchmark.php?test=fasta&amp;amp;lang=all fasta] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gp4sandbox&lt;/ins&gt;/benchmark.php?test=fasta&amp;amp;lang=all fasta] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==The program==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==The program==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=49&amp;oldid=prev</id>
		<title>Bjlucier: Fasta benchmark with buffered output</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Programming_language_shootout:_fasta&amp;diff=49&amp;oldid=prev"/>
				<updated>2008-02-22T20:43:38Z</updated>
		
		<summary type="html">&lt;p&gt;Fasta benchmark with buffered output&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&amp;amp;lang=all fasta] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the Chicken variant by Anthony Borla&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define-macro (unless test . body)&lt;br /&gt;
  `(if (not ,test)&lt;br /&gt;
       (begin&lt;br /&gt;
	 ,@body)))&lt;br /&gt;
&lt;br /&gt;
(define *alu*&lt;br /&gt;
  (string-append&lt;br /&gt;
   &amp;quot;GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG&amp;quot;&lt;br /&gt;
   &amp;quot;GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA&amp;quot;&lt;br /&gt;
   &amp;quot;CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT&amp;quot;&lt;br /&gt;
   &amp;quot;ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA&amp;quot;&lt;br /&gt;
   &amp;quot;GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG&amp;quot;&lt;br /&gt;
   &amp;quot;AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC&amp;quot;&lt;br /&gt;
   &amp;quot;AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(define *iub*&lt;br /&gt;
  (list&lt;br /&gt;
   '(#\a . 0.27) '(#\c . 0.12) '(#\g . 0.12) '(#\t . 0.27) '(#\B . 0.02)&lt;br /&gt;
   '(#\D . 0.02) '(#\H . 0.02) '(#\K . 0.02) '(#\M . 0.02) '(#\N . 0.02)&lt;br /&gt;
   '(#\R . 0.02) '(#\S . 0.02) '(#\V . 0.02) '(#\W . 0.02) '(#\Y . 0.02)))&lt;br /&gt;
&lt;br /&gt;
(define *homosapien*&lt;br /&gt;
  (list&lt;br /&gt;
   '(#\a . 0.3029549426680) '(#\c . 0.1979883004921)&lt;br /&gt;
   '(#\g . 0.1975473066391) '(#\t . 0.3015094502008)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define *line-size* 60)&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (make-random seed)&lt;br /&gt;
  (let ((ia 3877.0)&lt;br /&gt;
	(ic 29573.)&lt;br /&gt;
	(im 139968.)&lt;br /&gt;
	(last (f64vector (exact-&amp;gt;inexact seed)))&lt;br /&gt;
	(result (f64vector 0.)))&lt;br /&gt;
    (lambda ()&lt;br /&gt;
      (let* ((advance (fl+ ic&lt;br /&gt;
			(fl* (f64vector-ref last 0)&lt;br /&gt;
			     ia)))&lt;br /&gt;
	     (next (fl- advance&lt;br /&gt;
			(fl* im&lt;br /&gt;
			     (fltruncate (fl/ advance im))))))&lt;br /&gt;
	(f64vector-set! last 0 next)&lt;br /&gt;
	(f64vector-set! result 0 (fl/ next im))))))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (make-cumulative-table frequency-table)&lt;br /&gt;
  (let ((cumulative 0.0))&lt;br /&gt;
    (map&lt;br /&gt;
     (lambda (x)&lt;br /&gt;
       (set! cumulative (fl+ cumulative (cdr x)))&lt;br /&gt;
       (cons (car x) cumulative))&lt;br /&gt;
       frequency-table)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define random-next (make-random 42))&lt;br /&gt;
(define *segmarker* &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (select-random cumulative-table)&lt;br /&gt;
  (select-over-threshold (random-next) cumulative-table))&lt;br /&gt;
&lt;br /&gt;
(define (select-over-threshold rvalue table)&lt;br /&gt;
  (if (fl&amp;lt;= (f64vector-ref rvalue 0) (cdar table))&lt;br /&gt;
      (caar table)&lt;br /&gt;
      (select-over-threshold rvalue (cdr table))))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (repeat-fasta id desc n sequence line-length)&lt;br /&gt;
  (let ((seqlen (string-length sequence))&lt;br /&gt;
        (out (current-output-port))&lt;br /&gt;
	(buffer (make-string line-length)))&lt;br /&gt;
    (display (string-append *segmarker* id &amp;quot; &amp;quot; desc &amp;quot;\n&amp;quot;) out)&lt;br /&gt;
    (let loop-o ((n n) (k 0))&lt;br /&gt;
      (unless (fx&amp;lt;= n 0)&lt;br /&gt;
              (let ((m (fxmin n line-length)))&lt;br /&gt;
                (let loop-i ((i 0) (k k))&lt;br /&gt;
                  (if (fx&amp;gt;= i m)&lt;br /&gt;
                      (begin&lt;br /&gt;
			(write-substring buffer 0 m)&lt;br /&gt;
                        (write-char #\newline out)&lt;br /&gt;
                        (loop-o (fx- n line-length) k))&lt;br /&gt;
                      (let ([k (if (fx= k seqlen) 0 k)])&lt;br /&gt;
			(string-set! buffer i (string-ref sequence k))&lt;br /&gt;
                        (loop-i (fx+ 1 i) (fx+ 1 k))))))))&lt;br /&gt;
    (force-output out)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (random-fasta id desc n cumulative-table line-length)&lt;br /&gt;
  (let ((out (current-output-port))&lt;br /&gt;
	(buffer (make-string line-length)))&lt;br /&gt;
    (display (string-append *segmarker* id &amp;quot; &amp;quot; desc &amp;quot;\n&amp;quot;) out)&lt;br /&gt;
    (let loop-o ((n n))&lt;br /&gt;
      (unless (&amp;lt;= n 0)&lt;br /&gt;
              (let ((m (min n line-length)))&lt;br /&gt;
                (let loop-i ((i 0))&lt;br /&gt;
                  (unless (&amp;gt;= i m)&lt;br /&gt;
			  (string-set! buffer i (select-random cumulative-table))&lt;br /&gt;
                          (loop-i (fx+ 1 i))))&lt;br /&gt;
		(write-substring buffer 0 m)&lt;br /&gt;
                (write-char #\newline out)&lt;br /&gt;
                (loop-o (fx- n line-length)))))&lt;br /&gt;
    (force-output out)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (main . args)&lt;br /&gt;
  (let ((n (string-&amp;gt;number (car args))))&lt;br /&gt;
    (repeat-fasta &amp;quot;ONE&amp;quot; &amp;quot;Homo sapiens alu&amp;quot; (* n 2) *alu* *line-size*)&lt;br /&gt;
    (random-fasta &amp;quot;TWO&amp;quot; &amp;quot;IUB ambiguity codes&amp;quot; (* n 3)&lt;br /&gt;
                  (make-cumulative-table *iub*) *line-size*)&lt;br /&gt;
    (random-fasta &amp;quot;THREE&amp;quot; &amp;quot;Homo sapiens frequency&amp;quot; (* n 5)&lt;br /&gt;
                  (make-cumulative-table *homosapien*) *line-size*) ))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc fasta&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi fasta 1000000 &amp;gt; knucleotide-input1000000.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The file knucleotide-input1000000.txt is used by [[Programming language shootout: k-nucleotide| k-nucleotide]].&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	</feed>