{
Hashtable sqinfo = new Hashtable();
sqinfo.put("Name", seq.getName());
- sqinfo.put("Start", new Integer(seq.getStart()));
- sqinfo.put("End", new Integer(seq.getEnd()));
+ sqinfo.put("Start", Integer.valueOf(seq.getStart()));
+ sqinfo.put("End", Integer.valueOf(seq.getEnd()));
if (seq.getDescription() != null)
{
sqinfo.put("Description", seq.getDescription());
*/
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)
{
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);
}
{
sq.setDescription(description);
}
- if ((seqds != null)
- && !(seqds.getName().equals("THISISAPLACEHOLDER") && seqds
- .getLength() == 0))
+ if ((seqds != null) && !(seqds.getName().equals("THISISAPLACEHOLDER")
+ && seqds.getLength() == 0))
{
if (sfeatures != null)
{
- System.err
- .println("Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible.");
+ System.err.println(
+ "Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible.");
}
sq.setDatasetSequence(seqds);
}
if (unmatched.size() > 0 && !quiet)
{
System.err.println("Did not find matches for :");
- for (Enumeration i = unmatched.elements(); i.hasMoreElements(); System.out
- .println(((SequenceI) i.nextElement()).getName()))
+ for (Enumeration i = unmatched.elements(); i
+ .hasMoreElements(); System.out
+ .println(((SequenceI) i.nextElement()).getName()))
{
;
}