This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
# Step 0. setup a list of sample names. | |
# Assume that each of your gzipped | |
# FASTQ files is named as follows: | |
# sample1.1.fq.gz | |
# sample1.2.fq.gz | |
# sample2.1.fq.gz | |
# sample2.2.fq.gz | |
# ... | |
# sampleN.1.fq.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create SNPs-only subset of the 1000G callset VCF | |
$ curl -s http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/working/20120316_phase1_integrated_release_version2/ALL.chr22.phase1_release_v2.20101123.snps_indels_svs.vcf.gz | \ | |
zcat | \ | |
awk '$0 ~ /^#/ || $0 ~ "VT=SNP"' | \ | |
gzip > ALL.chr22.phase1_release_v2.20101123.snps_indels_svs.snpsonly.vcf.gz | |
# Use VCFTools to convert to TPED | |
$ vcftools | |
VCFtools (v0.1.8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read 11960......................................................................12030 | |
exon 12010..............................<snip>12057 | |
overlap (21bp) ******************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note, these instructions assume OS X. | |
# Alternatives to the afplay command likely exist on | |
# other POSIX systems. Google is your friend. | |
# NOTE: Obviously, you can put the MP3 file where ever you so desire. | |
# 1. Make a new directory called "ka-ching" under /usr/share/ | |
sudo mkdir /usr/share/ka-ching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ez_setup | |
ez_setup.use_setuptools() | |
import glob | |
import os | |
import sys | |
from setuptools import setup | |
from distutils.extension import Extension | |
if 'setuptools.extension' in sys.modules: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nldksvnasl | |
dfbv | |
dfgb | |
zdf | |
gfg | |
ncg | |
hn | |
fghn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from collections import namedtuple, defaultdict | |
from pybedtools import BedTool | |
import argparse | |
Point = namedtuple('Point', ['id', 'pos', 'type']) | |
Interval = namedtuple('Interval', ['chrom', 'start', 'end']) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
get_bam_allele.py | |
Usage: python get_bam_allele.py [BAM] [BED] | |
""" | |
from pybedtools import BedTool | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybedtools import BedTool | |
snps = BedTool('../test/data/snps.bed.gz') | |
genes = BedTool('../test/data/hg19.gff') | |
intergenic_snps = (snps - genes) | |
nearby = genes.closest(intergenic_snps, | |
d=True, | |
stream=True) | |
for gene in nearby: | |
if int(gene[-1]) < 5000: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PBTHOME=/home/arq5x/cphg-home/projects/pybedtools | |
shuffle 1094PC0012.bed > a.shuf.full.bed | |
shuffle 1094PC0012.bed > b.shuf.full.bed | |
head -1000 a.shuf.full.bed > a.shuf.1e3.bed; head -1000 b.shuf.full.bed > b.shuf.1e3.bed | |
head -10000 a.shuf.full.bed > a.shuf.1e4.bed; head -10000 b.shuf.full.bed > b.shuf.1e4.bed | |
head -100000 a.shuf.full.bed > a.shuf.1e5.bed; head -100000 b.shuf.full.bed > b.shuf.1e5.bed | |
head -1000000 a.shuf.full.bed > a.shuf.1e6.bed; head -1000000 b.shuf.full.bed > b.shuf.1e6.bed | |
head -10000000 a.shuf.full.bed > a.shuf.1e7.bed; head -10000000 b.shuf.full.bed > b.shuf.1e7.bed | |
head -100000000 a.shuf.full.bed > a.shuf.1e8.bed; head -100000000 b.shuf.full.bed > b.shuf.1e8.bed |