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 | |
import glob | |
from collections import Counter | |
prefix = 'gene_' | |
def get_files_names(glob_pattern = '*.txt'): | |
return(glob.glob(glob_pattern)) | |
def get_jaspar_bits(files_names): | |
files_refs = map(lambda x: open(x), files_names) |
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("biomaRt") | |
getPromoterSequence <- function(geneID, flankLeft, mart) { | |
return(getBM( | |
attributes = c("ensembl_gene_id",'coding_transcript_flank'), | |
checkFilters=FALSE, filters = c('ensembl_gene_id','upstream_flank'), | |
values=list(geneID, flankLeft), | |
mart=mart, verbose=FALSE)) | |
} |
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
# -*- coding: utf-8 -*- | |
import os | |
import json | |
import urllib2 | |
DATA_URL = 'https://dl.dropboxusercontent.com/s/blq0xxvx5asfnkl/combined.json?token_hash=AAGZxGLemmo09Ib-_P6kyjnzEoTzTMcIVjJ5b95zdb0Eqw&dl=1' | |
DATA_FILE = 'combined_sample.json' | |
class ChemblStatsClient: |
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
set encoding=utf8 | |
set nocompatible | |
set paste | |
set expandtab | |
set textwidth=0 | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set autoindent | |
set backspace=indent,eol,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
__author__ = 'zero323' | |
from rdkit import DataStructs | |
from rdkit.Chem.Fingerprints import FingerprintMols | |
from rdkit import Chem | |
from indigo import Indigo | |
import pybel | |
import time | |
import cPickle | |
import numpy as np |
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
killall mongod | |
killall mongos | |
rm -R s0 s1 cfg logs | |
mkdir -p s0/a s0/b s0/c s1/a s1/b s1/c | |
mkdir -p cfg/a cfg/b cfg/c | |
mkdir logs | |
mongod --shardsvr --replSet rs0 --dbpath s0/a --port 27001 --smallfiles --oplogSize 50 --fork --logpath logs/s0a.log | |
mongod --shardsvr --replSet rs0 --dbpath s0/b --port 27002 --smallfiles --oplogSize 50 --fork --logpath logs/s0b.log | |
mongod --shardsvr --replSet rs0 --dbpath s0/c --port 27003 --smallfiles --oplogSize 50 --fork --logpath logs/s0c.log |
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(GenomicRanges) | |
gr1 <- GRanges( | |
"chr1", strand="+", | |
IRanges(start = c(100, 200), end =c(200, 300)) | |
) | |
gr2 <- GRanges( | |
"chr1", strand="+", | |
IRanges(start = 0, end = 250) |
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(GenomicRanges) | |
interactions <- GRanges() | |
# GRanges with 0 ranges and 0 metadata columns: | |
# seqnames ranges strand | |
# <Rle> <IRanges> <Rle> | |
# --- | |
# seqlengths: |
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
#' @param datain expression data with gene id in the first column | |
#' @param ncontrol number of samples from control | |
#' @param ntreatment number of samples from treatment | |
#' @param control indices of control samples | |
#' @param treatment indices of treatment samples | |
#' | |
random_chdir <- function(datain, ncontrol, ntreatment, control, treatment, randomize_gamma=FALSE) { | |
# Take ncontrol samples form control | |
control <- sample(control, ncontrol) | |
# and ntreatment from treatment |
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(shiny) | |
predict <- function(foo_or_bar) { ifelse(foo_or_bar, 'Foo', 'Bar') } | |
runApp(shinyApp( | |
ui = shinyUI(fluidPage( | |
fluidRow( | |
column(12, checkboxInput('foo_or_bar', 'Foo or bar?'), textOutput('text')) | |
) |
OlderNewer