Skip to content

Instantly share code, notes, and snippets.

@sp00nman
Last active July 29, 2023 08:42
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/9aec99a0ad7353bb2919 to your computer and use it in GitHub Desktop.
Save sp00nman/9aec99a0ad7353bb2919 to your computer and use it in GitHub Desktop.
Reformat bed file (add chr to chromosome)
#Example_input.bed
#ENST00000456328 1 + 11868 14409 11868 11868 3 11868,12612,13220, 12227,12721,14409, DDX11L1
awk '{chrom=$2; gsub(chrom,"chr"chrom,$2)}{print $0}' Example_input.bed >Example_output.bed
#Example_output.bed
#ENST00000456328 chr1 + 11868 14409 11868 11868 3 11868,12612,13220, 12227,12721,14409, DDX11L1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment