git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2189 source formatting
[jalview.git]
/
src
/
jalview
/
analysis
/
StructureFrequency.java
diff --git
a/src/jalview/analysis/StructureFrequency.java
b/src/jalview/analysis/StructureFrequency.java
index
479c856
..
7b0858d
100644
(file)
--- a/
src/jalview/analysis/StructureFrequency.java
+++ b/
src/jalview/analysis/StructureFrequency.java
@@
-112,8
+112,9
@@
public class StructureFrequency
for (int i = start; i < end; i++) // foreach column
{
for (int i = start; i < end; i++) // foreach column
{
- int canonicalOrWobblePairCount = 0;
+ int canonicalOrWobblePairCount = 0, canonical = 0;
int otherPairCount = 0;
int otherPairCount = 0;
+ int nongap = 0;
maxResidue = "-";
values = new int[255];
pairs = new int[255][255];
maxResidue = "-";
values = new int[255];
pairs = new int[255][255];
@@
-161,7
+162,7
@@
public class StructureFrequency
values['-']++;
continue;
}
values['-']++;
continue;
}
-
+ nongap++;
/*
* ensure upper-case for counting purposes
*/
/*
* ensure upper-case for counting purposes
*/
@@
-175,20
+176,19
@@
public class StructureFrequency
}
if (Rna.isCanonicalOrWobblePair(c, cEnd))
{
}
if (Rna.isCanonicalOrWobblePair(c, cEnd))
{
- values['(']++;
- maxResidue = "(";
canonicalOrWobblePairCount++;
canonicalOrWobblePairCount++;
+ if (Rna.isCanonicalPair(c, cEnd))
+ {
+ canonical++;
+ }
}
else
{
}
else
{
- values['[']++;
- maxResidue = "[";
otherPairCount++;
}
pairs[c][cEnd]++;
}
}
otherPairCount++;
}
pairs[c][cEnd]++;
}
}
- // nonGap++;
}
residueHash = new Hashtable();
}
residueHash = new Hashtable();
@@
-200,7
+200,9
@@
public class StructureFrequency
residueHash.put(PAIRPROFILE, pairs);
}
residueHash.put(PAIRPROFILE, pairs);
}
-
+ values['('] = canonicalOrWobblePairCount;
+ values['['] = canonical;
+ values['{'] = otherPairCount;
/*
* the count is the number of valid pairs (as a percentage, determines
* the relative size of the profile logo)
/*
* the count is the number of valid pairs (as a percentage, determines
* the relative size of the profile logo)
@@
-208,13
+210,20
@@
public class StructureFrequency
int count = canonicalOrWobblePairCount;
/*
int count = canonicalOrWobblePairCount;
/*
- * currently displaying as '(' if most pairs are valid, or as
- * '[' if there are more invalid than valid pairs
+ * display '(' if most pairs are canonical, or as
+ * '[' if there are more wobble pairs.
*/
*/
- if (!maxResidue.equals("-"))
+ if (canonicalOrWobblePairCount > 0 || otherPairCount > 0)
{
{
- maxResidue = canonicalOrWobblePairCount >= otherPairCount ? "("
- : "[";
+ if (canonicalOrWobblePairCount >= otherPairCount)
+ {
+ maxResidue = (canonicalOrWobblePairCount - canonical) < canonical ? "("
+ : "[";
+ }
+ else
+ {
+ maxResidue = "{";
+ }
}
residueHash.put(MAXCOUNT, new Integer(count));
residueHash.put(MAXRESIDUE, maxResidue);
}
residueHash.put(MAXCOUNT, new Integer(count));
residueHash.put(MAXRESIDUE, maxResidue);
@@
-222,8
+231,9
@@
public class StructureFrequency
percentage = ((float) count * 100) / jSize;
residueHash.put(PID_GAPS, new Float(percentage));
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;
if (result[i] == null)
{
result[i] = residueHash;
@@
-232,9
+242,12
@@
public class StructureFrequency
{
values[')'] = values['('];
values[']'] = values['['];
{
values[')'] = values['('];
values[']'] = values['['];
+ values['}'] = values['{'];
values['('] = 0;
values['['] = 0;
values['('] = 0;
values['['] = 0;
- maxResidue = maxResidue.equals("(") ? ")" : "]";
+ values['{'] = 0;
+ maxResidue = maxResidue.equals("(") ? ")"
+ : maxResidue.equals("[") ? "]" : "}";
residueHash = new Hashtable();
if (profile)
residueHash = new Hashtable();
if (profile)
@@
-251,6
+264,9
@@
public class StructureFrequency
percentage = ((float) count * 100) / jSize;
residueHash.put(PID_GAPS, new Float(percentage));
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;
}
}
result[bpEnd] = residueHash;
}
}