-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.R
More file actions
39 lines (36 loc) · 1.18 KB
/
plot.R
File metadata and controls
39 lines (36 loc) · 1.18 KB
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
require(plyr)
exps = read.table("./data.txt", sep=',', header=T, stringsAsFactors=F)
data = by(exps, 1:nrow(exps),
function(row)
{
t = read.table(row$datafile, sep='\t', header=F, stringsAsFactors=F, fill=T)
t = t[,c("V6", "V5")]
colnames(t) <- c("atom", "value")
t$value = abs(t$value)*2^(-row$NCproc)
t$medium = row$medium
t$resudue = sub("\\S+\\s(\\S+)", "\\1", t$atom)
t$nucleus = sub("(\\S+)/\\S+\\s.+", "\\1", t$atom)
return(t)
}
)
data=rbind.fill(data)
db = data.frame(atom=character(0))
for ( i in c("c_0", "c_1", "n_0", "n_1"))
{
x = strsplit(i, "_")[[1]]
t = read.table(paste0("./db",x[1],"/", x[2], ".txt"),
sep='\t', header=F, stringsAsFactors=F, fill=T)
t = t[,c("V6", "V5")]
colnames(t) <- c("atom", i)
db = merge(x=db, by.x = "atom", y = t, by.y="atom", all=T)
}
m = data.frame(atom=character(0))
for ( i in c("c_0", "c_1", "n_0", "n_1"))
{
x = strsplit(i, "_")[[1]]
t = read.table(paste0("./m",x[1],"/", x[2], ".txt"),
sep='\t', header=F, stringsAsFactors=F, fill=T)
t = t[,c("V6", "V5")]
colnames(t) <- c("atom", i)
m = merge(x=m, by.x = "atom", y = t, by.y="atom", all=T)
}