Skip to content

Instantly share code, notes, and snippets.

View jenzopr's full-sized avatar
🦊
Loading..

Dr. Jens Preußner jenzopr

🦊
Loading..
View GitHub Profile
@jenzopr
jenzopr / joinGenomes.py
Last active February 22, 2018 13:27
A command line tool to join genomes and annotations from two or more species.
#!/usr/bin/env python
__author__ = 'Jens Preussner'
__license__ = 'MIT'
import argparse
import logging
import sys
if __name__ == "__main__":
#
@jenzopr
jenzopr / distance-to-median.R
Last active April 11, 2016 13:43
The calc_dm function implements the distance-to-the-median measurement from Kolodziejczyk et. al. (Cell Stem Cell, 2015).
library(zoo)
calc_dm = function(expr, func=median) {
if( is.null(rownames(expr)) ) { rownames(expr) = 1:nrow(expr) }
# Calculate log10 mean of the rows
m = log10(rowMeans(expr))
names(m) = rownames(expr)
# Calculate the squared cv
cv2 = apply(expr, 1, function(x) { (sd(x)/mean(x))^2 })
@jenzopr
jenzopr / annotation.gff
Created December 18, 2014 13:05
ChIPpeakAnno: Non-empty IRange object in case of no overlap
##gff-version 3
chr3 doi:10.1186/1471-2164-12-152 enhancer 34761079 34762078 1 + . is_validated=false;nearest_gene=Sox2;distance=108618;location=intergenic
chr7 doi:10.1186/1471-2164-12-152 enhancer 3206000 3206999 1 + . is_validated=false;nearest_gene=mmu-mir-290;distance=11627;location=intergenic
chr8 doi:10.1186/1471-2164-12-152 enhancer 89003102 89004101 1 + . is_validated=true;nearest_gene=Sall1;distance=23147;location=intergenic
chr9 doi:10.1186/1471-2164-12-152 enhancer 110947497 110948496 1 + . is_validated=false;nearest_gene=Tdgf1;distance=1430;location=upstream
chr12 doi:10.1186/1471-2164-12-152 enhancer 86501051 86502050 0,9999 + . is_validated=false;nearest_gene=Esrrb;distance=19570;location=genic
chr4 doi:10.1186/1471-2164-12-152 enhancer 55475129 55476128 0,9999 + . is_validated=false;nearest_gene=SNORA17;distance=5970;location=upstream
chr8 doi:10.1186/1471-2164-12-152 enhancer 43320647 43321646 0,9999 + . is_validated=false;nearest_gene=Zfp42;distance=13711;location=intergenic
chr9 doi:10.1186
@jenzopr
jenzopr / collection.json
Last active August 29, 2015 14:11
Example: ALPS and Cj - nested and bulk data
{
"collection" : {
"version" : "1.0",
"href" : "http://example.com/collection",
"links" : [
{"rel" : "profile", "href" : "https://gist.github.com/jenzopr/3fb7b358be060711c7da#file-profile-xml"},
],
"items" : [],
"queries" : [
{
@jenzopr
jenzopr / typetest.yaml
Created November 21, 2014 15:02
Typetest profile for cassandra-stress to produce IndexOutOfBounds-Exception
#
# This is an example YAML profile for cassandra-stress
#
# insert data
# cassandra-stress user profile=/home/jake/stress1.yaml ops(insert=1)
#
# read, using query simple1:
# cassandra-stress profile=/home/jake/stress1.yaml ops(simple1=1)
#
# mixed workload (90/10)