From 4d2c8b4049276e1d14ec962d2408bbd50baa596e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 30 Mar 2018 15:45:00 +0100 Subject: [PATCH] JAL-2629 Javadoc updates --- src/jalview/hmmer/HmmerCommand.java | 43 ++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 16 deletions(-) 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); } } } -- 1.7.10.2