From af23453e8072fb053be64820567ffeb3393ecda8 Mon Sep 17 00:00:00 2001 From: tmcgowan Date: Tue, 14 Jul 2020 12:09:08 -0500 Subject: [PATCH] handle null sequence peptides --- src/js/modules/AjaxDataProvider.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/modules/AjaxDataProvider.js b/src/js/modules/AjaxDataProvider.js index 7fff7c4..f3f15a5 100644 --- a/src/js/modules/AjaxDataProvider.js +++ b/src/js/modules/AjaxDataProvider.js @@ -8,9 +8,14 @@ var PeptideModifications = (function(pm){ //[iTRAQ4plex]RTLNISHNLH{S:Phospho}LLPEVSPM{K:iTRAQ4plex}NR //Returns an html formatted sequence including modifications for a list of peptide ids found in pepIDs pm.htmlFormatSequences = function (objs) { //pepIDs - objs.data.forEach(function(cv){ - let s = cv['"Sequence"']; + let s = undefined; + if (cv['"Sequence"']) { + s = cv['"Sequence"']; + } else { + s = cv['"PEPTIDE_ID"']; + } + s = s.replace(/{([A-Z]):(.+?)}/g, '$1'); s = s.replace(/\[(\S+?)\]/g, ''); @@ -19,8 +24,6 @@ var PeptideModifications = (function(pm){ s = s.replace(/([A-Z]){(.+?)}/g, '$1'); //For the olders version - - cv['"Sequence"'] = s; }); return objs;