#!/usr/bin/perl -w use strict; my @alphas = ([qw(A C T G)],[qw(0 1)]); my @lengths = qw(20 100 500 1000 5000 10000 20000 40000); sub makeseq { my ($alpha,$len) = @_; my $buf = ''; while($len--) { $buf .= $alpha->[rand() * scalar(@{$alpha})]; } $buf; } print "// THIS FILE IS AUTO-GENERATED! DO NOT EDIT\n"; print "#include \"Library.h\"\n"; foreach my $len (@lengths) { foreach my $alpha (@alphas) { my $name = $alpha->[0] =~ /^[01]$/ ? "test_binary" : "test"; print "Pair ${name}_pair_$len = {\n"; foreach my $done (0,1) { my $s = makeseq($alpha,$len + int (rand() * $len / 3 - $len/6)); print " // Sequence of " . length($s) . " chars"; while($s =~ s/^(.{1,72})//) { print "\n \"$1\""; } print "," unless($done); print "\n"; } print "};\n"; } }