Skip to content

Instantly share code, notes, and snippets.

View jwbargsten's full-sized avatar

Joachim Bargsten jwbargsten

View GitHub Profile
@jwbargsten
jwbargsten / density2d_map.R
Created July 18, 2013 15:03
plot pretty 2d density map with ggplot2
library(ggplot2)
library(MASS)
## generate some random data
data <- data.frame(a=abs(rnorm(1000, mean=0.5)), b=abs(rnorm(1000, mean=0.5)))
data$a <- data$a / max(data$a)
data$b <- data$b / max(data$b)
## layout settings for ggplot
@jwbargsten
jwbargsten / makeTranscriptDbFromGFF3.R
Created September 18, 2012 15:23
Create TranscriptDb objects from GFF3 files
## source: http://permalink.gmane.org/gmane.science.biology.informatics.conductor/40247
require(plyr)
require(rtracklayer)
require(GenomicRanges)
require(GenomicFeatures)
## determine the rank for all exons of a transcript
## the rank is reversed, if the strand is negative
.exon_rank_order <- function(exon.starts, strands) { order(exon.starts, decreasing=strands[1] == '-') }
@jwbargsten
jwbargsten / corr_light_intensity.R
Created September 3, 2012 21:09
correlation analysis - light intensity experiment
# Copyright (c) 2012 Joachim Bargsten
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without
# limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
# conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial
# portions of the Software.