From 14a3623b86376f7f896667d5268123b5feb45a3c Mon Sep 17 00:00:00 2001 From: TZVanaalten Date: Wed, 30 Aug 2017 17:43:38 +0100 Subject: [PATCH] JAL-2616 HMM-Family alignments can now be filtered by residue counts --- src/jalview/util/HMMProbabilityDistributionAnalyser.java | 8 ++++++-- src/jalview/util/ProbabilityAnalyserKickstarter.java | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) 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) { -- 1.7.10.2