Skip to content

Commit

Permalink
Better number parsing, handles scientific notation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmgreen committed Oct 28, 2024
1 parent a2b6201 commit 5114be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/broadinstitute/gpp/rigerj/RigerJMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ private static List<HairpinData> createHairpinDatas() throws IOException {
break;
}
String[] cells = line.split("\t", 0);
hairpinDatas.add(new HairpinData(new Integer(cells[3]),
int rank = Double.valueOf(cells[3]).intValue();
hairpinDatas.add(new HairpinData(rank,
cells[0],
new Double(cells[2]),
Double.parseDouble(cells[2]),
cells[1],
cells.length == 5 ? new Double(cells[4]) : 1));
cells.length == 5 ? Double.parseDouble(cells[4]) : 1));

}
return hairpinDatas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ private static void initializeHairpinInputs() throws IOException {
break;
}
String[] cells = line.split("\t", 0);
hairpinInputs.add(new HairpinData(new Integer(cells[3]),
int rank = Double.valueOf(cells[3]).intValue();
hairpinInputs.add(new HairpinData(rank,
cells[0],
new Double(cells[2]),
Double.parseDouble(cells[2]),
cells[1],
1));
}
Expand Down

0 comments on commit 5114be0

Please sign in to comment.