-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrebuild_ptm.js
More file actions
41 lines (30 loc) · 814 Bytes
/
rebuild_ptm.js
File metadata and controls
41 lines (30 loc) · 814 Bytes
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
40
"use strict";
var rebuild_ptm = function(d){
var __ptm = ["",[]];
d.forEach(function(i){
if(i[0]=="PTM"){
__ptm = i;
}
});
__ptm[1].forEach(function(i){
var i_t = i['description'].toLowerCase();
if( i_t.indexOf("methyl")>-1 ){
i['type'] = 'MOD_RES_MET';
}else if( i_t.indexOf("acetyl")>-1 ){
i['type'] = 'MOD_RES_ACE';
}else if( i_t.indexOf("crotonyl")>-1 ){
i['type'] = 'MOD_RES_CRO';
}else if( i_t.indexOf("citrul")>-1 ){
i['type'] = 'MOD_RES_CIT';
}else if( i_t.indexOf("phospho")>-1 ){
i['type'] = 'MOD_RES_PHO';
}else if( i_t.indexOf("ubiq")>-1 ){
i['type'] = 'MOD_RES_UBI';
}else if( i_t.indexOf("sumo")>-1 ){
i['type'] = 'MOD_RES_SUM';
}else if( i_t.indexOf("glcnac")>-1 ){
i['type'] = 'CARBOHYD';
}
});
};
module.exports = rebuild_ptm;