Skip to content

Instantly share code, notes, and snippets.

@afrendeiro
Created January 27, 2014 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afrendeiro/8659303 to your computer and use it in GitHub Desktop.
Save afrendeiro/8659303 to your computer and use it in GitHub Desktop.
Takes a bed file with gene annotation ("annotationFile.bed") and makes another with TSS annotation ("annotationFile.TSSs.bed")
awk -v OFS='\t' '$6 == "+" {print $1, $2, $2+1, $4, $5, $6}' annotationFile.bed > tmp
awk -v OFS='\t' '$6 == "-" {print $1, $3, $3+1, $4, $5, $6}' annotationFile.bed >> tmp
bedtools sort -i tmp > annotationFile.TSSs.bed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment