Progress batman

From CSBLwiki

(Difference between revisions)
Jump to: navigation, search
(How to get residue correlation matrix)
Line 12: Line 12:
==ADDA algorithm==
==ADDA algorithm==
===How to get residue correlation matrix===
===How to get residue correlation matrix===
-
<pre>
+
<pre style col="blue">
# set working directory
# set working directory
setwd("/Users/igchoi/Downloads/")
setwd("/Users/igchoi/Downloads/")
 +
# read blast table
# read blast table
tmp = read.table("sample.tab",sep="\t")
tmp = read.table("sample.tab",sep="\t")
-
# dimension
+
 
 +
# check dimension of table
dim(tmp)
dim(tmp)
-
# extract gi number
+
 
 +
# change simpler GI number (skip this if you don't understand)
tmp[,1] = sapply(as.vector(tmp[,1]), function(x) {
tmp[,1] = sapply(as.vector(tmp[,1]), function(x) {
   y = strsplit(x,"\\|"); return(unlist(y)[2]) })
   y = strsplit(x,"\\|"); return(unlist(y)[2]) })
tmp[,2] = sapply(as.vector(tmp[,2]), function(x) {
tmp[,2] = sapply(as.vector(tmp[,2]), function(x) {
   y = strsplit(x,"\\|"); return(unlist(y)[2]) })
   y = strsplit(x,"\\|"); return(unlist(y)[2]) })
-
#
+
 
 +
# check the result
tmp[1:5,]
tmp[1:5,]
-
# V7-V8 V9-V10 (aligned?)
+
 
-
# query = 590 residues
+
# aligned region: V7 V8, V9 V10
-
count.que = matrix(0,nrow(tmp),590)
+
# query length = 590 residues
 +
count.que = matrix(0,nrow(tmp),590) # <- build empty 'aligned' matrix
for(i in 1:nrow(tmp)) {
for(i in 1:nrow(tmp)) {
   res = unlist(tmp[i,7:8])
   res = unlist(tmp[i,7:8])
Line 34: Line 39:
   count.que[i,c(res[1]:res[2])] = 1
   count.que[i,c(res[1]:res[2])] = 1
}
}
 +
 +
# check aligned region (blue colored regions are aligned with other proteins - central region)
image(t(count.que),col=c("white","blue"))
image(t(count.que),col=c("white","blue"))
-
# count number of neighbors occurring both position i and j
+
 
-
corr = matrix(0,590,590)
+
# count number of neighbors occurring both position i and j (using 'aligned' matrix)
 +
corr = matrix(0,590,590) # <- set empty correlation matrix (590 x 590)
 +
 
for (i in 1:ncol(count.que)) {
for (i in 1:ncol(count.que)) {
   for (j in i:ncol(count.que)) {
   for (j in i:ncol(count.que)) {
Line 45: Line 54:
   }
   }
}
}
 +
 +
# range of number of neighbors (among 52 hits)
range(corr)
range(corr)
 +
 +
# check highly correlated region in the correlation matrix
image(corr,col=topo.colors(10))
image(corr,col=topo.colors(10))
 +
</pre>
</pre>

Revision as of 13:01, 14 February 2011

배형섭

Contents

2011

Error fetching PMID 12706730:
  1. Error fetching PMID 12706730: [ADDA]

Schedule

ADDA algorithm

How to get residue correlation matrix

# set working directory
setwd("/Users/igchoi/Downloads/")

# read blast table
tmp = read.table("sample.tab",sep="\t")

# check dimension of table
dim(tmp)

# change simpler GI number (skip this if you don't understand)
tmp[,1] = sapply(as.vector(tmp[,1]), function(x) {
  y = strsplit(x,"\\|"); return(unlist(y)[2]) })
tmp[,2] = sapply(as.vector(tmp[,2]), function(x) {
  y = strsplit(x,"\\|"); return(unlist(y)[2]) })

# check the result
tmp[1:5,]

# aligned region: V7 V8, V9 V10
# query length = 590 residues
count.que = matrix(0,nrow(tmp),590)  # <- build empty 'aligned' matrix
for(i in 1:nrow(tmp)) {
  res = unlist(tmp[i,7:8])
  print(res)
  count.que[i,c(res[1]:res[2])] = 1
}

# check aligned region (blue colored regions are aligned with other proteins - central region)
image(t(count.que),col=c("white","blue"))

# count number of neighbors occurring both position i and j (using 'aligned' matrix)
corr = matrix(0,590,590)  # <- set empty correlation matrix (590 x 590)

for (i in 1:ncol(count.que)) {
  for (j in i:ncol(count.que)) {
    print(paste(i,j))
    chk = count.que[,i]+count.que[,j]
    cnt = length(which(chk==2))
    corr[i,j] = cnt
  }
}

# range of number of neighbors (among 52 hits)
range(corr)

# check highly correlated region in the correlation matrix
image(corr,col=topo.colors(10))

Personal tools
Namespaces
Variants
Actions
Site
Choi lab
Resources
Toolbox