Edit GNPSExportTask
Fix getFinishPercentage()
Updated indentation for the java file
@@ -37,6 +37,7 @@ public class GNPSExportTask extends AbstractTask {
private final PeakList[] peakLists;
private final File fileName;
private final String plNamePattern = "{}";
+ private int counter = 0;
private final String massListName;
@@ -53,7 +54,7 @@ public class GNPSExportTask extends AbstractTask {
@Override
public double getFinishedPercentage() {
- return 1;
+ return peakLists.length == 0 ? 0 : counter/peakLists.length;
}
@Override
@@ -65,6 +66,7 @@ public class GNPSExportTask extends AbstractTask {
// Process peak lists
for (PeakList peakList: peakLists) {
+ counter++;
// Filename
File curFile = fileName;
@@ -130,7 +132,7 @@ public class GNPSExportTask extends AbstractTask {
for (PeakListRow row : peakList.getRows()) {
String rowID = Integer.toString(row.getID());
- String retTimeInSeconds = Double.toString(row.getAverageRT() * 60);
+ String retTimeInSeconds = Double.toString(Math.round(row.getAverageRT() * 60 * 100)/100.);
// Get the MS/MS scan number
Feature bestPeak = row.getBestPeak();
if(bestPeak == null) continue;
@@ -170,7 +172,7 @@ public class GNPSExportTask extends AbstractTask {
if (rowID != null)
writer.write("FEATURE_ID=" + rowID + newLine);
- String mass = Double.toString(row.getAverageMZ());
+ String mass = Double.toString(Math.round(row.getAverageMZ()*10000)/10000.);
if (mass != null)
writer.write("PEPMASS=" + mass + newLine);
