From: tva Date: Wed, 10 Jul 2019 15:49:50 +0000 (+0100) Subject: JAL-2629 fix hmmsearch/jackhmmer assigning incorrect evalues and scores X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8d2c4f1719e83f64cabdc294b3e051b7417a77e1;p=jalview.git JAL-2629 fix hmmsearch/jackhmmer assigning incorrect evalues and scores --- diff --git a/src/jalview/hmmer/HMMSearch.java b/src/jalview/hmmer/HMMSearch.java index 248af16..a06f186 100644 --- a/src/jalview/hmmer/HMMSearch.java +++ b/src/jalview/hmmer/HMMSearch.java @@ -491,10 +491,11 @@ public class HMMSearch extends HmmerCommand while (!" ------ inclusion threshold ------".equals(line) && !"".equals(line)) { - SequenceI seq = seqs[index]; Scanner scanner = new Scanner(line); String evalue = scanner.next(); String score = scanner.next(); + checkSequenceOrder(index, scanner); + SequenceI seq = seqs[index]; addScoreAnnotations(evalue, score, seq); scanner.close(); line = br.readLine(); @@ -536,4 +537,29 @@ public class HMMSearch extends HmmerCommand } } + private void checkSequenceOrder(int index, Scanner scanner) + { + String seqName = null; + + for (int i = 0; i < 8; i++) + { + seqName = scanner.next(); + } + + if (!seqs[index].getName().equals(seqName)) + { + SequenceI temp = seqs[index]; + + for (int j = 0; j < seqs.length; j++) + { + if (seqs[j].getName().equals(seqName)) + { + seqs[index] = seqs[j]; + seqs[j] = temp; + break; + } + } + } + } + } diff --git a/src/jalview/hmmer/JackHMMER.java b/src/jalview/hmmer/JackHMMER.java index 7dbc08b..e6bb5f4 100644 --- a/src/jalview/hmmer/JackHMMER.java +++ b/src/jalview/hmmer/JackHMMER.java @@ -328,11 +328,12 @@ public class JackHMMER extends HmmerCommand while (!" ------ inclusion threshold ------".equals(line) && !"".equals(line)) { - SequenceI seq = seqs[index]; Scanner scanner = new Scanner(line); String evalue = scanner.next(); evalue = scanner.next(); + checkSequenceOrder(index, scanner); + SequenceI seq = seqs[index]; String score = scanner.next(); addScoreAnnotations(evalue, score, seq); scanner.close(); @@ -343,6 +344,31 @@ public class JackHMMER extends HmmerCommand br.close(); } + private void checkSequenceOrder(int index, Scanner scanner) + { + String seqName = null; + + for (int i = 0; i < 8; i++) + { + seqName = scanner.next(); + } + + if (!seqs[index + 1].getName().equals(seqName)) + { + SequenceI temp = seqs[index + 1]; + + for (int j = 0; j < seqs.length; j++) + { + if (seqs[j].getName().equals(seqName)) + { + seqs[index + 1] = seqs[j]; + seqs[j] = temp; + break; + } + } + } + } + protected void addScoreAnnotations(String eValue, String bitScore, SequenceI seq) {