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
library(RISmed) | |
library(parallel) | |
library(ggplot2) | |
# Given two lists of terms, lets see how 'hot' they are together | |
set1 <- c("ebola","autoimmune","Diabetes","HIV","Glioblastoma","Asthma","Schizophrenia") | |
set2 <- c("C. elegans","D. Melanogaster","C. japonica", "M. Musculus","S. Cerevisiae") | |
# Generate all possible pairs | |
pairs <- expand.grid(set1, set2, stringsAsFactors=F) |
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
/** | |
* Get a user's name, by accessing contacts. | |
* | |
* @returns {String} FullName, or UserID | |
* if record not found in contacts. | |
*/ | |
function getUserName(email){ | |
var user = ContactsApp.getContact(email); | |
// If user in contacts, return their name |
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
#!bin/usr/python | |
''' | |
Heterozygote Polarization Script | |
usage: | |
bcftools view -M 2 <filename> | python het_polarization.py | bcftools view -O b > <filename.het.polarized.bcf> | |
Tags variants 'pushed' to ref or alt as follows: | |
AA - Pushed towards reference | |
AB - Kept as het |
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
library(data.table) | |
library(stringr) | |
library(splitstackshape) | |
args <- commandArgs(trailing=T) | |
if (length(args) == 0) { | |
setwd("/Users/dancook/Dropbox/Andersen lab/LabFolders/Dan/ForOthers/Maneeshi") | |
} | |
df <- fread("Snail2_Twist_MergedPeaksPS1005kbSummit300bp_Sn_TwEBox.txt") |
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
cat file.fa | awk '$0 ~ ">" {print c; c=0;printf substr($0,2,100) "\t"; } $0 !~ ">" {c+=length($0);} END { print c; }' |
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
# Place in /Users/Username/.Rprofile | |
" | |
sys.source('~/Dropbox/appdata/Rprofile.r') | |
" | |
## Create a new invisible environment for all the functions to go in so it doesn't clutter your workspace. | |
.env <- new.env() | |
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
#!bin/python | |
import gzip | |
import io | |
import sys | |
import os | |
# This file will generate a bedfile of the masked regions a fasta file. | |
# STDIN or arguments |
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
# | |
# This script calculates the depth of coverage and breadth of coverage for a given bam. | |
# Outputs a dictionary containing the contig/chromosome names and the depth and breadth of coverage for each | |
# and for the entire genome. | |
# | |
# If you optionally specify the name of the mitochondrial chromosome (e.g. mtDNA, chrM, chrMT) | |
# The script will also generate breadth and depth of coverage for the nuclear genome AND the ratio | |
# of mtDNA:nuclearDNA; which can act as a proxy in some cases for mitochondrial count within an individual. | |
# | |
# Author: Daniel E. Cook |
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
# Daniel Cook 2014 | |
# Danielecook.com | |
# | |
# Use this function to import ChIP Seq Data generated by Homer. This data is generated using homers findMotifsGenome.pl | |
# command with the '-find <motif file>' argument. Generate output | |
# looks like this: | |
# | |
# 1. Peak/Region ID | |
# 2. Chromosome | |
# 3. Start |
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
# Generate tiny FASTQs for quick testing. | |
function test_set() { | |
for r in `ls *$1*.fq.gz`; do | |
gunzip -kfc $r | head -n 50000 | gzip > ${r/$1/$2} | |
done; | |
} |