This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check the status of your jobs | |
qstat | |
# check the status of all jobs | |
qstat -u '*' | |
# check the status of the merlin cluster | |
qhost | |
# run an interactive analysis (default is one core and no memory) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the data in | |
imageStackDirectory=getDirectory("Select the folder where the images should loaded from"); | |
run("Image Sequence...", "open="+imageStackDirectory+" sort"); | |
run("Set Measurements...", "area mean min centroid center perimeter bounding fit shape redirect=None decimal=3"); | |
// Apply a threshold | |
setThreshold(129, 255); | |
setOption("BlackBackground", false); | |
run("Convert to Mask", "method=Default background=Dark black"); | |
imgDirectory=getInfo("image.directory"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% this function (will) performs the ellipsoid based shape analysis on a 3D image | |
% the input is a labeled image probably from the bwlabel function | |
% the output is an array formatted like such | |
% labelId, volume, centerX, centerY, centerZ, extentsX, extentsY, extentsZ, pca1X, pca1Y, pca1Z, score1, score2, score3 | |
function [out_table]=ellipsoid_analysis(in_image,out_file) | |
% create an array the same size as the image of x,y, and z points. This way we can calculate | |
% center of volume and other parameters by using multiplication | |
[xgrid,ygrid,zgrid]=meshgrid(1:size(in_image,1),1:size(in_image,2),1:size(in_image,3)); | |
num_of_obj=max(in_image(:)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################## | |
## | |
## Mandelbrot pictures with MATLAB and Condor | |
## Filename: mandelbrot.condor | |
## | |
################################################################## | |
# | |
# For this example, variables not used by Condor are marked my_* | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################## | |
## | |
## Run a parameter sweep with threshold and filter using condor | |
## Filename: batchimage.condor | |
## | |
################################################################## | |
universe = vanilla | |
getenv = True # MATLAB needs local environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from https://gist.github.com/kmader/10871528 | |
// Load the data in | |
imageStackDirectory=getDirectory("Select the folder where the images should loaded from"); | |
run("Image Sequence...", "open="+imageStackDirectory+" sort use"); | |
// crop the image | |
makeRectangle(1089, 993, 675, 702); | |
run("Crop"); | |
// clear the meaningless pixel sizes and set them to 0 | |
run("Properties...", "unit=pixel pixel_width=1 pixel_height=1 voxel_depth=1 global"); | |
// set which metrics to record for each analysis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(igraph) | |
library(plyr) | |
node.names<-c("Gene 104","Gene 105", "Gene 106","Cellular Structure","Cellular Viability","Turnover Rate","Mechanosensitivity","AB Signaling","BC Signaling","Temperature","pH","Mixing Rate","Cooling Rate","Catalysts") | |
c.mat<-matrix(0,length(node.names),length(node.names)) | |
colnames(c.mat)<-node.names | |
rownames(c.mat)<-node.names | |
rr<-function(x=length(node.names),n=1) round(runif(n,min=0,max=x)+.5) | |
edge.count<-round(3*length(node.names)) | |
for(i in c(1:edge.count)) { | |
rpos<-rr(n=2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(reshape2) | |
parm.table<-expand.grid(Temperature=seq(20,80,length.out=20),Gene=c(1,2,3),pH=seq(3,6,length.out=10)) | |
rf<-function(amplitude=0.1) runif(nrow(parm.table),min=1/(1+amplitude),max=1+amplitude) | |
parm.table$Thickness<-with(parm.table,10^(pH+as.numeric(Gene))-10*Temperature)*rf(.1) | |
parm.table$Count<-with(parm.table,10^(as.numeric(Gene))+100*Temperature)*rf(0.01) | |
parm.table$Connections<-with(parm.table,2^(as.numeric(Gene))-5*as.numeric(Gene)+12)*rf(0.2) | |
parm.table$GrowthRate<-with(parm.table,log(Thickness/Count)*Gene)*rf(0.2) | |
parm.table$Strength<-with(parm.table,Count/Connections)*rf(0.1) | |
parm.table$Viability<-with(parm.table,10^(10-Connections))*rf(0.2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Touches all files in the image folder based on a list of sample names to keep (prevent from being autodeleted | |
""" | |
start_dir='/sls/X02DA/data/e14570/Data10/' | |
from subprocess import call,Popen,PIPE | |
import os | |
fancyExec=lambda cmd: Popen(cmd.split(' '), stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()[0].split('\n') | |
clean_line = lambda lines: dict(filter(lambda cline: len(cline[0])>0,map(lambda cline: (cline.upper().strip(),cline.strip()),lines))) | |
keeplines = clean_line(open('keepfiles.txt').readlines()).keys() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val inData=sc.textFile("tiny.csv") | |
// Read the first line and split by commas | |
import scala.collection.immutable.StringOps | |
val header= inData.first | |
val headerLine = header.split(",").map(_.trim.filter(_ != '"')) | |
// Count lines in the file | |
inData.count | |
// Remove the header from the data | |
val rowData = inData.filter(_ != header).cache | |
// Divide each row into columns by seperating by commas |