JAL-2629 Javadoc updates
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Mar 2018 14:45:00 +0000 (15:45 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Mar 2018 14:45:00 +0000 (15:45 +0100)
src/jalview/hmmer/HmmerCommand.java

index e680cf2..fe6c0f9 100644 (file)
@@ -54,6 +54,13 @@ public abstract class HmmerCommand implements Runnable
     params = args;
   }
 
+  /**
+   * Answers true if preference HMMER_PATH is set, and its value is the path to
+   * a directory that contains an executable <code>hmmbuild</code> or
+   * <code>hmmbuild.exe</code>, else false
+   * 
+   * @return
+   */
   public static boolean isHmmerAvailable()
   {
     File exec = getExecutable(HMMBUILD, Cache.getProperty(Preferences.HMMER_PATH));
@@ -130,8 +137,8 @@ public abstract class HmmerCommand implements Runnable
   }
 
   /**
-   * Exports an alignment (and possibly annotation) to the specified file, in
-   * Stockholm format
+   * Exports an alignment, and reference (RF) annotation if present, to the
+   * specified file, in Stockholm format
    * 
    * @param seqs
    * @param toFile
@@ -153,24 +160,28 @@ public abstract class HmmerCommand implements Runnable
 
     if (toFile != null && annotated != null)
     {
-      for (AlignmentAnnotation annot : annotated.getAlignmentAnnotation())
+      AlignmentAnnotation[] annots = annotated.getAlignmentAnnotation();
+      if (annots != null)
       {
-        if (annot.label.contains("Reference") || "RF".equals(annot.label))
+        for (AlignmentAnnotation annot : annots)
         {
-          AlignmentAnnotation newRF;
-          if (annot.annotations.length > newAl.getWidth())
-          {
-            Annotation[] rfAnnots = new Annotation[newAl.getWidth()];
-            System.arraycopy(annot.annotations, 0, rfAnnots, 0,
-                    rfAnnots.length);
-            newRF = new AlignmentAnnotation("RF", "Reference Positions",
-                    rfAnnots);
-          }
-          else
+          if (annot.label.contains("Reference") || "RF".equals(annot.label))
           {
-            newRF = new AlignmentAnnotation(annot);
+            AlignmentAnnotation newRF;
+            if (annot.annotations.length > newAl.getWidth())
+            {
+              Annotation[] rfAnnots = new Annotation[newAl.getWidth()];
+              System.arraycopy(annot.annotations, 0, rfAnnots, 0,
+                      rfAnnots.length);
+              newRF = new AlignmentAnnotation("RF", "Reference Positions",
+                      rfAnnots);
+            }
+            else
+            {
+              newRF = new AlignmentAnnotation(annot);
+            }
+            newAl.addAnnotation(newRF);
           }
-          newAl.addAnnotation(newRF);
         }
       }
     }