Skip to content

Commit d073f69

Browse files
committed
peptide table updated as stated in #37
1 parent 298d9f7 commit d073f69

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

src/main/webapp/components/directives/peptideSequenceViewer-directive/peptideSequenceViewer-directive.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
ng-class='{modified: modifications[$index]!=undefined}'
44
tooltip="{{modifications[$index]}}"
55
tooltip-placement="bottom">{{aminoacid}}</span>
6-
<span class="peptide-sequence">({{charge}}+ @ {{mz}} m/z)</span>
6+
<span ng-show=""{{charge!=null}}" class="peptide-sequence">({{charge}}+ @ {{mz}} m/z)</span>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<table ng-table="tableParams" class="table">
22
<tr ng-repeat="peptide in peptides_slice">
33
<td data-title="'Peptide'">
4-
{{peptide.sequence}}
4+
<prc-peptide-sequence-viewer
5+
sequence="peptide.sequence"
6+
modifications="peptide.mods"
7+
charge="cluster.averagePrecursorCharge"
8+
mz="cluster.averagePrecursorMz | number:2">
9+
</prc-peptide-sequence-viewer>
10+
<!--{{peptide.sequence}}-->
511
</td>
6-
<td data-title="'Modifications'">
7-
<div ng-show="peptide.modifications.length<1">No modifications</div>
8-
<div ng-repeat="modification in peptide.modifications">
9-
{{modification.name}} at position {{modification.position}}
10-
</div>
11-
</td>
12-
<td data-title="'Number of PSM'">
12+
<td data-title="'# PSM'">
1313
{{peptide.numberOfPSMs}}
1414
</td>
15-
<td data-title="'Number of Species'">
15+
<td data-title="'# Species'">
1616
{{peptide.species.length}}
1717
</td>
18+
<td data-title="'# Projects'">
19+
{{peptide.projectAccessions.length}}
20+
</td>
1821
</tr>
1922
</table>

src/main/webapp/components/directives/peptideViewer-directive/peptideViewer-directive.js

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ peptideViewerDirective.directive('prcPeptideViewer', ['ClusterPeptides', 'ngTabl
1616

1717
scope.peptides = peptides.clusteredPeptides;
1818

19+
// here we create a simplified modification list for each peptide that is used for
20+
// showing tooltips as required by the <prc-peptide-sequence-viewer> directive
21+
for (j = 0; j < scope.peptides.length; j++) {
22+
var peptide = scope.peptides[j];
23+
peptide.mods = [];
24+
if (peptide.modifications!=null) {
25+
for (i = 0; i < peptide.modifications.length; i++) {
26+
peptide.mods[peptide.modifications[i].mainPosition - 1] = peptide.modifications[i].name;
27+
}
28+
}
29+
}
30+
1931
scope.tableParams = new ngTableParams({
2032
page: 1, // show first page
2133
count: 10 // count per page

0 commit comments

Comments
 (0)