X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=76704523bdb63ab4eb50cb3e2bf8f9ac96a3ea9d;hb=1dabf099b7c77fb0a80039f72cef34669df9b2e1;hp=3240f843b243b378d17bfc056bee572d3cc8517d;hpb=e1c9c652059a67ee96f9fc5f6617fd5d604cbdbb;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 3240f84..7670452 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1,17 +1,17 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA @@ -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(); @@ -656,6 +657,7 @@ public class Sequence implements SequenceI return map; } + /* * (non-Javadoc) * @@ -679,6 +681,7 @@ public class Sequence implements SequenceI } return map; } + /* * (non-Javadoc) * @@ -737,7 +740,7 @@ public class Sequence implements SequenceI { createNewDs = true; newend--; // decrease end position by one for the deleted residue - // and search further + // and search further } } } @@ -819,6 +822,11 @@ public class Sequence implements SequenceI public DBRefEntry[] getDBRef() { + if (dbrefs == null && datasetSequence != null + && this != datasetSequence) + { + return datasetSequence.getDBRef(); + } return dbrefs; }