Skip to content

Instantly share code, notes, and snippets.

#!/bin/env python
from multiprocessing import Pool, Manager
import numpy as np
def tryFunc(i, j,results):
results.append(i*j)
def main():
a = 10
@wckdouglas
wckdouglas / install_packages.R
Last active September 30, 2016 19:12
install packages for tight-hamr predictions
#!/bin/snv Rscript
installPackages <- function(package){
if(package %in% rownames(installed.packages()) == FALSE)
{
message('Installing ',package)
install.packages(package, dependencies=TRUE)
}else{
message(package,' is installed')
}
@wckdouglas
wckdouglas / writeSGE.py
Last active August 28, 2015 17:15
For high-throughput computing on TACC lonestar
import sys
import os
import fileinput
#==============================set parameter===================
time='1:30:00'
allocation = '{Allocation-name}'
projectPrerfix = '{name for the job}'
commandPerJob = 1
@wckdouglas
wckdouglas / jobSubmit.py
Created August 28, 2015 17:10
Job simitting
#!/bin/env python
import commands
import glob
import time
import os
import sys
maxJobLim = 46
joblist = glob.glob('./job_*.sge')
# change prefix
unbind-key C-b
set -g prefix C-a
bind-key C-a send-prefix
#set -g default-terminal "xterm"
#set-window-option -g xterm-keys on
#set-option -g renumber-windows on
#power line
run-shell "powerline-daemon -q"
#!/usr/bin/env Rscript
source("http://bioconductor.org/biocLite.R")
packages <- c('data.table','readr',
'dplyr','plyr',
'ggplot2','cowplot',
'caret','RMySQL',
'tidyr','stringr',
'pheatmap','Rcpp')
#include <string.h>
#include <cstring>
#include <iostream>
#include <fstream>
#include <gzstream.h>
#include <sstream>
using namespace std;
//get the id hash table and
//iterate over the fastq file
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <map>
#include <Rcpp.h>
using namespace Rcpp;
double getProb(double p, int success, int fail){
double e = success * log(p) + fail * log(1-p);
return e;
}
#include <glob.h>
#include <iostream>
#include <fstream>
#include <gzstream.h>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <libgen.h>
#include <string.h>