Skip to content

Instantly share code, notes, and snippets.

View arq5x's full-sized avatar

Aaron Quinlan arq5x

View GitHub Profile
@brentp
brentp / tss.sh
Created July 17, 2012 20:44
bed file of transcription start-sites (TSS)
UPSTREAM=400
INSTREAM=100
ORG=hg18
mysql --user genome --host genome-mysql.cse.ucsc.edu -NAD $ORG -e \
"select chrom, txStart, txEnd, X.geneSymbol, strand from knownGene as K, kgXref as X WHERE txStart != txEnd AND X.kgID = K.name" \
| awk -v ups=$UPSTREAM -v ins=$INSTREAM 'BEGIN{OFS=FS="\t"}
$5 == "-" { print $1,$3-ins,$3+ups,$4 }
$5 == "+" { print $1,$2-ins,$2+ups,$4 }' \
| sort -k1,1 -k2,2n \
@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active January 1, 2024 06:00
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.