Skip to content

Instantly share code, notes, and snippets.

@bmiles
bmiles / mag.py
Created July 25, 2016 11:11
Example of using some of the mag bead operations in autoprotocol.
from autoprotocol_utilities.magnetic_helpers import get_mag_amplicenter, get_mag_frequency
source_plate = protocol.ref(
block_name,
cont_type="96-deep-kf",
storage="cold_80")
protocol.dispense_full_plate(
source_plate,
"water",
"900:microliter")
import requests
import json
# Use autoprotocol-python package to generate autoprotocol
import autoprotocol as ap
# Example protocol
p = ap.Protocol()
con = p.ref("name", id=None, cont_type="96-flat", storage=None, discard=True)
p.cover(con)
@bmiles
bmiles / biocoder_autoprotocol_oct_2015.json
Created September 24, 2015 18:48
This file is an example of a simple bacterial incubation and OD600 experiment documented in the Autoprotocol JSON data standard.
{
"refs": {
"growth_plate": {
"id": "3208kfhf394",
"store": {
"where": "cold_4"
}
},
"DH5a": {
"discard": true,
@bmiles
bmiles / biocoder_python_Oct_2015.py
Created September 24, 2015 18:46
This code uses Autoprotocol-Python to generate Autoprotocol JSON for a simple bacterial incubation and OD600 measurement.
from autoprotocol.protocol import Protocol
p = Protocol()
# Set up the containers being referenced
ctrl_bacteria = p.ref("DH5a", id="3209xifd029", cont_type="micro-1.5", discard=True)
growth_plate = p.ref("growth_plate", id="3208kfhf394", cont_type="96-flat", storage="cold_4")
# Dispense, transfer, cover the plate, incubate, measure OD600
p.dispense(growth_plate, "lb-broth-noAB", [{"column": "0", "volume": "150:microliter"}])
p.transfer(ctrl_bacteria.well(0), growth_plate.wells_from(0,4, columnwise=True), "2:microliter")
@bmiles
bmiles / LICENSE.md
Last active August 29, 2015 14:13 — forked from davefp/LICENSE.md
Chart Plotting with Chartist in Dashing

The MIT License (MIT)

Copyright (c) 2015 Ben Miles

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:

@bmiles
bmiles / .Rprofile
Created January 17, 2015 12:02
.Rprofile
library('colorout')
setOutputColors256(normal = 70, number = 56, negnum = 56, date = 56, string = 179, const = 202, verbose = FALSE)
library('dplyr')
library('ggplot2')
options(repos=structure(c(CRAN='http://cran.ma.imperial.ac.uk/')))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style> div {background-color: #e0e0e0}</style>
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
@bmiles
bmiles / Translocation bean plot.R
Created July 30, 2014 14:50
R code to generate beanplot from translocation data.
library('beanplot')
//load CSV data into data frame
df <- data.frame(read.csv('./data/Max_Width.csv'))
//beanplot amplitude column, add colours, add labels
beanplot(df$Peak.Amplitude..nA.,
col=c('#bdc3c7','#1abc9c','#1abc9c'),
show.names= TRUE,
@bmiles
bmiles / rebin.R
Last active August 29, 2015 14:04
R function to rebin a matrix by taking averages, then plots the heatmap
# Simple ggplot2 heatmap
# with colorBrewer "spectral" palette
doInstall <- FALSE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
require('rje')
require('reshape2')
# Generate a random matrix
@bmiles
bmiles / bin.matlab
Created July 17, 2014 11:38
rebinning a matrix
b = a; #original image
[L W] = size(a); % get dimensions of matrix
% define bin factor
BinW = 8;
BinL = 8;
% chaning the size of matrix b, to binL by ?? then adding 1