Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Quinlan arq5x

View GitHub Profile
@arq5x
arq5x / test.sh
Last active Nov 12, 2020
Compress and then Decompress a string with zlib.
View test.sh
# compile
$ g++ zlib-example.cpp -lz -o zlib-example
# run
$ ./zlib-example
Uncompressed size is: 36
Uncompressed string is: Hello Hello Hello Hello Hello Hello!
----------
@arq5x
arq5x / make-master-hmm.sh
Created Jul 18, 2012
For Gemini: Create a master ChromHMM track from the 9 distinct cell types.
View make-master-hmm.sh
echo "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmGm12878HMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmH1hescHMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmHepg2HMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmHmecHMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmHsmmHMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmHuvecHMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmK562HMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmNhekHMM.bed.gz
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmNhlfHMM.bed.gz" \
> chromhmm-files.txt
@arq5x
arq5x / go.sh
Last active Feb 3, 2020
compute average scores for share intervals
View go.sh
cat a.bed
chr1 10 50 10
cat b.bed
chr1 20 40 20
cat c.bed
chr1 30 33 30
# Find the sub-intervals shared and unique to each file.
@arq5x
arq5x / inheritance_scenarios.md
Last active Jan 3, 2020
mendelian violations
View inheritance_scenarios.md
dad mom kid Inheritance description
HOM_REF HOM_REF HOM_REF Expected
HOM_REF HOM_REF HET Mendelian violation (plausible de novo)
HOM_REF HOM_REF HOM_ALT Mendelian violation (implausible de novo)
HOM_REF HOM_ALT HOM_REF Mendelian violation (uniparental disomy)
HOM_REF HOM_ALT HET Expected
HOM_REF HOM_ALT HOM_ALT Mendelian violation (uniparental disomy)
HOM_REF HET HOM_REF Expected
HOM_REF HET HET Expected
@arq5x
arq5x / autosomal-dominant.sh
Last active Nov 13, 2019
GEMINI Tutorial Commands
View autosomal-dominant.sh
# assumes you have SSH'ed and qlogin'ed
cd thu
cd mydata
# slide 5
curl https://s3.amazonaws.com/gemini-tutorials/trio.trim.vep.vcf.gz > trio.trim.vep.vcf.gz
curl https://s3.amazonaws.com/gemini-tutorials/dominant.ped > dominant.ped
gemini load --cores 2 \
-v trio.trim.vep.vcf.gz \
-t VEP \
@arq5x
arq5x / rest-example.md
Last active Jul 23, 2019
Example use of a RESTful API to GEMINI databases.
View rest-example.md

Load a GEMINI database from a VCF

$ gemini load -v nobel.vcf -t VEP --cores 23 -p samples.ped nobel.db

Launch the GEMINI web server

(this will run on your local machine on port 8088)

$ gemini browser nobel.db
@arq5x
arq5x / main-pipeline.sh
Created Jun 16, 2011
Navin Main Processing
View main-pipeline.sh
############################################################
# Index the position-sorted BAM files.
############################################################
export SAMPLES="T10AA T10AB T10D T10H"
export TUMHOME=/home/arq5x/cphg-home/projects/navin-tumor-heterogeneity/
export STEPNAME="bam-index"
for sample in `echo $SAMPLES`
do
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=2000m:ncpus=1 -N $STEPNAME -m bea -M arq5x@virginia.edu"
echo "cd $TUMHOME; samtools index bam/$sample.*.bam" | $QSUB
View pos_to_bedgraph.py
import sys
class Line(object):
def __init__(self, line):
self.fields = line.split('\t')
self.chrom = self.fields[0]
self.start = int(self.fields[1])
self.end = int(self.fields[2])
self.depth = int(self.fields[3])
@arq5x
arq5x / dbsnp-to-bed.sh
Created Mar 7, 2011
Make a BED file from the raw UCSC file
View dbsnp-to-bed.sh
export GENOME=hg19
export SNPBUILD=131
curl -s http://hgdownload.cse.ucsc.edu/goldenPath/$GENOME/database/snp$SNPBUILD.txt.gz | \
zcat | \
cut -f 2,3,4,5,6,7,10,16 > dbsnp.$SNPBUILD.$GENOME.bed
head dbsnp.$SNPBUILD.$GENOME.bed
chr1 10433 10433 rs56289060 0 + -/C near-gene-5
chr1 10491 10492 rs55998931 0 + C/T near-gene-5
chr1 10518 10519 rs62636508 0 + C/G near-gene-5