From: gmungoc Date: Fri, 12 Aug 2016 13:49:08 +0000 (+0100) Subject: JAL-1841 count (logo height) is valid pairs only; detect base-gap pair X-Git-Tag: Release_2_10_0~70^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5c5161b61d3dc11a22c10fc176f0f967ed40bf52;p=jalview.git JAL-1841 count (logo height) is valid pairs only; detect base-gap pair --- diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index 29d02fe..479c8562 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.util.Comparison; import jalview.util.Format; import java.util.ArrayList; @@ -151,20 +152,15 @@ public class StructureFrequency .println("WARNING: Consensus skipping null sequence - possible race condition."); continue; } - c = sequences[j].getCharAt(i); - // standard representation for gaps in sequence and structure - if (c == '.' || c == ' ') - { - c = '-'; - } + c = sequences[j].getCharAt(i); + cEnd = sequences[j].getCharAt(bpEnd); - if (c == '-') + if (Comparison.isGap(c) || Comparison.isGap(cEnd)) { values['-']++; continue; } - cEnd = sequences[j].getCharAt(bpEnd); /* * ensure upper-case for counting purposes @@ -204,7 +200,17 @@ public class StructureFrequency residueHash.put(PAIRPROFILE, pairs); } - int count = Math.max(canonicalOrWobblePairCount, otherPairCount); + + /* + * the count is the number of valid pairs (as a percentage, determines + * the relative size of the profile logo) + */ + int count = canonicalOrWobblePairCount; + + /* + * currently displaying as '(' if most pairs are valid, or as + * '[' if there are more invalid than valid pairs + */ if (!maxResidue.equals("-")) { maxResidue = canonicalOrWobblePairCount >= otherPairCount ? "("