forked from birdumbrella/nano-ID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstability.R
42 lines (17 loc) · 882 Bytes
/
stability.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
### prewd ###
prewd = file.path(getwd(),"...")
### setwd ###
setwd(file.path(prewd,"..."))
### number of cores ###
mc.cores = detectCores()
### basic objects ###
basic.objects = c(ls(),"basic.objects")
### calculate stability based on single molecule counts ###
alpha = log(2)/(24*60)
decay.rate.single.molecule = - alpha - (1/60)*log(1 - labeled.counts/total.counts)
decay.rate.single.molecule[decay.rate.single.molecule <= 0] = NA
synthesis.rate.single.molecule = total.counts*(alpha + decay.rate.single.molecule)
half.lives.single.molecule = log(2)/decay.rate.single.molecule
save(decay.rate.single.molecule,file=file.path("...","decay.rate.single.molecule.RData"))
save(synthesis.rate.single.molecule,file=file.path("...","synthesis.rate.single.molecule.RData"))
save(half.lives.single.molecule,file=file.path("...","half.lives.single.molecule.RData"))