JAL-2277 Refactored out duplicated method - printUnwrapped() in HtmlSvgOutput, extern...
[jalview.git] / src / jalview / bin / Jalview.java
index 76ae3ff..d0cabb2 100755 (executable)
@@ -23,6 +23,7 @@ package jalview.bin;
 import groovy.lang.Binding;
 import groovy.util.GroovyScriptEngine;
 
+import jalview.ext.so.SequenceOntology;
 import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
 import jalview.gui.PromptUserConfig;
@@ -33,6 +34,7 @@ import jalview.io.FormatAdapter;
 import jalview.io.HtmlSvgOutput;
 import jalview.io.IdentifyFile;
 import jalview.io.NewickFile;
+import jalview.io.gff.SequenceOntologyFactory;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.schemes.UserColourScheme;
@@ -288,6 +290,15 @@ public class Jalview
       }
     }
 
+    /*
+     * configure 'full' SO model if preferences say to, 
+     * else use the default (SO Lite)
+     */
+    if (Cache.getDefault("USE_FULL_SO", false))
+    {
+      SequenceOntologyFactory.setInstance(new SequenceOntology());
+    }
+
     if (!headless)
     {
       desktop = new Desktop();
@@ -328,7 +339,6 @@ public class Jalview
             Cache.log.debug("Starting questionnaire with default url: "
                     + defurl);
             desktop.checkForQuestionnaire(defurl);
-
           }
         }
       }
@@ -336,11 +346,12 @@ public class Jalview
       {
         System.err.println("CMD [-noquestionnaire] executed successfully!");
       }
-      desktop.checkForNews();
-    }
 
-    if (!isHeadlessMode())
-    {
+      if (!aparser.contains("nonews"))
+      {
+        desktop.checkForNews();
+      }
+
       BioJsHTMLOutput.updateBioJS();
     }
 
@@ -639,10 +650,28 @@ public class Jalview
           {
             File imageFile = new File(file);
             imageName = imageFile.getName();
-            new HtmlSvgOutput(new File(file), af.alignPanel);
+            HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
+            htmlSVG.generateHtmlSvgOutput(new File(file));
+
             System.out.println("Creating HTML image: " + file);
             continue;
           }
+          else if (format.equalsIgnoreCase("biojsmsa"))
+          {
+            BioJsHTMLOutput.updateBioJS();
+            try
+            {
+              Thread.sleep(1500);
+            } catch (InterruptedException e)
+            {
+              e.printStackTrace();
+            }
+            BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel, af);
+            bjs.exportJalviewAlignmentAsBioJsHtmlFile(file);
+            System.out.println("Creating BioJS MSA Viwer HTML file: "
+                    + file);
+            continue;
+          }
           else if (format.equalsIgnoreCase("imgMap"))
           {
             af.createImageMap(new File(file), imageName);
@@ -778,10 +807,12 @@ public class Jalview
                     + "-png FILE\tCreate PNG image FILE from alignment.\n"
                     + "-svg FILE\tCreate SVG image FILE from alignment.\n"
                     + "-html FILE\tCreate HTML file from alignment.\n"
+                    + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n"
                     + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
                     + "-eps FILE\tCreate EPS file FILE from alignment.\n"
                     + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
                     + "-noquestionnaire\tTurn off questionnaire check.\n"
+                    + "-nonews\tTurn off check for Jalview news.\n"
                     + "-nousagestats\tTurn off google analytics tracking for this session.\n"
                     + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
                     // +