From: gmungoc Date: Fri, 30 Mar 2018 14:45:00 +0000 (+0100) Subject: JAL-2629 Javadoc updates X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4d2c8b4049276e1d14ec962d2408bbd50baa596e;p=jalview.git JAL-2629 Javadoc updates --- diff --git a/src/jalview/hmmer/HmmerCommand.java b/src/jalview/hmmer/HmmerCommand.java index e680cf2..fe6c0f9 100644 --- a/src/jalview/hmmer/HmmerCommand.java +++ b/src/jalview/hmmer/HmmerCommand.java @@ -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 hmmbuild or + * hmmbuild.exe, 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); } } }