-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_pfam.js
30 lines (27 loc) · 887 Bytes
/
add_pfam.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
"use strict";
var add_pfam = function(data){
var n = 1;
var _pfam = [];
data.forEach(function(i){
var _description = '<b>'+i['info']['description']+'</b>';
_description += '<br/><b style="color:grey;">Family</b>: '+i['acc']
var _ext = '';
for(var k in i['info']['go']){
_ext += '<b style="color:grey;">'+k[0].toUpperCase() + k.slice(1)+'</b>: ';
i['info']['go'][k].forEach(function(j){
_ext += j+', ';
});
_ext = _ext.slice(0, -2)+'<br/>';
}
if( _ext.length > 0 ) _description += '<br/>'+_ext;
var _f = {begin:i['start'],end:i['end'],description:_description,internalId:'pfam_'+n,type:'PFAM_DOMAIN',evidences:
{
"Imported information":[{url:'http://pfam.xfam.org/protein/'+__accession,id:__accession,name:'Imported from Pfam'}]
}
}
_pfam.push(_f);
n++;
});
return _pfam;
};
module.exports = add_pfam;