A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
{ | |
"logging": { | |
"version": 1, | |
"disable_existing_loggers": true, | |
"formatters": { | |
"brief": { | |
"class": "logging.Formatter", | |
"datefmt": "%I:%M:%S", | |
"format": "%(levelname)-8s; %(name)-15s; %(message)s" | |
}, |
#! /usr/bin/env python | |
# ID mapping using mygene | |
# https://pypi.python.org/pypi/mygene | |
# http://nbviewer.ipython.org/gist/newgene/6771106 | |
# http://mygene-py.readthedocs.org/en/latest/ | |
# 08/30/14 | |
__author__ = 'tommy' |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This is a tutorial I have presented for the class Genomics and Systems Biology at the University of Chicago. In this course the students learn about study design, normalization, and statistical testing for genomic studies. This is meant to introduce them to how these ideas are implemented in practice. The specific example is a differential expression analysis with edgeR starting with a table of counts and ending with a list of differentially expressed genes.
Past versions:
library(shiny) | |
library(ggplot2) | |
# Get the current day of the month | |
dom <- 25 | |
# Define the target for salespeople in our organization. | |
salesTarget <- 15000 | |
# Set the seed so we always get the same data. |
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
import os | |
import random | |
import string | |
import tempfile | |
import subprocess | |
def random_id(length=8): | |
return ''.join(random.sample(string.ascii_letters + string.digits, length)) | |
TEMPLATE_SERIAL = """ |
library(shiny) | |
library(deSolve) | |
library(cummeRbund) | |
# load cuffDiff data, must be in top dir and called cuffData.db: | |
cuff = readCufflinks() | |
shinyServer(function(input,output) { | |
getData = reactive(function() { |
#!/usr/bin/python | |
''' | |
Launch codeml on all the alignments | |
Marco Galardini 2012 | |
University of Florence | |
GPL v3.0 | |
''' | |
from optparse import OptionParser, OptionGroup | |
from time import strftime |
#!/usr/bin/env python | |
from multiprocessing import Process, Pool | |
import time | |
import urllib2 | |
def millis(): | |
return int(round(time.time() * 1000)) | |
def http_get(url): |