From 4b60f281b768044e3d66289c5ff6d941e6998f0b Mon Sep 17 00:00:00 2001 From: janengelhardt Date: Mon, 15 Aug 2011 11:15:30 +0200 Subject: [PATCH] JAL-891; Labeling of structure conservation is improved a bit. Brackets instead of 'H'. Change-Id: I220e86f21e2ff539ab5828bba4c0d07d76777422 --- src/jalview/analysis/StructureFrequency.java | 30 ++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index c253dce..7b97a8d 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -144,11 +144,11 @@ public class StructureFrequency cEnd = seq[bpEnd]; if (checkBpType(c, cEnd)) { - values['H']++; // H means it's a helix (structured) + values['(']++; // H means it's a helix (structured) } pairs[c][cEnd]++; - maxResidue = "H"; + maxResidue = "("; } } // nonGap++; @@ -163,7 +163,7 @@ public class StructureFrequency residueHash.put(PAIRPROFILE, pairs); } - count = values['H']; + count = values['(']; residueHash.put(MAXCOUNT, new Integer(count)); residueHash.put(MAXRESIDUE, maxResidue); @@ -178,7 +178,29 @@ public class StructureFrequency result[i] = residueHash; } if (bpEnd > 0) - { + { + values[')']=values['(']; + values['(']=0; + + residueHash = new Hashtable(); + maxResidue = ")"; + + if (profile) + { + residueHash.put(PROFILE, new int[][] + { values, new int[] + { jSize, (jSize - values['-']) } }); + + residueHash.put(PAIRPROFILE, pairs); + } + + residueHash.put(MAXCOUNT, new Integer(count)); + residueHash.put(MAXRESIDUE, maxResidue); + + percentage = ((float) count * 100) / (float) jSize; + residueHash.put(PID_GAPS, new Float(percentage)); + + result[bpEnd] = residueHash; } } -- 1.7.10.2