This file contains 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(parallel) | |
cores = 5 | |
bigN = 50000000 | |
# Function which can take a noticeable time to run for large N | |
sumnorm = function(N) sum(rnorm(N)) | |
cl = makeCluster(cores) |
This file contains 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
makeBoundsQFA<-function(inocguess,d,minK=0,fixG=FALSE,globalOpt=FALSE){ | |
if(is.null(inocguess)){ | |
# Without a sensible independent estimate for inoculum density, the best we can do is to estimate it based on observed data. | |
# This strategy will only work well if the inoculum density is high enough to be measurable (e.g. pinned cultures or | |
# conc. spotted) and is clearly observed. Clearly observed means: no condensation on plates immediately after they are | |
# placed in incubator for example. | |
if(length(d$Growth)>0) {candidate=min(d$Growth)}else{candidate=0} | |
inocguess=max(0.001,candidate) | |
} |
This file contains 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
fnames = list.files(pattern="*.out") | |
datlist = lapply(fnames, read.delim,sep="\t",header=TRUE,stringsAsFactors=FALSE) | |
dat = do.call("rbind", datlist) | |
dat$ID=paste(dat$Barcode,dat$Row,dat$Column,sep="_") | |
dat$time=as.numeric(sapply(strsplit(dat$Filename,'_'), "[", 4)) | |
dat=dat[order(dat$time),] | |
pdf("GrowthCurves.pdf") | |
by(dat,dat$ID,function(x) plot(x$time,x$Intensity,type="b",xlab="Time",ylab="Intensity",ylim=c(0,0.1),main=unique(x$ID))) | |
dev.off() |
This file contains 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
# To execute this script manually, in parallel on multiple CPUs: | |
# Rscript Scripts/QFA_ANALYSIS_INDIVIDUAL.R QFA0028 QFA0029 & | |
# Rscript Scripts/QFA_ANALYSIS_INDIVIDUAL.R QFA0030 QFA0031 & | |
library(parallel) | |
source("Scripts/QFA_ANALYSIS.R") | |
PLOSGenetics=sprintf("QFA%04d",c(28,29,30,31,35,36)) | |
# NCPUs is the maximum number of CPUs the script can use on this node (should be less than 48 on cisban cluster) | |
NCPUs=47 | |
cisbanNodes=TRUE |
This file contains 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
from colonyzer2.functions import * | |
import time, sys, os, numpy, PIL | |
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") | |
print("Note that this script requires a Colonyzer.txt file (as generated by ColonyzerParametryzer) describing initial guess for culture array") | |
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") | |
# Lydall lab file naming convention | |
# First 15 characters in filename identify unique plates | |
# Remaining charaters can be used to store date, time etc. |
This file contains 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(qfa) | |
numerical_r=function(obsdat,mkPlots=FALSE,span=0.5,nBrute=1000,cDiffDelta=0.0001){ | |
# Generate numerical (model-free) estimate for maximum intrinsic growth rate | |
tims=obsdat$Expt.Time | |
gdat=obsdat$Growth | |
tmax=max(tims) | |
# Smooth data, find slope as function of time and maximum slope | |
gdat=log(gdat) |
This file contains 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
import Control.Parallel (par, pseq) | |
import Control.DeepSeq | |
import System.Environment (getArgs) | |
import Data.Time.Clock (diffUTCTime, getCurrentTime) | |
data Tree x = Empty | Node x (Tree x) (Tree x) deriving (Show, Read, Eq) | |
-- Create instance of NFData for Tree data type (defining "normal form") | |
instance NFData a => NFData (Tree a) where | |
rnf Empty = () |
This file contains 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
import Control.Parallel (par, pseq) | |
import Control.DeepSeq | |
import System.Environment (getArgs) | |
import Data.Time.Clock (diffUTCTime, getCurrentTime) | |
data Tree x = Empty | Node x (Tree x) (Tree x) deriving (Show, Read, Eq) | |
-- Create instance of NFData for Tree data type (defining "normal form") | |
instance NFData a => NFData (Tree a) where | |
rnf Empty = () |
This file contains 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
data Cell = Cell {teloLength :: Double, birthDate :: Double, lifeSpan :: Double, seedCell :: Integer} | |
instance Eq Cell where (Cell t1 _ _ _) == (Cell t2 _ _ _) = t1 == t2 | |
instance Ord Cell where (Cell t1 _ _ _) `compare` (Cell t2 _ _ _) = t1 `compare` t2 | |
instance Show Cell where show (Cell t b _ _) = show t ++ " " ++ show b | |
data CellLine x = Senescent | Mother x (CellLine x) (CellLine x) deriving (Show, Read, Eq) | |
-- Functions modelling cell biology | |
shortenTelo :: Cell -> Cell | |
shortenTelo (Cell telo x y oldseed) = Cell (telo - delta) x y newseed |
This file contains 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
# Demonstrating significant differences between a | |
# vector of measurements and a single value | |
# Using the statsmodels package for doing test | |
# Using numpy to generate some fake data | |
from statsmodels.stats import weightstats as stests | |
import numpy as np | |
data=np.random.normal(loc=3.4,scale=0.1,size=100) | |
singleValue=3.3 |
OlderNewer