import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping;
import jalview.io.FastaFile;
import jalview.util.Comparison;
+import jalview.util.LinkedIdentityHashSet;
import jalview.util.MessageManager;
import java.util.ArrayList;
private void resolveAndAddDatasetSeq(SequenceI currentSeq,
Set<SequenceI> seqs, boolean createDatasetSequence)
{
+ SequenceI alignedSeq = currentSeq;
if (currentSeq.getDatasetSequence() != null)
{
currentSeq = currentSeq.getDatasetSequence();
{
if (dbr.getMap() != null && dbr.getMap().getTo() != null)
{
+ if (dbr.getMap().getTo() == alignedSeq)
+ {
+ /*
+ * update mapping to be to the newly created dataset sequence
+ */
+ dbr.getMap().setTo(currentSeq);
+ }
if (dbr.getMap().getTo().getDatasetSequence() != null)
{
- throw new Error("Implementation error: Map.getTo() for dbref"
- + dbr + " is not a dataset sequence.");
- // TODO: if this happens, could also rewrite the reference to
- // point to new dataset sequence
+ throw new Error(
+ "Implementation error: Map.getTo() for dbref " + dbr
+ + " from " + curDs.getName()
+ + " is not a dataset sequence.");
}
// we recurse to add all forward references to dataset sequences via
// DBRefs/etc
return;
}
// try to avoid using SequenceI.equals at this stage, it will be expensive
- Set<SequenceI> seqs = new jalview.util.LinkedIdentityHashSet<SequenceI>();
+ Set<SequenceI> seqs = new LinkedIdentityHashSet<SequenceI>();
for (int i = 0; i < getHeight(); i++)
{