Last active
December 1, 2015 18:37
-
-
Save alexpreynolds/54464b5184f8cfce866e to your computer and use it in GitHub Desktop.
Split BED intervals into per-base elements
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $cnt = 0; | |
while (<STDIN>) { | |
chomp; | |
my ($chr, $start, $stop, $id, $score, $strand) = split("\t", $_); | |
for (my $meltIdx = $start; $meltIdx < $stop; $meltIdx += 1) { | |
print STDOUT join("\t", ($chr, $meltIdx, $meltIdx + 1, $id."!$cnt", $score, $strand))."\n"; | |
} | |
$cnt++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment