Skip to content

Commit

Permalink
fix(calculateBpc): allows empty mass values
Browse files Browse the repository at this point in the history
  • Loading branch information
maasencioh authored Nov 27, 2017
1 parent 5fee6b1 commit 2abc033
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ms/calculateBpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export function calculateBpc(chrom) {
var massSpectra = ms.data;
var bpc = [];
for (var massSpectrum of massSpectra) {
bpc.push(max(massSpectrum[1]));
if (massSpectrum[1].length > 0) {
bpc.push(max(massSpectrum[1]));
} else {
bpc.push(0);
}
}

return bpc;
Expand Down

0 comments on commit 2abc033

Please sign in to comment.