Skip to content

Commit

Permalink
handle null sequence peptides
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgowan committed Jul 14, 2020
1 parent 02af90b commit af23453
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/js/modules/AjaxDataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '<span class="aa_mod" data-toggle="tooltip" data-placement="top" title="$2">$1</span>');
s = s.replace(/\[(\S+?)\]/g, '<span class="aa_mod" data-toggle="tooltip" data-placement="top" title="Terminal Mod $1">&bull;</span>');

Expand All @@ -19,8 +24,6 @@ var PeptideModifications = (function(pm){
s = s.replace(/([A-Z]){(.+?)}/g, '<span class="aa_mod" data-toggle="tooltip" data-placement="top" title="$2">$1</span>');

//For the olders version


cv['"Sequence"'] = s;
});
return objs;
Expand Down

0 comments on commit af23453

Please sign in to comment.