JAL-2616 HMM-Family alignments can now be filtered by residue counts
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Wed, 30 Aug 2017 16:43:38 +0000 (17:43 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Wed, 30 Aug 2017 16:43:38 +0000 (17:43 +0100)
src/jalview/util/HMMProbabilityDistributionAnalyser.java
src/jalview/util/ProbabilityAnalyserKickstarter.java

index c84b177..567a109 100644 (file)
@@ -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);
index ade09b1..59c0a9f 100644 (file)
@@ -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)
         {