Skip to content

Instantly share code, notes, and snippets.

View joelcarlson's full-sized avatar
😄

Joel Carlson joelcarlson

😄
  • Amazon
  • Palo Alto, CA
View GitHub Profile
@joelcarlson
joelcarlson / ggConnectStripChart.r
Last active August 29, 2015 14:27
Template for creating a strip chart with the dots connected to each other. Data should be in melted form (see reshape2::melt() ). Going to need to edit and play around if you need to connect more than two points. I probably should just make this a function, but in lieu of that, here is a template!
ggplot(data, aes(x=factor, y=value, col=variable, alpha=0.75)) +
geom_point() +
geom_segment(data=YOURDATA, aes(x = 1, y = COLUMNOFYVALS, xend = 2, yend = COLUMNOFOTHERYVALS, col=variable, alpha=0.75)) +
ggtitle("Whatever you like") +
labs(y="asdasd", x="asdasd") +
theme_fivethirtyeight() +
scale_alpha(guide = "none") +
theme(#legend.justification=c(1,1), legend.position=c(1,1),, #Make background white,
legend.title=element_blank(),
@joelcarlson
joelcarlson / segmentCellNuclei.ijm
Created July 31, 2015 10:54
FIJI (ImageJ) macro to segment and calculate shape and first order statistics of cell nuclei in H&E stained histological images. Based on http://earlybreast.becklab.org/code . Make sure in the output directory you have a folder called "Image" for the thresholded images to save to, or comment out the first saveAs call. Several parameters are empi…
input = getDirectory("Input directory");
output = getDirectory("Output directory");
Dialog.create("File type");
Dialog.addString("File suffix: ", ".tiff", 5);
Dialog.show();
suffix = Dialog.getString();
processFolder(input);