X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FSeqsetUtils.java;fp=src%2Fjalview%2Fanalysis%2FSeqsetUtils.java;h=891e29523260abfa21b0091368fd532b61f658ce;hb=26816cdcb7617e74fad006d2c675efb298e0d9b1;hp=fdca89dd5cc5acf2fd08a7a075fafa0244058045;hpb=73d0b3417c14be3e826826cd7848fc2923332e0e;p=jalview.git diff --git a/src/jalview/analysis/SeqsetUtils.java b/src/jalview/analysis/SeqsetUtils.java index fdca89d..891e295 100755 --- a/src/jalview/analysis/SeqsetUtils.java +++ b/src/jalview/analysis/SeqsetUtils.java @@ -84,6 +84,20 @@ public class SeqsetUtils */ public static boolean SeqCharacterUnhash(SequenceI sq, Hashtable sqinfo) { + return SeqCharacterUnhash(sq, sqinfo, false, false); + } + + /** + * restore some characteristics for a sequence from its hash + * @param sq + * @param sqinfo + * @param excludeLimits - when true, start/end is left unmodified + * @param excludeFeatures - when true, features are not restored from stashed vector + * @return true if sequence's name was modified + */ + + public static boolean SeqCharacterUnhash(SequenceI sq, Hashtable sqinfo, boolean excludeLimits,boolean excludeFeatures) + { boolean namePresent = true; if (sqinfo == null) { @@ -110,13 +124,13 @@ public class SeqsetUtils sq.setPDBId(pdbid); } - if ((start != null) && (end != null)) + if (!excludeLimits && (start != null) && (end != null)) { sq.setStart(start.intValue()); sq.setEnd(end.intValue()); } - - if (sfeatures != null && !sfeatures.isEmpty()) + // TODO: drop this completely since we should not manipulate sequenceFeatures as a vector any more + if (!excludeFeatures && sfeatures != null && !sfeatures.isEmpty()) { sq.setSequenceFeatures(sfeatures); }