in progress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / tools / PhyloInferenceDialog.java
1 // $Id:
2 // forester -- software libraries and applications
3 // for genomics and evolutionary biology research.
4 //
5 // Copyright (C) 2010 Christian M Zmasek
6 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
7 // All rights reserved
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23 // Contact: phylosoft @ gmail . com
24 // WWW: www.phylosoft.org/forester
25
26 package org.forester.archaeopteryx.tools;
27
28 import java.awt.Color;
29 import java.awt.FlowLayout;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
32 import java.util.List;
33
34 import javax.swing.BoxLayout;
35 import javax.swing.ButtonGroup;
36 import javax.swing.JButton;
37 import javax.swing.JCheckBox;
38 import javax.swing.JDialog;
39 import javax.swing.JFormattedTextField;
40 import javax.swing.JLabel;
41 import javax.swing.JOptionPane;
42 import javax.swing.JPanel;
43 import javax.swing.JRadioButton;
44 import javax.swing.JTextField;
45 import javax.swing.border.Border;
46 import javax.swing.border.LineBorder;
47
48 import org.forester.archaeopteryx.AptxUtil;
49 import org.forester.archaeopteryx.MainFrameApplication;
50 import org.forester.evoinference.distance.PairwiseDistanceCalculator.PWD_DISTANCE_METHOD;
51 import org.forester.sequence.Sequence;
52 import org.forester.util.BasicDescriptiveStatistics;
53 import org.forester.util.DescriptiveStatistics;
54
55 public class PhyloInferenceDialog extends JDialog implements ActionListener {
56
57     private static final long                  serialVersionUID = 8337543508238133614L;
58     private final JPanel                       _pnl;
59     private final JButton                      _launch_btn;
60     private final JButton                      _cancel_btn;
61     private final JFormattedTextField          _bootstrap_tf;
62     private final JCheckBox                    _bootstrap_cb;
63     private final PhylogeneticInferenceOptions _opts;
64     private JTextField                         _input_msa_file_tf;
65     private JButton                            _select_input_msa_btn;
66     private final MainFrameApplication         _parent_frame;
67     private JTextField                         _msa_length_tf;
68     private JTextField                         _msa_size_tf;
69     private JTextField                         _msa_type_tf;
70     private final JRadioButton                 _distance_calc_kimura_rb;
71     private final JRadioButton                 _distance_calc_poisson_rb;
72     private final JRadioButton                 _distance_calc_fract_dissimilarity_rb;
73     private int                                _value           = JOptionPane.CANCEL_OPTION;
74     private JTextField                         _input_seqs_tf;
75     private JButton                            _select_input_seqs_btn;
76     private JTextField                         _input_seqs_number_tf;
77     private JTextField                         _input_seqs_median_length_tf;
78     private JTextField                         _input_seqs_min_length_tf;
79     private JTextField                         _input_seqs_max_length_tf;
80     private JTextField                         _input_seqs_type_tf;
81     private JTextField                         _input_seqs_msa_program_name_tf;
82     private JTextField                         _input_seqs_msa_paramenters_tf;
83     private JTextField                         _msa_processing_max_allowed_gap_ratio_tf;
84     private JTextField                         _msa_processing_min_allowed_length_tf;
85     private JTextField                         _random_seed_tf;
86     private JCheckBox                          _execute_msa_processing_cb;
87     private JCheckBox                          _msa_processing_remove_all_gap_columns_cb;
88     private JCheckBox                          _save_pwd_file_cb;
89     private JCheckBox                          _save_processed_msa_cb;
90     private JCheckBox                          _save_original_msa_cb;
91     private JTextField                         _pwd_outfile_tf;
92     private JTextField                         _processed_msa_outfile_tf;
93     private JTextField                         _original_msa_outfile_tf;
94
95     public PhyloInferenceDialog( final MainFrameApplication frame,
96                                  final PhylogeneticInferenceOptions options,
97                                  final boolean from_unaligned_seqs ) {
98         super( frame, true );
99         setVisible( false );
100         _parent_frame = frame;
101         _opts = options;
102         _pnl = new JPanel();
103         getContentPane().add( _pnl );
104         final BoxLayout box_layout = new BoxLayout( _pnl, BoxLayout.PAGE_AXIS );
105         _pnl.setLayout( box_layout );
106         if ( from_unaligned_seqs ) {
107             setTitle( "Phylogenetic Inference (including multiple sequence alignment)" );
108             final JPanel inputfile_pnl_1 = new JPanel();
109             final JPanel inputfile_pnl_2 = new JPanel();
110             final JPanel inputfile_pnl_3 = new JPanel();
111             inputfile_pnl_1.setLayout( new FlowLayout() );
112             inputfile_pnl_2.setLayout( new FlowLayout() );
113             inputfile_pnl_3.setLayout( new FlowLayout() );
114             inputfile_pnl_1.add( new JLabel( "Input Sequence File:" ) );
115             inputfile_pnl_1.add( _input_seqs_tf = new JTextField() );
116             inputfile_pnl_1.add( _select_input_seqs_btn = new JButton( "Select Input File" ) );
117             inputfile_pnl_2.add( new JLabel( "Sequences: " ) );
118             inputfile_pnl_2.add( new JLabel( "Number of Sequences:" ) );
119             inputfile_pnl_2.add( _input_seqs_number_tf = new JTextField() );
120             inputfile_pnl_2.add( new JLabel( "Length: median:" ) );
121             inputfile_pnl_2.add( _input_seqs_median_length_tf = new JTextField() );
122             inputfile_pnl_2.add( new JLabel( "min:" ) );
123             inputfile_pnl_2.add( _input_seqs_min_length_tf = new JTextField() );
124             inputfile_pnl_2.add( new JLabel( "max:" ) );
125             inputfile_pnl_2.add( _input_seqs_max_length_tf = new JTextField() );
126             inputfile_pnl_2.add( new JLabel( "Type:" ) );
127             inputfile_pnl_2.add( _input_seqs_type_tf = new JTextField() );
128             inputfile_pnl_3.add( new JLabel( "Mutiple Sequence Alignment: " ) );
129             inputfile_pnl_3.add( new JLabel( "Program: " ) );
130             inputfile_pnl_3.add( _input_seqs_msa_program_name_tf = new JTextField() );
131             inputfile_pnl_3.add( new JLabel( "Parameters: " ) );
132             inputfile_pnl_3.add( _input_seqs_msa_paramenters_tf = new JTextField() );
133             _input_seqs_median_length_tf.setColumns( 4 );
134             _input_seqs_min_length_tf.setColumns( 4 );
135             _input_seqs_max_length_tf.setColumns( 4 );
136             _input_seqs_number_tf.setColumns( 4 );
137             _input_seqs_type_tf.setColumns( 2 );
138             _input_seqs_tf.setColumns( 20 );
139             _input_seqs_tf.setEditable( false );
140             _input_seqs_median_length_tf.setEditable( false );
141             _input_seqs_min_length_tf.setEditable( false );
142             _input_seqs_max_length_tf.setEditable( false );
143             _input_seqs_number_tf.setEditable( false );
144             _input_seqs_type_tf.setEditable( false );
145             _input_seqs_msa_program_name_tf.setEditable( false );
146             _input_seqs_msa_paramenters_tf.setColumns( 26 );
147             _select_input_seqs_btn.addActionListener( this );
148             _pnl.add( inputfile_pnl_1 );
149             _pnl.add( inputfile_pnl_2 );
150             _pnl.add( inputfile_pnl_3 );
151         }
152         else {
153             setTitle( "Phylogenetic Inference (from already aligned sequences) " );
154             // Inputfile (MSA):
155             final JPanel inputfile_pnl_1 = new JPanel();
156             final JPanel inputfile_pnl_2 = new JPanel();
157             inputfile_pnl_1.setLayout( new FlowLayout() );
158             inputfile_pnl_2.setLayout( new FlowLayout() );
159             inputfile_pnl_1.add( new JLabel( "Input MSA File:" ) );
160             inputfile_pnl_1.add( _input_msa_file_tf = new JTextField() );
161             inputfile_pnl_1.add( _select_input_msa_btn = new JButton( "Select Input File" ) );
162             inputfile_pnl_2.add( new JLabel( "MSA: " ) );
163             inputfile_pnl_2.add( new JLabel( "Number of Sequences:" ) );
164             inputfile_pnl_2.add( _msa_size_tf = new JTextField() );
165             inputfile_pnl_2.add( new JLabel( "Length:" ) );
166             inputfile_pnl_2.add( _msa_length_tf = new JTextField() );
167             inputfile_pnl_2.add( new JLabel( "Type:" ) );
168             inputfile_pnl_2.add( _msa_type_tf = new JTextField() );
169             _msa_length_tf.setColumns( 4 );
170             _msa_size_tf.setColumns( 4 );
171             _msa_type_tf.setColumns( 2 );
172             _input_msa_file_tf.setColumns( 20 );
173             _input_msa_file_tf.setEditable( false );
174             _msa_length_tf.setEditable( false );
175             _msa_size_tf.setEditable( false );
176             _msa_type_tf.setEditable( false );
177             _select_input_msa_btn.addActionListener( this );
178             _pnl.add( inputfile_pnl_1 );
179             _pnl.add( inputfile_pnl_2 );
180         }
181         //
182         final JPanel inputfile_pnl_4 = new JPanel();
183         inputfile_pnl_4.setLayout( new FlowLayout() );
184         inputfile_pnl_4.add( new JLabel( "MSA Processing: " ) );
185         inputfile_pnl_4.add( _execute_msa_processing_cb = new JCheckBox( "Process MSA" ) );
186         inputfile_pnl_4.add( _msa_processing_remove_all_gap_columns_cb = new JCheckBox( "Remove all gap columns" ) );
187         inputfile_pnl_4.add( new JLabel( "Max allowed gap ratio: " ) );
188         inputfile_pnl_4.add( _msa_processing_max_allowed_gap_ratio_tf = new JTextField() );
189         inputfile_pnl_4.add( new JLabel( "Min allowed non-gap sequence length: " ) );
190         inputfile_pnl_4.add( _msa_processing_min_allowed_length_tf = new JTextField() );
191         _msa_processing_max_allowed_gap_ratio_tf.setColumns( 4 );
192         _msa_processing_min_allowed_length_tf.setColumns( 4 );
193         final Border b = new LineBorder( Color.DARK_GRAY );
194         inputfile_pnl_4.setBorder( b );
195         _pnl.add( inputfile_pnl_4 );
196         //
197         // Distance calculation:
198         // TODO if type==AA...
199         final JPanel distance_calc_pnl_1 = new JPanel();
200         distance_calc_pnl_1.setLayout( new FlowLayout() );
201         distance_calc_pnl_1.add( new JLabel( "Distance calculation:" ) );
202         distance_calc_pnl_1.add( _distance_calc_kimura_rb = new JRadioButton( "Kimura correction" ) );
203         distance_calc_pnl_1.add( _distance_calc_poisson_rb = new JRadioButton( "Poisson" ) );
204         distance_calc_pnl_1
205                 .add( _distance_calc_fract_dissimilarity_rb = new JRadioButton( "Fractional dissimilarity" ) );
206         final ButtonGroup distance_calc_group_1 = new ButtonGroup();
207         distance_calc_group_1.add( _distance_calc_kimura_rb );
208         distance_calc_group_1.add( _distance_calc_poisson_rb );
209         distance_calc_group_1.add( _distance_calc_fract_dissimilarity_rb );
210         _pnl.add( distance_calc_pnl_1 );
211         // Bootstrap resampling:
212         final JPanel bootstrap_pnl = new JPanel();
213         bootstrap_pnl.setLayout( new FlowLayout() );
214         bootstrap_pnl.add( _bootstrap_cb = new JCheckBox( "Perform Bootstrap Resampling" ) );
215         bootstrap_pnl.add( new JLabel( "Number of Bootstrap Samples:" ) );
216         bootstrap_pnl.add( _bootstrap_tf = new JFormattedTextField( AptxUtil.createMaskFormatter( "###" ) ) );
217         _bootstrap_tf.setColumns( 4 );
218         // TODO see
219         // http://download.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html
220         // _bootstrap_tf.setColumns( 4 );
221         bootstrap_pnl.add( new JLabel( "Random Seed:" ) );
222         bootstrap_pnl.add( _random_seed_tf = new JTextField() );
223         _random_seed_tf.setColumns( 4 );
224         _pnl.add( bootstrap_pnl );
225         final JPanel launch_pnl = new JPanel();
226         launch_pnl.setLayout( new FlowLayout() );
227         _launch_btn = new JButton( "Go!" );
228         _launch_btn.addActionListener( this );
229         launch_pnl.add( _launch_btn );
230         _cancel_btn = new JButton( "Cancel" );
231         _cancel_btn.addActionListener( this );
232         launch_pnl.add( _cancel_btn );
233         _pnl.add( launch_pnl );
234         initializeValues( from_unaligned_seqs );
235         pack();
236         setLocationRelativeTo( getParentFrame() );
237         setResizable( false );
238     }
239
240     @Override
241     public void actionPerformed( final ActionEvent e ) {
242         if ( e.getSource() == _select_input_msa_btn ) {
243             readInputFile();
244         }
245         else if ( e.getSource() == _select_input_seqs_btn ) {
246             readInputSeqsFile();
247         }
248         else if ( e.getSource() == _launch_btn ) {
249             launch();
250         }
251         else if ( e.getSource() == _cancel_btn ) {
252             cancel();
253         }
254     }
255
256     public void activate() {
257         setVisible( true );
258     }
259
260     private MainFrameApplication getParentFrame() {
261         return _parent_frame;
262     }
263
264     public PhylogeneticInferenceOptions getPhylogeneticInferenceOptions() {
265         return _opts;
266     }
267
268     public int getValue() {
269         return _value;
270     }
271
272     private void initializeValues( final boolean from_unaligned_seqs ) {
273         _value = JOptionPane.CANCEL_OPTION;
274         if ( from_unaligned_seqs ) {
275             updateSeqsItems();
276             _input_seqs_msa_program_name_tf.setText( getPhylogeneticInferenceOptions().getMsaPrg() );
277             _input_seqs_msa_paramenters_tf.setText( getPhylogeneticInferenceOptions().getMsaPrgParameters() );
278         }
279         else {
280             updateMsaItems();
281         }
282         updateMsaProcessingItem();
283         updateDistanceCalcMethod();
284         _bootstrap_tf.setText( getPhylogeneticInferenceOptions().getBootstrapSamples() + "" );
285         _random_seed_tf.setText( getPhylogeneticInferenceOptions().getRandomNumberGeneratorSeed() + "" );
286     }
287
288     private void launch() {
289         processPerformBootstrapResampling();
290         if ( _bootstrap_cb.isSelected() ) {
291             processBootstrapSamplesNumber();
292             processRandomNumberGeneratorSeed();
293         }
294         if ( true ) {
295             //TODO
296             processMsaProcessing();
297         }
298         processDistanceCalcMethod();
299         processMsaPrgParameters();
300         setVisible( false );
301         _value = JOptionPane.OK_OPTION;
302     }
303
304     private void cancel() {
305         setVisible( false );
306         _value = JOptionPane.CANCEL_OPTION;
307     }
308
309     private void processBootstrapSamplesNumber() {
310         int bootstrap_samples = 0;
311         try {
312             bootstrap_samples = Integer.parseInt( _bootstrap_tf.getText().trim() );
313         }
314         catch ( final NumberFormatException e ) {
315             // JOptionPane.showMessageDialog( this, "Could not parse number of bootstrap resamplings from: " +  _bootstrap_tf.getText().trim(), "User Error", JOptionPane.ERROR_MESSAGE );
316             return;
317         }
318         if ( bootstrap_samples >= 0 ) {
319             getPhylogeneticInferenceOptions().setBootstrapSamples( bootstrap_samples );
320         }
321     }
322
323     private void processRandomNumberGeneratorSeed() {
324         long seed = PhylogeneticInferenceOptions.RANDOM_NUMBER_SEED_DEFAULT;
325         try {
326             seed = Long.parseLong( _random_seed_tf.getText().trim() );
327         }
328         catch ( final NumberFormatException e ) {
329             return;
330         }
331         getPhylogeneticInferenceOptions().setRandomNumberGeneratorSeed( seed );
332     }
333
334     private void processMsaProcessing() {
335         getPhylogeneticInferenceOptions().setExecuteMsaProcessing( _execute_msa_processing_cb.isSelected() );
336         getPhylogeneticInferenceOptions()
337                 .setMsaProcessingRemoveAllGapColumns( _msa_processing_remove_all_gap_columns_cb.isSelected() );
338         int min_length = -1;
339         try {
340             min_length = Integer.parseInt( _msa_processing_min_allowed_length_tf.getText().trim() );
341         }
342         catch ( final NumberFormatException e ) {
343             min_length = -1;
344         }
345         if ( min_length > 0 ) {
346             getPhylogeneticInferenceOptions().setMsaProcessingMinAllowedLength( min_length );
347         }
348         double msa_processing_max_allowed_gap_ratio = -1.0;
349         try {
350             msa_processing_max_allowed_gap_ratio = Double.parseDouble( _msa_processing_max_allowed_gap_ratio_tf
351                     .getText().trim() );
352         }
353         catch ( final NumberFormatException e ) {
354             msa_processing_max_allowed_gap_ratio = -1.0;
355         }
356         if ( ( msa_processing_max_allowed_gap_ratio >= 0.0 ) && ( msa_processing_max_allowed_gap_ratio <= 1.0 ) ) {
357             getPhylogeneticInferenceOptions().setMsaProcessingMaxAllowedGapRatio( msa_processing_max_allowed_gap_ratio );
358         }
359     }
360
361     private void processDistanceCalcMethod() {
362         if ( ( _distance_calc_kimura_rb != null ) && _distance_calc_kimura_rb.isSelected() ) {
363             getPhylogeneticInferenceOptions().setPwdDistanceMethod( PWD_DISTANCE_METHOD.KIMURA_DISTANCE );
364         }
365         else if ( ( _distance_calc_poisson_rb != null ) && _distance_calc_poisson_rb.isSelected() ) {
366             getPhylogeneticInferenceOptions().setPwdDistanceMethod( PWD_DISTANCE_METHOD.POISSON_DISTANCE );
367         }
368         else if ( ( _distance_calc_fract_dissimilarity_rb != null )
369                 && _distance_calc_fract_dissimilarity_rb.isSelected() ) {
370             getPhylogeneticInferenceOptions().setPwdDistanceMethod( PWD_DISTANCE_METHOD.FRACTIONAL_DISSIMILARITY );
371         }
372     }
373
374     private void processPerformBootstrapResampling() {
375         getPhylogeneticInferenceOptions().setPerformBootstrapResampling( _bootstrap_cb.isSelected() );
376     }
377
378     private void processMsaPrgParameters() {
379         if ( _input_seqs_msa_paramenters_tf != null ) {
380             getPhylogeneticInferenceOptions().setMsaPrgParameters( _input_seqs_msa_paramenters_tf.getText() );
381         }
382     }
383
384     private void readInputFile() {
385         getParentFrame().readMsaFromFile();
386         updateMsaItems();
387     }
388
389     private void readInputSeqsFile() {
390         getParentFrame().readSeqsFromFile();
391         updateSeqsItems();
392     }
393
394     private void updateDistanceCalcMethod() {
395         switch ( getPhylogeneticInferenceOptions().getPwdDistanceMethod() ) {
396             case KIMURA_DISTANCE:
397                 _distance_calc_kimura_rb.setSelected( true );
398                 break;
399             case POISSON_DISTANCE:
400                 _distance_calc_poisson_rb.setSelected( true );
401                 break;
402             case FRACTIONAL_DISSIMILARITY:
403                 _distance_calc_fract_dissimilarity_rb.setSelected( true );
404                 break;
405             default:
406                 throw new RuntimeException( "invalid distance calc method" );
407         }
408     }
409
410     private void updateMsaProcessingItem() {
411         _execute_msa_processing_cb.setSelected( getPhylogeneticInferenceOptions().isExecuteMsaProcessing() );
412         _msa_processing_remove_all_gap_columns_cb.setSelected( getPhylogeneticInferenceOptions()
413                 .isMsaProcessingRemoveAllGapColumns() );
414         if ( _opts.getMsaProcessingMaxAllowedGapRatio() > 0 ) {
415             _msa_processing_max_allowed_gap_ratio_tf.setText( _opts.getMsaProcessingMaxAllowedGapRatio() + "" );
416         }
417         if ( _opts.getMsaProcessingMinAllowedLength() > 0 ) {
418             _msa_processing_min_allowed_length_tf.setText( _opts.getMsaProcessingMinAllowedLength() + "" );
419         }
420     }
421
422     private void updateMsaItems() {
423         if ( getParentFrame().getMsa() != null ) {
424             _input_msa_file_tf.setText( getParentFrame().getMsaFile().toString() );
425             _msa_length_tf.setText( getParentFrame().getMsa().getLength() + "" );
426             _msa_size_tf.setText( getParentFrame().getMsa().getNumberOfSequences() + "" );
427             _msa_type_tf.setText( getParentFrame().getMsa().getType() + "" );
428             _input_msa_file_tf.setEnabled( true );
429             _msa_length_tf.setEnabled( true );
430             _msa_size_tf.setEnabled( true );
431             _msa_type_tf.setEnabled( true );
432             _launch_btn.setEnabled( true );
433         }
434         else {
435             _input_msa_file_tf.setText( "" );
436             _msa_length_tf.setText( "" );
437             _msa_size_tf.setText( "" );
438             _msa_type_tf.setText( "" );
439             _input_msa_file_tf.setEnabled( false );
440             _msa_length_tf.setEnabled( false );
441             _msa_size_tf.setEnabled( false );
442             _msa_type_tf.setEnabled( false );
443             _launch_btn.setEnabled( false );
444         }
445     }
446
447     private void updateSeqsItems() {
448         if ( getParentFrame().getSeqs() != null ) {
449             final DescriptiveStatistics stats = calcSequenceStats( getParentFrame().getSeqs() );
450             _input_seqs_tf.setText( getParentFrame().getSeqsFile().toString() );
451             _input_seqs_median_length_tf.setText( ( int ) stats.median() + "" );
452             _input_seqs_min_length_tf.setText( ( int ) stats.getMin() + "" );
453             _input_seqs_max_length_tf.setText( ( int ) stats.getMax() + "" );
454             _input_seqs_number_tf.setText( getParentFrame().getSeqs().size() + "" );
455             _input_seqs_type_tf.setText( getParentFrame().getSeqs().get( 0 ).getType() + "" );
456             _input_seqs_tf.setEnabled( true );
457             _input_seqs_median_length_tf.setEnabled( true );
458             _input_seqs_min_length_tf.setEnabled( true );
459             _input_seqs_max_length_tf.setEnabled( true );
460             _input_seqs_number_tf.setEnabled( true );
461             _input_seqs_type_tf.setEnabled( true );
462             _launch_btn.setEnabled( true );
463         }
464         else {
465             _input_seqs_tf.setText( "" );
466             _input_seqs_median_length_tf.setText( "" );
467             _input_seqs_min_length_tf.setText( "" );
468             _input_seqs_max_length_tf.setText( "" );
469             _input_seqs_number_tf.setText( "" );
470             _input_seqs_type_tf.setText( "" );
471             _input_seqs_tf.setEnabled( false );
472             _input_seqs_median_length_tf.setEnabled( false );
473             _input_seqs_min_length_tf.setEnabled( false );
474             _input_seqs_max_length_tf.setEnabled( false );
475             _input_seqs_number_tf.setEnabled( false );
476             _input_seqs_type_tf.setEnabled( false );
477             _launch_btn.setEnabled( false );
478         }
479     }
480
481     DescriptiveStatistics calcSequenceStats( final List<Sequence> seqs ) {
482         final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
483         for( final Sequence s : seqs ) {
484             stats.addValue( s.getLength() );
485         }
486         return stats;
487     }
488 }