Skip to content

Commit

Permalink
Don't count sequence gaps towards length
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 26, 2017
1 parent 6ec95f8 commit 531ce03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/Store/SeqFeature/GCContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ function (
var r = f ? residues[i] : residues.slice(i - hw, i + hw);
var nc = 0;
var ng = 0;
var len = 0;
for (var j = 0; j < r.length; j++) {
if (r[j] === 'c' || r[j] === 'C') {
nc++;
} else if (r[j] === 'g' || r[j] === 'G') {
ng++;
}
if (r[j] != 'N') {
len++;
}
}
var pos = query.start;
var score;
if (thisB.gcMode === 'content') {
score = (ng + nc) / r.length;
score = (ng + nc) / len;
} else if (thisB.gcMode === 'skew') {
score = (ng - nc) / (ng + nc);
}
Expand Down

0 comments on commit 531ce03

Please sign in to comment.