Changeset 4978
- Timestamp:
- Sep 24, 2018, 10:51:24 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/flaggedalignment/search.js
r4976 r4978 1090 1090 if (okToUse.value == 'ok-rna') 1091 1091 { 1092 item = {'type': 'EXTRACT', 'id': aligned.rna.id, 'okToUse': true };1092 item = {'type': 'EXTRACT', 'id': aligned.rna.id, 'okToUse': true, 'sort': 5 }; 1093 1093 } 1094 1094 else if (okToUse.value == 'ok-library') 1095 1095 { 1096 item = {'type': 'EXTRACT', 'id': aligned.lib.id, 'okToUse': true };1096 item = {'type': 'EXTRACT', 'id': aligned.lib.id, 'okToUse': true, 'sort': 6 }; 1097 1097 } 1098 1098 } 1099 1099 else if (doNotUse.value == 'specimen') 1100 1100 { 1101 item = {'type': 'SAMPLE', 'id': aligned.specimen.id, 'doNotUse': 'Specimen' };1101 item = {'type': 'SAMPLE', 'id': aligned.specimen.id, 'doNotUse': 'Specimen', 'sort': 1 }; 1102 1102 } 1103 1103 else if (doNotUse.value == 'lysate') 1104 1104 { 1105 item = {'type': 'EXTRACT', 'id': aligned.lysate.id, 'doNotUse': 'Lysate' };1105 item = {'type': 'EXTRACT', 'id': aligned.lysate.id, 'doNotUse': 'Lysate', 'sort': 2 }; 1106 1106 } 1107 1107 else if (doNotUse.value == 'rna') 1108 1108 { 1109 item = {'type': 'EXTRACT', 'id': aligned.rna.id, 'doNotUse': 'RNA' };1109 item = {'type': 'EXTRACT', 'id': aligned.rna.id, 'doNotUse': 'RNA', 'sort': 3 }; 1110 1110 } 1111 1111 else if (doNotUse.value == 'library') 1112 1112 { 1113 item = {'type': 'EXTRACT', 'id': aligned.lib.id, 'doNotUse': 'Library' };1113 item = {'type': 'EXTRACT', 'id': aligned.lib.id, 'doNotUse': 'Library', 'sort': 4 }; 1114 1114 } 1115 1115 else if (aligned.flagged && doNotUse.classList.contains('required')) … … 1179 1179 url += '&highHetFilter=1'; 1180 1180 } 1181 1182 // Sort items in the "correct" order. All DoNotUse items before OkToUse 1183 // and Specimen -> Lysate -> RNA -> Library 1184 // This will prevent prevent problems with non-deterministic result if 1185 // selecting, for example, "Specimen" and "RNA" from the same parent-child chain 1186 // With sorting the highest level (Specimen) wins 1187 items.sort(Sort.sortDoNotUseItems); 1181 1188 1182 1189 var submitInfo = {}; … … 1270 1277 } 1271 1278 1279 // Sort items that are sent for "DoNotUse" or "OkToUse" by the 'sort' propert. 1280 sort.sortDoNotUseItems = function(a, b) 1281 { 1282 return a.sort == b.sort ? a.id - b.id : a.sort - b.sort; 1283 } 1284 1272 1285 return sort; 1273 1286 }();
Note: See TracChangeset
for help on using the changeset viewer.