Skip to content

Instantly share code, notes, and snippets.

View lianos's full-sized avatar

Steve Lianoglou lianos

View GitHub Profile
@lianos
lianos / GenomicRanges-comparison.R
Created June 15, 2011 05:13
An all R GenomicRanges::order implementation
setMethod("order", "GenomicRanges",
function(..., ignore.strand=FALSE, na.last=TRUE, decreasing=FALSE) {
if (!isTRUEorFALSE(decreasing)) {
stop("'decreasing' must be TRUE or FALSE")
}
args <- list(...)
if (length(args) != 1L) {
stop("ordering more than one GRanges is undefined")
}
x <- args[[1L]]
@lianos
lianos / update-multi-R-links.sh
Created September 16, 2011 14:56
Script to have current R-devel (R-2.14) run side by side with R-2.13 on OS X
@lianos
lianos / rho-Biostrings.R
Created January 17, 2012 14:38
rho statistic with Biostrings
library(Biostrings)
setGeneric("rho", function(x, ...) standardGeneric("rho"))
setMethod("rho", c(x="XStringSet"),
function(x, ...) {
if (!xsbasetype(x) %in% c("DNA", "RNA")) {
stop("`x` must be of DNA or RNA base type")
}
di <- oligonucleotideFrequency(x, 2L, as.prob=TRUE)
@lianos
lianos / seqc-eSet.R
Created November 18, 2014 20:17
Functions for the Bioconductor seqc package to generate ExpressionSets from the data provided
library(seqc)
##' Creates an ExpressionSet of counts for a given subset of the samples
##' provided by the seqc data package.
##'
##' Currently this only works for \code{feature == 'gene'}.
##'
##' @param feature The type of features you want to build an ExpressionSet
##' out of (gene, junction, taqman
##' @param annotation If \code{feature == 'gene'}, then this determines which