Skip to content

Instantly share code, notes, and snippets.

View gjuggler's full-sized avatar

Greg Jordan gjuggler

  • Verily Life Sciences LLC
  • Cambridge, MA
View GitHub Profile
Ext.override(Ext.grid.RowSelectionModel, {
initEvents: function() {
// Create an event which only fires after a selection is DONE changing in response
// to a user interaction (i.e., when we shift-click to select 10 items, this only fires ONCE).
this.addEvents('afterselectionchange');
// Make the grid respond to click events.
this.grid.on('rowclick', this.handleMouseDown, this);
@gjuggler
gjuggler / color.column.R
Created September 15, 2011 16:03
Color the columns of a data frame for LaTeX output
# color.column - color the columns of a table for LaTeX output.
#
# Takes an xtable object and a column name as input, and returns the
# xtable with the chosen column stringified and prepended with color
# values using the \cellcolor command from the xcolor package. For an
# easy copy-paste into a LaTeX document, use xtable's print function
# with the following parameter to preserve the \cellcolor command:
# "sanitize.text.function=function(x){x}". I also like to add
# "include.rownames=F". Here's a worked example:
#
@gjuggler
gjuggler / gist:1619105
Created January 16, 2012 04:42
A simple script for submitting
# farm_scripts.R - a simple script to submit and run LSF jobs and job
# arrays from R. The "main" function reads in arguments from the
# command-line and passes them, possibly along with the job array
# index, to a user-defined function. This can serve as a basic tool
# for creating and running batched processes using R in an LSF
# environment.
#
# contact: greg@ebi.ac.uk
# Extract the command-line arguments
@gjuggler
gjuggler / gist:4534173
Last active December 11, 2015 02:58
A demonstration of functionality included in the phyloseq pull request.
library(devtools)
load_all('phyloseq', reset=T)
data(GlobalPatterns)
x <- subset_species(GlobalPatterns, Phylum == "Chlamydiae")
png(file="01_ladderize_left.png")
p <- plot_tree(x, color="SampleType", label.tips="Genus", size="abundance",
ladderize='left')
print(p)
@gjuggler
gjuggler / gist:8222414
Created January 2, 2014 17:03
CSL styles with second-field-align="margin"
greg$ ack 'second-field-align="margin"' -i ./
advanced-functional-materials.csl
99: <bibliography second-field-align="margin" entry-spacing="0">
american-heart-association.csl
102: <bibliography second-field-align="margin" entry-spacing="0" et-al-min="16" et-al-use-first="15">
bioorganic-and-medicinal-chemistry-letters.csl
93: <bibliography second-field-align="margin" entry-spacing="0">
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cdrEntityManagerFactory' defined in class path resource [org/pmiops/workbench/cdr/CdrDbConfig.class]: Unsatisfied dependency expressed through method 'getCdrEntityManagerFactory' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cdrDataSource' defined in class path resource [org/pmiops/workbench/cdr/CdrDbConfig.class]: Unsatisfied dependency expressed through method 'cdrDataSource' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cdrDbConfig.CdrDataSource' defined in URL [jar:file:/w/common-api/build/libs/common-api-0.1.0.jar!/org/pmiops/workbench/cdr/CdrDbConfig$CdrDataSource.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.pmiops.workbench.cdr.CdrDbConfig$CdrDat