Skip to content

Instantly share code, notes, and snippets.

@sp00nman
Created October 23, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sp00nman/3a78c3297eb0b0fffc55 to your computer and use it in GitHub Desktop.
Save sp00nman/3a78c3297eb0b0fffc55 to your computer and use it in GitHub Desktop.
sort bed file by chromosome; then by position
#!/bin/bash
BED_FILE=$1
sort -k1,1 -k2,2n $BED_FILE >${BED_FILE}_sorted.bed
## format
#chr1 12
#chr2 56
#chr10 13
#chr11 9 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment