Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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