Skip to content
Permalink
Browse files

Merge pull request #723 from nextstrain/no_X_count_AA

Don't Count X for AA Diversity Chart
  • Loading branch information...
jameshadfield committed May 18, 2019
2 parents 2a042d9 + 4b03183 commit 73b69b47e3bb4401d2b1013ea245e3cb562f2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/util/entropy.js
@@ -21,7 +21,11 @@ const calcMutationCounts = (nodes, visibility, geneMap, isAA) => {
for (const prot in n.aa_muts) { // eslint-disable-line
n.aa_muts[prot].forEach((m) => {
const pos = parseInt(m.slice(1, m.length - 1), 10);
sparse[prot][pos] ? sparse[prot][pos]++ : sparse[prot][pos] = 1;
const A = m.slice(0, 1);
const B = m.slice(-1);
if (A !== 'X' && B !== 'X') {
sparse[prot][pos] ? sparse[prot][pos]++ : sparse[prot][pos] = 1;
}
});
}
}
@@ -92,9 +96,9 @@ const calcEntropy = (nodes, visibility, geneMap, isAA) => {
const A = m.slice(0, 1);
const B = m.slice(m.length - 1, m.length);
// console.log("mut @ ", pos, ":", A, " -> ", B)
if (isAA){
if (A === "X" || A === "-" || B === "X" || B === "-") return;
}else{
if (isAA) {
if (A === "X" || B === "X") return;
} else {
if (A === "N" || A === "-" || B === "N" || B === "-") return;
}
if (!anc_state[prot][pos]) {

0 comments on commit 73b69b4

Please sign in to comment.
You can’t perform that action at this time.