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
primes = [] | |
x = 2 | |
nthprime = 1000 # set to 1000 to get the 1000th prime number | |
while len(primes) < nthprime: | |
isPrime = True | |
for item in primes: | |
if item > x**.5: | |
break | |
if x % item == 0: | |
isPrime = False |
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
# Eric Minikel | |
# 2014-01-12 | |
# explore relationship between inoculated dose and incubation time | |
# this is all the code from this post: | |
# http://www.cureffi.org/2014/01/12/prion-kinetic-models-relationship-inoculum-titer-incubation-time/ | |
logdose = runif(n=100,min=0,max=10) # simulate 100 different experiments with diff titers | |
days = 10^( (logdose-26.66)/(-12.99) ) + 40 + rnorm(n=100,m=0,s=2) # apply Prusiner's model | |
plot(logdose,days,xlab="log10(LD50 units)",ylab="days to illness",pch=19, | |
main="incubation time interval bioassay\nPrusiner 1982b - Sc237 in hamsters", |
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
#!/broad/software/free/Linux/redhat_5_x86_64/pkgs/r_3.0.2/bin/Rscript | |
# Eric Vallabh Minikel | |
# CureFFI.org | |
# 2014-01-14 | |
# example of how to use optparse in R scripts | |
# usage: ./exampleRScript1.r -a thisisa -b hiagain | |
# ./exampleRScript1.r --avar thisisa --bvar hiagain |
OlderNewer