From ed9c5fe20f052a1003d27a2c114b9bbcaca80190 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 6 Aug 2008 12:14:06 +0000 Subject: [PATCH] getDBRefs now always returns DBRefArray if it exists on this sequence or dataset sequence --- src/jalview/datamodel/Sequence.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 3240f84..56a829c 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -185,15 +185,16 @@ public class Sequence implements SequenceI addSequenceFeature(new SequenceFeature(sf[i])); } } - if (seq.getDBRef() != null) + setDatasetSequence(seq.getDatasetSequence()); + if (datasetSequence==null && seq.getDBRef() != null) { + // only copy DBRefs if we really are a dataset sequence DBRefEntry[] dbr = seq.getDBRef(); for (int i = 0; i < dbr.length; i++) { addDBRef(new DBRefEntry(dbr[i])); } } - setDatasetSequence(seq.getDatasetSequence()); if (seq.getAnnotation() != null) { AlignmentAnnotation[] sqann = seq.getAnnotation(); @@ -819,6 +820,10 @@ public class Sequence implements SequenceI public DBRefEntry[] getDBRef() { + if (dbrefs==null && datasetSequence!=null && this!=datasetSequence) + { + return datasetSequence.getDBRef(); + } return dbrefs; } -- 1.7.10.2