-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_mobi.js
48 lines (46 loc) · 1.5 KB
/
add_mobi.js
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
41
42
43
44
45
46
47
48
"use strict";
var add_mobi = function(_data, dom_sites){
var data = _data['disorder'];
var n = 1;
var _disorder = [];
var _lips = []
var _flag = false;
for(var i in data){
var _type = i.toUpperCase();
data[i].forEach(function(j){
var _des = "";
if(j['method']!="full")_des = " - Inferred from "+j['method'];
_disorder.push({type:_type,begin:j['start'],end:j['end'],description:'Disordered region'+_des,internalId:'mobi_'+n,evidences:
{
"Imported information":[{url:'http://mobidb.bio.unipd.it/entries/'+__accession, id:__accession, name:'Imported from MobyDB'}]
}
});
n++;
_flag = true;
});
}
var data = _data['lips'];
for(var i in data){
var sub_type = i.toUpperCase();
data[i].forEach(function(j){
var new_flag = true;
/*dom_sites.forEach(function(d){
if( d['type']=="LINEAR_MOTIF" && parseInt(d["begin"]) == j["start"] && parseInt(d["end"]) == j["end"]){
new_flag = false;
}
});*/
if(new_flag){
_lips.push({type:"LINEAR_INTERACTING_PEPTIDE",begin:j['start'],end:j['end'],description:'Interacting peptide region',internalId:'mobi_'+n, evidences:
{
"Imported information":[{url:'http://mobidb.bio.unipd.it/entries/'+__accession, id:__accession, name:'Imported from MobyDB'}]
}
});
n++;
_flag = true;
}
});
}
var data = _data['lips'];
return [_disorder,_lips];
};
module.exports = add_mobi;