From: TZVanaalten Date: Fri, 25 Aug 2017 16:12:53 +0000 (+0100) Subject: JAL-2629 hmmsearch now adds the E-value as an annotation X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a4aca9cd975791d85eb6123b31a4b812689520dc;p=jalview.git JAL-2629 hmmsearch now adds the E-value as an annotation --- diff --git a/src/jalview/hmmer/HMMSearchThread.java b/src/jalview/hmmer/HMMSearchThread.java index d6c0c29..4012cfe 100644 --- a/src/jalview/hmmer/HMMSearchThread.java +++ b/src/jalview/hmmer/HMMSearchThread.java @@ -2,7 +2,9 @@ package jalview.hmmer; import jalview.bin.Cache; import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.datamodel.Annotation; import jalview.datamodel.HiddenMarkovModel; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; @@ -23,6 +25,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; +import java.util.Scanner; import javax.swing.JOptionPane; @@ -341,36 +344,42 @@ public class HMMSearchThread implements Runnable public void readTable() throws IOException { - - /* BufferedReader br = new BufferedReader(new FileReader(inputTableTemp)); String line = ""; while (!line.startsWith("Query:")) { line = br.readLine(); } - for (int i = 0; i < 4; i++) + for (int i = 0; i < 5; i++) { - br.readLine(); + line = br.readLine(); } - - + int index = 0; - while (!" ------ inclusion threshold ------".equals(line)) + while (!" ------ inclusion threshold ------".equals(line) + && !"".equals(line)) { Scanner scanner = new Scanner(line); String str = scanner.next(); - AlignmentAnnotation annots = new AlignmentAnnotation("", "", null); - annots.setScore(Double.parseDouble(str)); - seqs[index].addAlignmentAnnotation(annots); + Annotation[] annots = new Annotation[seqs[index].getLength()]; + for (Annotation an : annots) + { + an = new Annotation(Float.parseFloat(str)); + } + AlignmentAnnotation annot = new AlignmentAnnotation("E-value", + "Score", annots); + annot.setScore(Double.parseDouble(str)); + annot.setSequenceRef(seqs[index]); + seqs[index].addAlignmentAnnotation(annot); scanner.close(); + line = br.readLine(); + index++; } br.close(); - */ - } + }