From: Jim Procter Date: Wed, 21 Sep 2016 15:42:10 +0000 (+0100) Subject: JAL-1841 JAL-2215 add the ‘ignore gaps’ structure consensus fraction X-Git-Tag: Release_2_10_0~39^2~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6b8834d5427d2a2998374b914eab842589c4a1d6;p=jalview.git JAL-1841 JAL-2215 add the ‘ignore gaps’ structure consensus fraction --- diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index 479c8562..29bdb7a 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -114,6 +114,7 @@ public class StructureFrequency { int canonicalOrWobblePairCount = 0; int otherPairCount = 0; + int nongap = 0; maxResidue = "-"; values = new int[255]; pairs = new int[255][255]; @@ -161,7 +162,7 @@ public class StructureFrequency values['-']++; continue; } - + nongap++; /* * ensure upper-case for counting purposes */ @@ -188,7 +189,6 @@ public class StructureFrequency pairs[c][cEnd]++; } } - // nonGap++; } residueHash = new Hashtable(); @@ -222,8 +222,9 @@ public class StructureFrequency percentage = ((float) count * 100) / jSize; residueHash.put(PID_GAPS, new Float(percentage)); - // percentage = ((float) count * 100) / (float) nongap; - // residueHash.put(PID_NOGAPS, new Float(percentage)); + percentage = ((float) count * 100) / nongap; + residueHash.put(PID_NOGAPS, new Float(percentage)); + if (result[i] == null) { result[i] = residueHash; @@ -251,6 +252,9 @@ public class StructureFrequency percentage = ((float) count * 100) / jSize; residueHash.put(PID_GAPS, new Float(percentage)); + percentage = ((float) count * 100) / nongap; + residueHash.put(PID_NOGAPS, new Float(percentage)); + result[bpEnd] = residueHash; } }