@@ -103,16 +103,38 @@ public Void doInBackground() throws IOException {
103103 if (XBED .getName ().endsWith (".bed.gz" )) {
104104 OUTPUT = ExtensionFileFilter .stripExtensionPath (new File (OUTPUT )) ;
105105 }
106- System .out .println (XBED .getName ());
107- System .out .println (OUTPUT );
108- System .out .println (SUFFIX );
106+ System .out .println ("Input: " + XBED .getName ());
109107 // Execute expansion and update progress
110108 ShiftCoord .shiftBEDInterval (new File (OUTPUT + SUFFIX ), XBED , SHIFT , chckbxStranded .isSelected (), chckbxGzipOutput .isSelected ());
111109
112110 // Update progress bar
113111 int percentComplete = (int ) (((double ) (x + 1 ) / BEDFiles .size ()) * 100 );
114112 setProgress (percentComplete );
115113 }
114+ } else {
115+ for (int x = 0 ; x < GFFFiles .size (); x ++) {
116+ // Save current BED to temp variable
117+ File XGFF = GFFFiles .get (x );
118+ // Set suffix format
119+ String SUFFIX = SHIFT < 0 ? "_shift" + txtShift .getText () + "bp.gff" : "_shift+" + txtShift .getText () + "bp.gff" ;
120+ SUFFIX += chckbxGzipOutput .isSelected () ? ".gz" : "" ;
121+ // Set output filepath with name and output directory
122+ String OUTPUT = ExtensionFileFilter .stripExtension (XGFF );
123+ if (OUT_DIR != null ) {
124+ OUTPUT = OUT_DIR + File .separator + OUTPUT ;
125+ }
126+ // Strip second extension if input has ".gz" first extension
127+ if (XGFF .getName ().endsWith (".gff.gz" )) {
128+ OUTPUT = ExtensionFileFilter .stripExtensionPath (new File (OUTPUT )) ;
129+ }
130+ System .out .println ("Input: " + XGFF .getName ());
131+ // Execute expansion and update progress
132+ ShiftCoord .shiftGFFInterval (new File (OUTPUT + SUFFIX ), XGFF , SHIFT , chckbxStranded .isSelected (), chckbxGzipOutput .isSelected ());
133+
134+ // Update progress bar
135+ int percentComplete = (int ) (((double ) (x + 1 ) / GFFFiles .size ()) * 100 );
136+ setProgress (percentComplete );
137+ }
116138 }
117139 setProgress (100 );
118140 JOptionPane .showMessageDialog (null , "Shift Complete" );
@@ -247,7 +269,7 @@ public void actionPerformed(ActionEvent e) {
247269 btnRemoveGFF = new JButton ("Remove GFF" );
248270 sl_gffInputPane .putConstraint (SpringLayout .SOUTH , btnRemoveGFF , -6 , SpringLayout .NORTH , scrollPaneGFF );
249271 sl_gffInputPane .putConstraint (SpringLayout .EAST , btnRemoveGFF , 0 , SpringLayout .EAST , scrollPaneGFF );
250- btnRemoveBED .addActionListener (new ActionListener () {
272+ btnRemoveGFF .addActionListener (new ActionListener () {
251273 public void actionPerformed (ActionEvent arg0 ) {
252274 while (listGFFExp .getSelectedIndex () > -1 ) {
253275 GFFFiles .remove (listGFFExp .getSelectedIndex ());
@@ -297,7 +319,7 @@ public void actionPerformed(ActionEvent arg0) {
297319 chckbxStranded .setSelected (true );
298320 contentPane .add (chckbxStranded );
299321
300- chckbxGzipOutput = new JCheckBox ("Gzip output " );
322+ chckbxGzipOutput = new JCheckBox ("Output GZIP " );
301323 sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxGzipOutput , 0 , SpringLayout .SOUTH , chckbxStranded );
302324 sl_contentPane .putConstraint (SpringLayout .WEST , chckbxGzipOutput , 0 , SpringLayout .WEST , chckbxStranded );
303325 contentPane .add (chckbxGzipOutput );
0 commit comments