diff --git a/src/HMMR_ATAC/ArgParser.java b/src/HMMR_ATAC/ArgParser.java index 9bb4bad..4ebbd1b 100644 --- a/src/HMMR_ATAC/ArgParser.java +++ b/src/HMMR_ATAC/ArgParser.java @@ -58,6 +58,7 @@ public class ArgParser { private boolean printExclude=false; private boolean printTrain=true; private long randomTrainSeed = 10151; + private double threshold = 30; /** * Main constructor @@ -68,6 +69,11 @@ public ArgParser(String[] a,String ver){ version = ver; set(); } + /** + * Access the threshold for reporting peaks + * @return a double to represent the threshold + */ + public double getThreshold(){return threshold;} /** * Access the seed used for random sampling of training regions * @return a long to represent the seed for random sampling of training regions @@ -465,6 +471,10 @@ private void set(){ randomTrainSeed=Long.parseLong(args[i+1]); i++; break; + case"threshold": + threshold = Double.parseDouble(args[i+1]); + i++; + break; case"help": printUsage(); //System.exit(0); @@ -511,6 +521,7 @@ public void printUsage(){ System.out.println("\t--printExclude Whether to output excluded regions into Output_exclude.bed. Default = false"); System.out.println("\t--printTrain Whether to output training regions into Output_training.bed. Default = true"); System.out.println("\t--randomSeed Seed to set for random sampling of training regions. Default is 10151"); + System.out.println("\t--threshold threshold for reporting peaks. Only peaks who's score is >= this value will be reported."); System.out.println("\t-h , --help Print this help message and exit."); System.exit(0); } diff --git a/src/HMMR_ATAC/BaumWelch.java b/src/HMMR_ATAC/BaumWelch.java index d73a292..27b5f86 100644 --- a/src/HMMR_ATAC/BaumWelch.java +++ b/src/HMMR_ATAC/BaumWelch.java @@ -16,7 +16,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - import java.util.List; import JAHMMTest.BaumWelchScaledLearner; diff --git a/src/HMMR_ATAC/Main_HMMR_Driver.java b/src/HMMR_ATAC/Main_HMMR_Driver.java index 81cf68f..60d62a1 100644 --- a/src/HMMR_ATAC/Main_HMMR_Driver.java +++ b/src/HMMR_ATAC/Main_HMMR_Driver.java @@ -89,6 +89,7 @@ public class Main_HMMR_Driver { private static boolean printExclude = false; private static boolean printTrain = true; private static long randomTrainSeed=10151; + private static double threshold=0; private static String trainingRegions; @@ -129,6 +130,7 @@ public static void main(String[] args) throws IOException { printExclude = p.getPrintExclude(); printTrain = p.getPrintTrain(); randomTrainSeed = p.getRandomTrainSeed(); + threshold=p.getThreshold(); // printHMMRTracks = p.getPrintHMMRTracks(); //For run time calculation Long startTime = System.currentTimeMillis(); @@ -654,7 +656,8 @@ public static void main(String[] args) throws IOException { * report the peaks and summits, if desired */ if (peaks && (int) temp.getScore2() == peak - && temp.getLength() >= minLength) { + && temp.getLength() >= minLength && + Double.parseDouble(temp.getScore3()) >= threshold) { if (temp.getSummit() != null) { summits.println(temp.toString_ScoredSummit()); }