Skip to content

Commit f977d1d

Browse files
committed
fix missing gzOutput to logging in scale-matrix
1 parent f28f115 commit f977d1d

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

src/main/java/scriptmanager/cli/Read_Analysis/ScaleMatrixCLI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ private String validateInput() throws IOException {
105105
* @param scalingFactor the factor to scale the matrix by
106106
* @param rowStart the matrix row start
107107
* @param colStart the matrix col start
108+
* @param gzOutput gzip output
108109
* @return command line to execute with formatted inputs
109110
*/
110-
public static String getCLIcommand(File input, File output, double scalingFactor, int rowStart, int colStart) {
111+
public static String getCLIcommand(File input, File output, double scalingFactor, int rowStart, int colStart, boolean gzOutput) {
111112
String command = "java -jar $SCRIPTMANAGER read-analysis scale-matrix";
112113
command += " " + input.getAbsolutePath();
113114
command += " -o " + output.getAbsolutePath();
115+
command += gzOutput ? " --gzip" : "";
114116
command += " -s " + scalingFactor;
115117
command += " -r " + rowStart;
116118
command += " -l " + colStart;

src/main/java/scriptmanager/window_interface/Read_Analysis/ScaleMatrixWindow.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
import java.sql.Timestamp;
1717
import java.util.ArrayList;
1818
import java.util.Date;
19-
import java.util.StringTokenizer;
2019

2120
import javax.swing.ButtonGroup;
2221
import javax.swing.JButton;
2322
import javax.swing.JCheckBox;
24-
import javax.swing.JComponent;
2523
import javax.swing.JFileChooser;
2624
import javax.swing.JFrame;
2725
import javax.swing.JLabel;
@@ -95,7 +93,7 @@ public class ScaleMatrixWindow extends JFrame implements ActionListener, Propert
9593
*/
9694
class Task extends SwingWorker<Void, Void> {
9795
@Override
98-
public Void doInBackground() {
96+
public Void doInBackground() throws IOException {
9997
try {
10098
if (TABFiles.size() < 1) {
10199
JOptionPane.showMessageDialog(null, "No Files Loaded!!!");
@@ -106,13 +104,25 @@ public Void doInBackground() {
106104
} else {
107105
// Check that all scaling numbers are valid
108106
boolean ALLNUM = true;
109-
for (int x = 0; x < TABFiles.size(); x++) {
107+
if (rdbtnUniformScaling.isSelected()) {
108+
System.out.println("Uniform scaling factor check...");
110109
try {
111-
Double.parseDouble(expTable.getValueAt(x, 1).toString());
110+
Double.parseDouble(txtUniform.getText());
112111
} catch (NumberFormatException e) {
113-
JOptionPane.showMessageDialog(null, TABFiles.get(x).getName() + " possesses an invalid scaling factor!!!");
112+
JOptionPane.showMessageDialog(null, "Uniform scaling value an invalid scaling factor (" + txtUniform.getText() + ") !!!");
114113
ALLNUM = false;
115114
}
115+
} else {
116+
System.out.println("File-sspecific scaling factor check...");
117+
for (int x = 0; x < TABFiles.size(); x++) {
118+
System.out.println(x);
119+
try {
120+
Double.parseDouble(expTable.getValueAt(x, 1).toString());
121+
} catch (NumberFormatException e) {
122+
JOptionPane.showMessageDialog(null, TABFiles.get(x).getName() + " possesses an invalid scaling factor (" + expTable.getValueAt(x, 1) + ") !!!");
123+
ALLNUM = false;
124+
}
125+
}
116126
}
117127
// Loop through matrix files with valid scaling factors
118128
if (ALLNUM) {
@@ -138,7 +148,7 @@ public Void doInBackground() {
138148
SCALE = Double.parseDouble(expTable.getValueAt(x, 1).toString());
139149
}
140150
// Initialize LogItem
141-
String command = ScaleMatrixCLI.getCLIcommand(XTAB, OUT_FILEPATH, SCALE, Integer.parseInt(txtRow.getText()), Integer.parseInt(txtCol.getText()));
151+
String command = ScaleMatrixCLI.getCLIcommand(XTAB, OUT_FILEPATH, SCALE, Integer.parseInt(txtRow.getText()), Integer.parseInt(txtCol.getText()), chckbxGzipOutput.isSelected());
142152
LogItem new_li = new LogItem(command);
143153
firePropertyChange("log", old_li, new_li);
144154
// Execute script
@@ -209,8 +219,7 @@ public boolean isCellEditable(int row, int column) {
209219
}
210220
};
211221
JTable tableScale = new JTable(expTable);
212-
// Allow for the selection of multiple OR individual cells across either rows or
213-
// columns
222+
// Allow for the selection of multiple OR individual cells across either rows or columns
214223
tableScale.setCellSelectionEnabled(true);
215224
tableScale.setColumnSelectionAllowed(true);
216225
tableScale.setRowSelectionAllowed(true);

0 commit comments

Comments
 (0)