git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9c37999
)
JAL-674 propagate annotation onto mapped sequence and its dataset sequence
author
Jim Procter
<jprocter@dundee.ac.uk>
Thu, 30 Oct 2014 15:51:54 +0000
(15:51 +0000)
committer
Jim Procter
<jprocter@dundee.ac.uk>
Thu, 30 Oct 2014 15:51:54 +0000
(15:51 +0000)
src/jalview/structure/StructureMapping.java
patch
|
blob
|
history
diff --git
a/src/jalview/structure/StructureMapping.java
b/src/jalview/structure/StructureMapping.java
index
9236331
..
e4749c9
100644
(file)
--- a/
src/jalview/structure/StructureMapping.java
+++ b/
src/jalview/structure/StructureMapping.java
@@
-106,11
+106,27
@@
public class StructureMapping
*
* @param ana
* @return the copy that was remapped to the mapped sequence
*
* @param ana
* @return the copy that was remapped to the mapped sequence
+ * @note this method will create a copy and add it to the dataset sequence for
+ * the mapped sequence as well as the mapped sequence (if it is not a
+ * dataset sequence).
*/
public AlignmentAnnotation transfer(AlignmentAnnotation ana)
{
AlignmentAnnotation ala_copy = new AlignmentAnnotation(ana);
*/
public AlignmentAnnotation transfer(AlignmentAnnotation ana)
{
AlignmentAnnotation ala_copy = new AlignmentAnnotation(ana);
- ala_copy.remap(sequence, mapping, 0, -1, 1);
+ SequenceI ds = sequence;
+ while (ds.getDatasetSequence() != null)
+ {
+ ds = ds.getDatasetSequence();
+ }
+ ala_copy.remap(ds, mapping, 0, -1, 1);
+ ds.addAlignmentAnnotation(ala_copy);
+ if (ds != sequence)
+ {
+ // mapping wasn't to an original dataset sequence, so we make a copy on
+ // the mapped sequence too
+ ala_copy = new AlignmentAnnotation(ala_copy);
+ sequence.addAlignmentAnnotation(ala_copy);
+ }
return ala_copy;
}
}
return ala_copy;
}
}