Created
November 19, 2013 04:03
-
-
Save davetang/7540139 to your computer and use it in GitHub Desktop.
Randomise a BED file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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