Last active
August 29, 2015 14:08
-
-
Save kepbod/7e21576bf2391decbb98 to your computer and use it in GitHub Desktop.
Convert ref format to BED format
This file contains 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
perl -alne '@starts = split /,/,$F[9]; @ends = split /,/,$F[10]; @sizes = map {$ends[$_] - $starts[$_]} 0..($F[8]-1); @offsets = map {$_ - $F[4]} @starts; $" = ","; print "$F[2]\t$F[4]\t$F[5]\t$F[0]/$F[1]\t0\t$F[3]\t$F[6]\t$F[7]\t0,0,0\t$F[8]\t@sizes\t@offsets"' ref.txt > ref.bed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment