From 6b8834d5427d2a2998374b914eab842589c4a1d6 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 21 Sep 2016 16:42:10 +0100 Subject: [PATCH] =?utf8?q?JAL-1841=20JAL-2215=20add=20the=20=E2=80=98ignore=20?= =?utf8?q?gaps=E2=80=99=20structure=20consensus=20fraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/analysis/StructureFrequency.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; } } -- 1.7.10.2