Skip to content

Instantly share code, notes, and snippets.

@davetang
Created November 19, 2013 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetang/7540139 to your computer and use it in GitHub Desktop.
Save davetang/7540139 to your computer and use it in GitHub Desktop.
Randomise a BED file.
#!/bin/env perl
use strict;
use warnings;
my $usage = "Usage: $0 <infile.bed>\n";
my $infile = shift or die $usage;
my %bed = ();
open(IN,'<',$infile) || die "Could not open $infile: $!\n";
while(<IN>){
chomp;
$bed{$.} = $_;
}
close(IN);
foreach my $line (keys %bed){
print "$bed{$line}\n";
}
exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment