forked from Genentech/pviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-one-liner-multiple-categories.html
161 lines (152 loc) · 5.29 KB
/
example-one-liner-multiple-categories.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<html>
<head>
<title>pViz example - one liner with selected categories</title>
<link rel="stylesheet" type="text/css" href="deps/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="deps/sib-pviz-core.css">
<script src="deps/sib-pviz-bundle.js"></script>
<!-- just a few lines of javscript to decorate the page -->
<script src="examples-utils.js"></script>
</head>
<body class="container">
<div class="row">
<h2>pViz, a one-line example with selected categories</h2>
</div>
<div class="row">
<div class="span6">
<table class="table table-bordered">
<thead>
<tr>
<th>id</th>
<th>psms</th>
</tr>
</thead>
<tbody>
<td> HER2 head </td>
<td id="one-liner"></td>
</tbody>
</table>
</div>
</div>
<div class="row">
<h3>Comments</h3>
We define a SeqEntry object, map features on it and display it as a simple one-liner image.
<br/>
More complex than the <a href="example-one-liner.html">whole features at once</a> one-liner, we can select a groups of features and display each of them on a line.
<br/>
We propose here a dispay of fictitious peptide/spectrum matches (PSM) coverage from two experiments (the
<code>
group
</code>
attibute is the experimental source)
</div>
<script class="example">
//namespace handling pViz classes
var pviz = this.pviz;
/*
* Define the model, a sequence entry with an explicit sequence
* For this example, we don't actually need the sequence itself.
* Whatever string with the correct length is OK (ok, it's ugly, but it can be useful in certain cases)
*/
var seqEntry = new pviz.SeqEntry({
sequence : 'MELAALCRWGLLLALLPPGAASTQVCTGTDMKLRLPASPETHLDMLRHLYQGCQVVQGNLELTYLPTNASLSFLQDIQEVQGYVLIAHNQVRQVPLQRLRIVRGTQLFEDNYALAVLDNGDPLNNTTPVTGASPGGLRELQLRSLTEILKGGVLIQRNPQLCYQDTILWKDIFHKNNQLA'
});
new pviz.OneLiner({
model : seqEntry,
el : '#one-liner',
categories:['exp-A', 'exp-B']
}).render();
/*
* Features are added explicitely.
* There is only on group of features here (secondary_structure). There can be more that would be merged or we could keep only one group with the filer:'xxx' option
*
* In real application, these features would be read from DASReader, a PeffReader or whatever ajax call you find convenient (the view is rendered when model changes)
*/
seqEntry.addFeatures([{
category : 'exp-A',
type : 'psm',
start : 24,
end : 26
},{
category : 'exp-B',
type : 'psm',
start : 24,
end : 26
}, {
category : 'exp-A',
type : 'psm',
start : 38,
end : 49
}, {
category : 'exp-A',
type : 'psm',
start : 53,
end : 57
}, {
category : 'exp-A',
type : 'psm',
start : 59,
end : 63
}, {
category : 'exp-B',
type : 'psm',
start : 59,
end : 63
}, {
category : 'exp-A',
type : 'psm',
start : 71,
end : 73
}, {
category : 'exp-A',
type : 'psm',
start : 78,
end : 81
}, {
category : 'exp-B',
type : 'psm',
start : 78,
end : 87
}, {
category : 'exp-A',
type : 'psm',
start : 83,
end : 87
}, {
category : 'exp-A',
type : 'psm',
start : 91,
end : 94
}, {
category : 'exp-A',
type : 'psm',
start : 108,
end : 110
}, {
category : 'exp-A',
type : 'psm',
start : 111,
end : 116
}, {
category : 'exp-B',
type : 'psm',
start : 111,
end : 124
}, {
category : 'exp-A',
type : 'psm',
start : 129,
end : 131
}, {
category : 'exp-A',
type : 'psm',
start : 138,
end : 140
}, {
category : 'exp-A',
type : 'psm',
start : 150,
end : 155
}]);
</script>
</body>
</html>