From 41b7d299a0bba7ed34fe40bd7fffa33e0bc2c4c1 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 28 Oct 2011 17:20:28 +0100 Subject: [PATCH] JAL-885 more efficient calculation and robust for mismatch between WUSS and alignment data --- src/jalview/analysis/StructureFrequency.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index aa1e277..0c9f830 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -122,6 +122,9 @@ public class StructureFrequency } else { + bpEnd = findPair(rna, i); + if (bpEnd>-1) + { for (j = 0; j < jSize; j++) // foreach row { if (sequences[j] == null) @@ -130,11 +133,8 @@ public class StructureFrequency .println("WARNING: Consensus skipping null sequence - possible race condition."); continue; } - seq = sequences[j].getSequence(); - - if (seq.length > i) + c = sequences[j].getCharAt(i); { - c = seq[i]; // standard representation for gaps in sequence and structure if (c == '.' || c == ' ') @@ -147,8 +147,7 @@ public class StructureFrequency values['-']++; continue; } - bpEnd = findPair(rna, i); - cEnd = seq[bpEnd]; + cEnd = sequences[j].getCharAt(bpEnd); if (checkBpType(c, cEnd)) { values['(']++; // H means it's a helix (structured) @@ -158,6 +157,7 @@ public class StructureFrequency maxResidue = "("; } } + } // nonGap++; } // UPDATE this for new values -- 1.7.10.2