File: random_dna.pl

package info (click to toggle)
gbrowse 2.56%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 13,112 kB
  • ctags: 4,436
  • sloc: perl: 50,765; sh: 249; sql: 62; makefile: 45; ansic: 27
file content (13 lines) | stat: -rwxr-xr-x 250 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use strict;

my @bases = qw(g a t c);

my $length = shift || 50000;
my @nucleotides = map {$bases[rand @bases]} (1..$length);
my $nucleotides = join '',@nucleotides;
$nucleotides =~ s/(.{1,60})/$1\n/g;

print ">ctgA\n$nucleotides";