From: Jim Procter Date: Mon, 30 Nov 2015 17:32:53 +0000 (+0000) Subject: JAL-1950 optionally just delete any redundant sequences in the alignment to simply... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=237d623c567d7f02a2db69b9de00237495087a16;p=jalview.git JAL-1950 optionally just delete any redundant sequences in the alignment to simply overview --- diff --git a/src/jalview/ws/ebi/HmmerJSONProcessor.java b/src/jalview/ws/ebi/HmmerJSONProcessor.java index a6b15cf..a3eecd3 100644 --- a/src/jalview/ws/ebi/HmmerJSONProcessor.java +++ b/src/jalview/ws/ebi/HmmerJSONProcessor.java @@ -195,7 +195,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 +215,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 +230,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); + } } } }