JAL-1641 refinement of the JSON data model and abstraction of several methods that...
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 526e8e9..649aad3 100755 (executable)
@@ -540,7 +540,22 @@ public class AppletFormatAdapter
       }
        else if (format.equalsIgnoreCase(JSONFile.FILE_DESC))
        {
-       afile = new JSONFile();
+        afile = new JSONFile();
+        // Add groups to AlignFile
+        afile.seqGroups = alignment.getGroups();
+
+        // Add non auto calculated annotation to AlignFile
+        for (AlignmentAnnotation annot : alignment.getAlignmentAnnotation())
+        {
+          if (annot != null && !annot.autoCalculated)
+          {
+            if (annot.label.equals("PDB.CATempFactor"))
+            {
+              continue;
+            }
+            afile.annotations.add(annot);
+          }
+        }
        }
       else if (format.equalsIgnoreCase("RNAML"))
       {
@@ -555,17 +570,7 @@ public class AppletFormatAdapter
       afile.addJVSuffix(jvsuffix);
 
       afile.setSeqs(alignment.getSequencesArray());
-      afile.addSeqGroups(alignment);
-
-      // Add non auto calculated annotation to AlignFile
-      for (AlignmentAnnotation annot : alignment.getAlignmentAnnotation())
-      {
-        if (!annot.autoCalculated)
-        {
-          afile.annotations.add(annot);
-        }
 
-      }
 
       String afileresp = afile.print();
       if (afile.hasWarningMessage())