X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Febi%2FHmmerJSONProcessor.java;h=428c4983406df1ed0bd12b129b6bf161413c1d98;hb=f3133c4f086cbdf59a7ce7fe465d2a5fa4a0fd60;hp=a6b15cf5ef6aa987ec404fcd12376757a4e26a11;hpb=ed12e78e1d0a027dba0cebdc422c39a753e93805;p=jalview.git diff --git a/src/jalview/ws/ebi/HmmerJSONProcessor.java b/src/jalview/ws/ebi/HmmerJSONProcessor.java index a6b15cf..428c498 100644 --- a/src/jalview/ws/ebi/HmmerJSONProcessor.java +++ b/src/jalview/ws/ebi/HmmerJSONProcessor.java @@ -181,7 +181,9 @@ public class HmmerJSONProcessor hitseq.addSequenceFeature(new SequenceFeature( "Pfam Domain Architecture", (hmmrhit.get("archindex")) + " " + (arch = (String) hmmrhit.get("arch")), 0, - 0, Integer.valueOf((String) hmmrhit.get("archScore")), + 0, + (hmmrhit.get("archScore") != null ? Integer + .valueOf((String) hmmrhit.get("archScore")) : 0f), "HMMER3")); addArchGroup(hitseq, arch); alipp.setScore(Double.valueOf("" + dhit.get("bitscore"))); @@ -195,7 +197,7 @@ public class HmmerJSONProcessor // look for other sequences represented by this hit and create rep groups // could be in "pdbs", or .. addRedundantSeqGroup(firsthit, alisqfrom, alisqto, - (JSONArray) hmmrhit.get("seqs")); + (JSONArray) hmmrhit.get("seqs"), true); } } @@ -215,8 +217,7 @@ public class HmmerJSONProcessor } private void addRedundantSeqGroup(final SequenceI firsthit, - long alisqfrom, - long alisqto, JSONArray others) + long alisqfrom, long alisqto, JSONArray others, boolean justDelete) { if (others != null) { @@ -231,24 +232,36 @@ public class HmmerJSONProcessor SequenceI[] other = resultAl.findSequenceMatch(repseq); if (other != null && other.length > 0) { - int ofound = 0; - for (SequenceI oth : other) + if (justDelete) { - if (oth.getStart() == alisqfrom && oth.getEnd() == alisqto) + for (SequenceI oth : other) { - ofound++; - repgroup.addSequence(oth, false); + resultAl.deleteSequence(oth); } + ; } - if (ofound == 0) + else { - System.err.println("Warn - no match for redundant hit " - + repseq + "/" + alisqfrom + "-" + alisqto); - } - if (ofound > 1) - { - System.err.println("Warn - multiple matches for redundant hit " - + repseq + "/" + alisqfrom + "-" + alisqto); + int ofound = 0; + for (SequenceI oth : other) + { + if (oth.getStart() == alisqfrom && oth.getEnd() == alisqto) + { + ofound++; + repgroup.addSequence(oth, false); + } + } + if (ofound == 0) + { + System.err.println("Warn - no match for redundant hit " + + repseq + "/" + alisqfrom + "-" + alisqto); + } + if (ofound > 1) + { + System.err + .println("Warn - multiple matches for redundant hit " + + repseq + "/" + alisqfrom + "-" + alisqto); + } } } }