-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_evidences.js
47 lines (44 loc) · 1.52 KB
/
add_evidences.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
"use strict";
var uniprot_link = {
'DOMAINS_AND_SITES':'family_and_domains',
'MOLECULE_PROCESSING':'ptm_processing',
'DOMAIN':'domainsAnno_section',
'REGION':'Region_section',
'BINDING':'sitesAnno_section',
'PROPEP':'peptides_section',
'CHAIN':'peptides_section',
'CARBOHYD':'aaMod_section',
'DISULFID':'aaMod_section',
'MOD_RES':'aaMod_section',
'CROSSLNK':'aaMod_section',
'LIPID':'aaMod_section',
'CONFLICT':'Sequence_conflict_section',
'NP_BIND':'regionAnno_section',
'MOTIF':'Motif_section',
'REPEAT':'domainsAnno_section',
'METAL':'sitesAnno_section',
'DNA_BIND':'regionAnno_section',
'SITE':'Site_section',
'SIGNAL':'sitesAnno_section',
'ACT_SITE':'sitesAnno_section'
};
var add_evidences = function(d){
d.forEach(function(i){
i[1].forEach(function(j){
if( !('evidences' in j) ){
//console.log( j['type']+"=>"+uniprot_link[ j['type'] ]);
j['evidences'] = {"Imported information":[{url:'http://www.uniprot.org/uniprot/'+__accession+'#'+uniprot_link[ j['type'] ],id:__accession,name:'Imported from UniProt'}]};
}else{
for(var k in j['evidences']){
j['evidences'][k].forEach(function(l){
//console.log( j['type']+"=>"+uniprot_link[ j['type'] ]);
if( l == undefined ){
j['evidences'][k] = [{url:'http://www.uniprot.org/uniprot/'+__accession+'#'+uniprot_link[ j['type'] ],id:__accession,name:'Imported from UniProt'}];
}
});
}
}
});
});
};
module.exports = add_evidences;