-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglycan_map.R
More file actions
39 lines (31 loc) · 1.38 KB
/
glycan_map.R
File metadata and controls
39 lines (31 loc) · 1.38 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
glycan_map <- function(prep_pdb, map_file, glycan_map_file)
{
source('~/Desktop/Protein_analysis/scripts/LinkInfo.R')
links <- link_info(in_file = prep_pdb, out_file = '', return_d = T)
new_data <- links[rep(1:nrow(links), 11) ,]
for (i in 1:nrow(links))
{
start <- as.numeric(links$hetresno[i])
new_data$hetresno[new_data$resno == links$resno[i]] <- start:(start + 10)
}
map <- read.csv(map_file, sep = "", stringsAsFactors = F)
new_data <- merge(new_data, map, by.x = 'resno', by.y = 'seq')
write.table(new_data, glycan_map_file, row.names = F)
}
glycan_map('~/Desktop/Protein_analysis/Prep/Du156/Du156_m9_2_301_prep.pdb',
'~/Desktop/Protein_analysis/map/Du156_301/map.txt',
'~/Desktop/Protein_analysis/map/Du156_301/glycan_map.txt')
glycan_map_to_CA <- function(prep_pdb, map_file, glycan_map_file)
{
source('~/Desktop/Protein_analysis/scripts/LinkInfo.R')
links <- link_info(in_file = prep_pdb, out_file = '', return_d = T, cut_off = 6, NLN_elety = "CA")
new_data <- links[rep(1:nrow(links), 11) ,]
for (i in 1:nrow(links))
{
start <- as.numeric(links$hetresno[i])
new_data$hetresno[new_data$resno == links$resno[i]] <- start:(start + 10)
}
map <- read.csv(map_file, sep = "", stringsAsFactors = F)
new_data <- merge(new_data, map, by.x = 'resno', by.y = 'seq')
write.table(new_data, glycan_map_file, row.names = F)
}