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-1364 use gapMap to map RNAalifold annotation onto correct columns
[jalview.git]
/
src
/
jalview
/
ws
/
jws2
/
RNAalifoldClient.java
diff --git
a/src/jalview/ws/jws2/RNAalifoldClient.java
b/src/jalview/ws/jws2/RNAalifoldClient.java
index
2779732
..
ec40552
100644
(file)
--- a/
src/jalview/ws/jws2/RNAalifoldClient.java
+++ b/
src/jalview/ws/jws2/RNAalifoldClient.java
@@
-216,9
+216,17
@@
public class RNAalifoldClient extends JabawsAlignCalcWorker implements
basePairs.put(score.getRanges().first(), new Float(score
.getScores().get(0)));
}
basePairs.put(score.getRanges().first(), new Float(score
.getScores().get(0)));
}
- for (int i = 0; i < struct.length(); i++)
+
+ for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
{
{
-
+ if (gapMap!=null)
+ {
+ // skip any gapped columns in the input data
+ while (!gapMap[ri])
+ {
+ ri++;
+ }
+ }
// Return all the contacts associated with position i
LinkedHashMap<Range, Float> contacts = isContact(basePairs, i + 1);
// Return all the contacts associated with position i
LinkedHashMap<Range, Float> contacts = isContact(basePairs, i + 1);
@@
-242,16
+250,23
@@
public class RNAalifoldClient extends JabawsAlignCalcWorker implements
}
}
}
}
- anns[i] = new Annotation(struct.substring(i, i + 1), description,
+ anns[ri] = new Annotation(struct.substring(i, i + 1), description,
isSS(struct.charAt(i)), prob);
}
}
else if (data == null || data.size() == 1)
{
isSS(struct.charAt(i)), prob);
}
}
else if (data == null || data.size() == 1)
{
- for (int i = 0; i < struct.length(); i++)
+ for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
{
{
-
- anns[i] = new Annotation(struct.substring(i, i + 1), "",
+ if (gapMap!=null)
+ {
+ // skip any gapped columns in the input data
+ while (!gapMap[ri])
+ {
+ ri++;
+ }
+ }
+ anns[ri] = new Annotation(struct.substring(i, i + 1), "",
isSS(struct.charAt(i)), Float.NaN);
}
isSS(struct.charAt(i)), Float.NaN);
}