applied 2009 GPL license
[jalview.git] / src / jalview / io / VamsasAppDatastore.java
index dbd0a63..fe8b053 100644 (file)
@@ -1,22 +1,21 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.0.b2)
+ * 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
  */
-
 package jalview.io;
 
 import jalview.bin.Cache;
@@ -351,9 +350,9 @@ public class VamsasAppDatastore
             }
           }
         }
-
-        if (sq.getDBRef() != null)
+        if (sq.getDatasetSequence() == null && sq.getDBRef() != null)
         {
+          // only sync database references for dataset sequences
           DBRefEntry[] entries = sq.getDBRef();
           jalview.datamodel.DBRefEntry dbentry;
           for (int db = 0; db < entries.length; db++)
@@ -379,22 +378,22 @@ public class VamsasAppDatastore
       // ////////////////////////////////////////////
       if (!av.getAlignment().isAligned())
         return; // TODO: trees could be written - but for the moment we just
-                // skip
+      // skip
       // ////////////////////////////////////////////
       // Save the Alignments
 
       Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId()); // bind
-                                                                            // to
-                                                                            // the
-                                                                            // value
-                                                                            // used
-                                                                            // to
-                                                                            // associate
-                                                                            // different
-                                                                            // views
-                                                                            // to
-                                                                            // same
-                                                                            // alignment
+      // to
+      // the
+      // value
+      // used
+      // to
+      // associate
+      // different
+      // views
+      // to
+      // same
+      // alignment
 
       if (alignment == null)
       {
@@ -456,20 +455,20 @@ public class VamsasAppDatastore
             {
               // info in the undo
               addProvenance(alignment.getProvenance(), "Edited"); // TODO:
-                                                                  // insert
-                                                                  // something
-                                                                  // sensible
-                                                                  // here again
+              // insert
+              // something
+              // sensible
+              // here again
             }
             else
             {
               // info in the undo
               addProvenance(alignment.getProvenance(), "Attributes Edited"); // TODO:
-                                                                              // insert
-                                                                              // something
-                                                                              // sensible
-                                                                              // here
-                                                                              // again
+              // insert
+              // something
+              // sensible
+              // here
+              // again
             }
           }
           if (alismod)
@@ -2047,9 +2046,9 @@ public class VamsasAppDatastore
         if (type == 0)
         {
           type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default
-                                                                  // type of
-                                                                  // value
-                                                                  // annotation
+          // type of
+          // value
+          // annotation
           if (has[HASHPHOB])
           {
             // no hints - so we ensure HPHOB display is like this.
@@ -2148,7 +2147,7 @@ public class VamsasAppDatastore
       }
       if (annotation.getModifiable() == null
               || annotation.getModifiable().length() == 0) // TODO: USE VAMSAS
-                                                            // LIBRARY OBJECT
+      // LIBRARY OBJECT
       // LOCK METHODS)
       {
         jan.editable = true;
@@ -2159,12 +2158,12 @@ public class VamsasAppDatastore
                 && annotation.getGroup().length() > 0)
         {
           jan.graphGroup = Integer.parseInt(annotation.getGroup()); // TODO:
-                                                                    // group
-                                                                    // similarly
-                                                                    // named
-                                                                    // annotation
-                                                                    // together
-                                                                    // ?
+          // group
+          // similarly
+          // named
+          // annotation
+          // together
+          // ?
         }
       } catch (Exception e)
       {