| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use constant FLEN => 4000; | ||
| 5 | use constant SLEN => 50000; | ||
| 6 | use constant FNUM => 15; | ||
| 7 | |||
| 8 | my $ftype = shift or "feature"; | ||
| 9 | my $fclass = shift or "Feature"; | ||
| 10 | my $fprefix = shift or "f"; | ||
| 11 | |||
| 12 | |||
| 13 | open STDOUT,"|sort -k4,4n" or die; | ||
| 14 | |||
| 15 | for (1..FNUM) { | ||
| 16 | my $start = int(rand(SLEN)); | ||
| 17 | my $end = $start + int(rand(FLEN)); | ||
| 18 | $end = SLEN if $end > SLEN; | ||
| 19 | my $strand = rand(1) > 0.5 ? '+' : '-'; | ||
| 20 | my $name = sprintf("$fprefix%02d",$_); | ||
| 21 | print <<END; | ||
| 22 | ctgA example $ftype $start $end . $strand . $fclass $name | ||
| 23 | END | ||
| 24 | } | ||
| 25 | |||
| 26 | close STDOUT; |