Skip to content

Commit

Permalink
bug fix for --score all option
Browse files Browse the repository at this point in the history
  • Loading branch information
evantarbell committed Feb 18, 2019
1 parent bac13ed commit 7c5a9c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
23 changes: 16 additions & 7 deletions src/HMMR_ATAC/Main_HMMR_Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class Main_HMMR_Driver {
/*
* Version number. Change as needed
*/
private static String versionNum = "1.2.3";
private static String versionNum = "1.2.4";

@SuppressWarnings("unchecked")
public static void main(String[] args) throws IOException {
Expand Down Expand Up @@ -559,17 +559,26 @@ public static void main(String[] args) throws IOException {

}
ScoreNode scores = bedGraphMath.set(temp, overlaps);
double MAX = scores.getMax();
double MEAN = scores.getMean();
double MEDIAN = scores.getMedian();
double ZSCORE = (scores.getMean() - genomeMean)
/ genomeStd;
double FOLDCHANGE = scores.getMean() / genomeMean;

if (scoreSys.equals("ave")) {
temp.setScore3(scores.getMean());
temp.setScore3(Double.toString(MEAN));
} else if (scoreSys.equals("fc")) {
temp.setScore3(scores.getMean() / genomeMean);
temp.setScore3(Double.toString(FOLDCHANGE));
} else if (scoreSys.equals("zscore")) {
temp.setScore3((scores.getMean() - genomeMean)
/ genomeStd);
temp.setScore3(Double.toString(ZSCORE));
} else if (scoreSys.equals("med")) {
temp.setScore3(scores.getMedian());
temp.setScore3(Double.toString(MEDIAN));
} else if (scoreSys.equals("all")){
String ANSWER = MAX+"_"+MEAN+"_"+MEDIAN+"_"+ZSCORE+"_"+FOLDCHANGE;
temp.setScore3(ANSWER);
} else {
temp.setScore3(scores.getMax());
temp.setScore3(Double.toString(MAX));
}
if ((int) temp.getScore2() == peak) {
temp = bedGraphMath.setSmooth(20, temp, overlaps);
Expand Down
6 changes: 3 additions & 3 deletions src/Node/TagNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TagNode {
private char strand = '\0';
private int Score = 0;
private double score2 = 0.0;
private double score3 = 0.0;
private String score3 = "";
private TagNode summit=null;
private TagNode upstream=null;
private TagNode downstream=null;
Expand Down Expand Up @@ -102,12 +102,12 @@ public void setSummit(TagNode t){
* Set the third score variable
* @param s a double representing a score
*/
public void setScore3(double s){score3 = s;}
public void setScore3(String s){score3 = s;}
/**
* Access third score variable
* @return a double representing a score
*/
public double getScore3(){return score3;}
public String getScore3(){return score3;}
/**
* Set Score
* @param score a double representing the entry's score
Expand Down

0 comments on commit 7c5a9c4

Please sign in to comment.