@@ -75,6 +75,7 @@ public class BAMtoscIDXWindow extends JFrame implements ActionListener, Property
7575 private JCheckBox chckbxFilterByMinimum ;
7676 private JTextField txtMin ;
7777 private JTextField txtMax ;
78+ private JTextField txtShift ;
7879
7980 JProgressBar progressBar ;
8081 /**
@@ -123,9 +124,10 @@ public Void doInBackground() {
123124 if (chckbxFilterByMaximum .isSelected ()) {
124125 MAX = Integer .parseInt (txtMax .getText ());
125126 }
127+ int SHIFT = Integer .parseInt (txtShift .getText ());
126128 // process each bam
127129 for (int x = 0 ; x < BAMFiles .size (); x ++) {
128- BAMtoscIDXOutput output_obj = new BAMtoscIDXOutput (BAMFiles .get (x ), OUT_DIR , STRAND , PAIR , MIN , MAX , chckbxGzipOutput .isSelected ());
130+ BAMtoscIDXOutput output_obj = new BAMtoscIDXOutput (BAMFiles .get (x ), OUT_DIR , STRAND , PAIR , MIN , MAX , SHIFT , chckbxGzipOutput .isSelected ());
129131 output_obj .addPropertyChangeListener ("log" , new PropertyChangeListener () {
130132 public void propertyChange (PropertyChangeEvent evt ) {
131133 firePropertyChange ("log" , evt .getOldValue (), evt .getNewValue ());
@@ -287,8 +289,8 @@ public void itemStateChanged(ItemEvent e) {
287289 contentPane .add (btnOutputDirectory );
288290
289291 chckbxGzipOutput = new JCheckBox ("Output GZip" );
290- sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxGzipOutput , 0 , SpringLayout .NORTH , btnIndex );
291- sl_contentPane .putConstraint (SpringLayout .EAST , chckbxGzipOutput , - 83 , SpringLayout .WEST , btnOutputDirectory );
292+ sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxGzipOutput , 2 , SpringLayout .NORTH , btnOutputDirectory );
293+ sl_contentPane .putConstraint (SpringLayout .WEST , chckbxGzipOutput , 20 , SpringLayout .EAST , btnOutputDirectory );
292294 contentPane .add (chckbxGzipOutput );
293295
294296 progressBar = new JProgressBar ();
@@ -301,13 +303,13 @@ public void itemStateChanged(ItemEvent e) {
301303 btnIndex .setActionCommand ("start" );
302304
303305 chckbxRequireProperMatepair = new JCheckBox ("Require Proper Mate-Pair" );
304- sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxRequireProperMatepair , 6 , SpringLayout .SOUTH ,
305- rdbtnRead2 );
306+ sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxRequireProperMatepair , 6 , SpringLayout .SOUTH , rdbtnRead2 );
307+ sl_contentPane . putConstraint ( SpringLayout . WEST , chckbxRequireProperMatepair , 10 , SpringLayout . WEST , contentPane );
306308 contentPane .add (chckbxRequireProperMatepair );
307309
308- chckbxFilterByMinimum = new JCheckBox ("Filter by Min Insert Size (bp)" );
309- sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxFilterByMinimum , 35 , SpringLayout .SOUTH , rdbtnRead1 );
310- sl_contentPane .putConstraint (SpringLayout .WEST , chckbxFilterByMinimum , 10 , SpringLayout .WEST , contentPane );
310+ chckbxFilterByMinimum = new JCheckBox ("Filter Min Insert Size (bp)" );
311+ sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxFilterByMinimum , 0 , SpringLayout .NORTH , chckbxRequireProperMatepair );
312+ sl_contentPane .putConstraint (SpringLayout .EAST , chckbxFilterByMinimum , - 150 , SpringLayout .EAST , contentPane );
311313 chckbxFilterByMinimum .addItemListener (new ItemListener () {
312314 public void itemStateChanged (ItemEvent e ) {
313315 if (chckbxFilterByMinimum .isSelected ()) {
@@ -325,19 +327,18 @@ public void itemStateChanged(ItemEvent e) {
325327 contentPane .add (chckbxFilterByMinimum );
326328
327329 txtMin = new JTextField ();
328- sl_contentPane .putConstraint (SpringLayout .WEST , chckbxRequireProperMatepair , 0 , SpringLayout .WEST , txtMin );
329- txtMin .setEnabled (false );
330330 sl_contentPane .putConstraint (SpringLayout .NORTH , txtMin , 2 , SpringLayout .NORTH , chckbxFilterByMinimum );
331331 sl_contentPane .putConstraint (SpringLayout .WEST , txtMin , 6 , SpringLayout .EAST , chckbxFilterByMinimum );
332332 sl_contentPane .putConstraint (SpringLayout .EAST , txtMin , 75 , SpringLayout .EAST , chckbxFilterByMinimum );
333333 txtMin .setHorizontalAlignment (SwingConstants .CENTER );
334334 txtMin .setText ("0" );
335335 contentPane .add (txtMin );
336+ txtMin .setEnabled (false );
336337 txtMin .setColumns (10 );
337338
338- chckbxFilterByMaximum = new JCheckBox ("Filter by Max Insert Size (bp)" );
339- sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxFilterByMaximum , 35 , SpringLayout .SOUTH , rdbtnCombined );
340- sl_contentPane .putConstraint (SpringLayout .WEST , chckbxFilterByMaximum , 25 , SpringLayout .EAST , txtMin );
339+ chckbxFilterByMaximum = new JCheckBox ("Filter Max Insert Size (bp)" );
340+ sl_contentPane .putConstraint (SpringLayout .NORTH , chckbxFilterByMaximum , 3 , SpringLayout .SOUTH , chckbxFilterByMinimum );
341+ sl_contentPane .putConstraint (SpringLayout .WEST , chckbxFilterByMaximum , 0 , SpringLayout .WEST , chckbxFilterByMinimum );
341342 chckbxFilterByMaximum .addItemListener (new ItemListener () {
342343 public void itemStateChanged (ItemEvent e ) {
343344 if (chckbxFilterByMaximum .isSelected ()) {
@@ -355,14 +356,28 @@ public void itemStateChanged(ItemEvent e) {
355356 contentPane .add (chckbxFilterByMaximum );
356357
357358 txtMax = new JTextField ();
358- txtMax . setEnabled ( false );
359+ sl_contentPane . putConstraint ( SpringLayout . NORTH , txtMax , 2 , SpringLayout . NORTH , chckbxFilterByMaximum );
359360 sl_contentPane .putConstraint (SpringLayout .WEST , txtMax , 6 , SpringLayout .EAST , chckbxFilterByMaximum );
360- sl_contentPane .putConstraint (SpringLayout .NORTH , txtMax , 2 , SpringLayout .NORTH , chckbxFilterByMinimum );
361361 sl_contentPane .putConstraint (SpringLayout .EAST , txtMax , 75 , SpringLayout .EAST , chckbxFilterByMaximum );
362362 txtMax .setHorizontalAlignment (SwingConstants .CENTER );
363363 txtMax .setText ("1000" );
364- contentPane .add (txtMax );
365364 txtMax .setColumns (10 );
365+ txtMax .setEnabled (false );
366+ contentPane .add (txtMax );
367+
368+ JLabel lblTagShift = new JLabel ("Tag Shift (bp):" );
369+ sl_contentPane .putConstraint (SpringLayout .NORTH , lblTagShift , 6 , SpringLayout .SOUTH , chckbxRequireProperMatepair );
370+ sl_contentPane .putConstraint (SpringLayout .WEST , lblTagShift , 10 , SpringLayout .WEST , contentPane );
371+ contentPane .add (lblTagShift );
372+
373+ txtShift = new JTextField ();
374+ sl_contentPane .putConstraint (SpringLayout .NORTH , txtShift , -1 , SpringLayout .NORTH , lblTagShift );
375+ sl_contentPane .putConstraint (SpringLayout .WEST , txtShift , 100 , SpringLayout .WEST , lblTagShift );
376+ sl_contentPane .putConstraint (SpringLayout .WEST , txtShift , 120 , SpringLayout .WEST , contentPane );
377+ txtShift .setText ("0" );
378+ txtShift .setHorizontalAlignment (SwingConstants .CENTER );
379+ txtShift .setColumns (10 );
380+ contentPane .add (txtShift );
366381
367382 btnOutputDirectory .addActionListener (new ActionListener () {
368383 public void actionPerformed (ActionEvent e ) {
@@ -372,6 +387,7 @@ public void actionPerformed(ActionEvent e) {
372387 }
373388 }
374389 });
390+
375391 }
376392
377393 /**
0 commit comments