From: TZVanaalten Date: Wed, 30 Aug 2017 16:43:38 +0000 (+0100) Subject: JAL-2616 HMM-Family alignments can now be filtered by residue counts X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=14a3623b86376f7f896667d5268123b5feb45a3c;p=jalview.git JAL-2616 HMM-Family alignments can now be filtered by residue counts --- diff --git a/src/jalview/util/HMMProbabilityDistributionAnalyser.java b/src/jalview/util/HMMProbabilityDistributionAnalyser.java index c84b177..567a109 100644 --- a/src/jalview/util/HMMProbabilityDistributionAnalyser.java +++ b/src/jalview/util/HMMProbabilityDistributionAnalyser.java @@ -185,7 +185,8 @@ public class HMMProbabilityDistributionAnalyser * The number of families to read before saving. * @throws IOException */ - public void runToEnd(boolean keepRawData, boolean forClans) + public void runToEnd(int minCount, int maxCount, boolean keepRawData, + boolean forClans) throws IOException { keepRaw = keepRawData; @@ -241,7 +242,10 @@ public class HMMProbabilityDistributionAnalyser readHMM(inputHMM); int count = countValidResidues(); - processData(count); + if (count >= minCount && count < maxCount) + { + processData(count); + } filesRead++; System.out.println(filesRead); endReached = atEnd(inputSTO); diff --git a/src/jalview/util/ProbabilityAnalyserKickstarter.java b/src/jalview/util/ProbabilityAnalyserKickstarter.java index ade09b1..59c0a9f 100644 --- a/src/jalview/util/ProbabilityAnalyserKickstarter.java +++ b/src/jalview/util/ProbabilityAnalyserKickstarter.java @@ -124,9 +124,11 @@ public class ProbabilityAnalyserKickstarter { inputScanner.next(); + int minCount = inputScanner.nextInt(); + int maxCount = inputScanner.nextInt(); boolean keepRaw = inputScanner.nextBoolean(); boolean forClans = inputScanner.nextBoolean(); - analyser.runToEnd(keepRaw, forClans); + analyser.runToEnd(minCount, maxCount, keepRaw, forClans); System.out.println("Task completed"); } catch (Exception e) {