in progress
[jalview.git] / forester / java / src / org / forester / tools / PhylogenyDecorator.java
1 // $Id:
2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
4 //
5 // Copyright (C) 2008-2009 Christian M. Zmasek
6 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
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.tools;
27
28 import java.io.File;
29 import java.io.IOException;
30 import java.util.HashMap;
31 import java.util.Map;
32 import java.util.regex.Matcher;
33 import java.util.regex.Pattern;
34
35 import org.forester.archaeopteryx.AptxUtil;
36 import org.forester.io.parsers.nhx.NHXFormatException;
37 import org.forester.phylogeny.Phylogeny;
38 import org.forester.phylogeny.PhylogenyNode;
39 import org.forester.phylogeny.data.Accession;
40 import org.forester.phylogeny.data.Annotation;
41 import org.forester.phylogeny.data.DomainArchitecture;
42 import org.forester.phylogeny.data.Identifier;
43 import org.forester.phylogeny.data.Sequence;
44 import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
45 import org.forester.util.BasicTable;
46 import org.forester.util.BasicTableParser;
47 import org.forester.util.ForesterUtil;
48
49 public final class PhylogenyDecorator {
50
51     // From evoruby/lib/evo/apps/tseq_taxonomy_processor.rb:
52     final private static String  TP_TAXONOMY_CODE                   = "TAXONOMY_CODE";
53     final private static String  TP_TAXONOMY_ID                     = "TAXONOMY_ID";
54     final private static String  TP_TAXONOMY_ID_PROVIDER            = "TAXONOMY_ID_PROVIDER";
55     final private static String  TP_TAXONOMY_SN                     = "TAXONOMY_SN";
56     final private static String  TP_TAXONOMY_CN                     = "TAXONOMY_CN";
57     final private static String  TP_TAXONOMY_SYN                    = "TAXONOMY_SYN";
58     final private static String  TP_SEQ_SYMBOL                      = "SEQ_SYMBOL";
59     final private static String  TP_SEQ_ACCESSION                   = "SEQ_ACCESSION";
60     final private static String  TP_SEQ_ACCESSION_SOURCE            = "SEQ_ACCESSION_SOURCE";
61     final private static String  TP_SEQ_ANNOTATION_DESC             = "SEQ_ANNOTATION_DESC";
62     final private static String  TP_SEQ_ANNOTATION_REF              = "SEQ_ANNOTATION_REF";
63     final private static String  TP_SEQ_MOL_SEQ                     = "SEQ_MOL_SEQ";
64     final private static String  TP_SEQ_NAME                        = "SEQ_NAME";
65     final private static String  TP_NODE_NAME                       = "NODE_NAME";
66     final private static Pattern NODENAME_SEQNUMBER_TAXDOMAINNUMBER = Pattern
67                                                                             .compile( "^([a-fA-Z0-9]{1,5})_([A-Z0-9]{2,4}[A-Z])(\\d{1,4})$" );
68     public final static boolean  SANITIZE                           = false;
69     public final static boolean  VERBOSE                            = true;
70
71     private PhylogenyDecorator() {
72         // Not needed.
73     }
74
75     public static void decorate( final Phylogeny phylogeny,
76                                  final Map<String, Map<String, String>> map,
77                                  final boolean picky,
78                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map )
79             throws IllegalArgumentException {
80         for( final PhylogenyNodeIterator iter = phylogeny.iteratorPostorder(); iter.hasNext(); ) {
81             final PhylogenyNode node = iter.next();
82             final String name = node.getName();
83             if ( !ForesterUtil.isEmpty( name ) ) {
84                 if ( map.containsKey( name ) || ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 ) ) {
85                     Map<String, String> new_values = map.get( name );
86                     int x = 0;
87                     while ( ( new_values == null ) && ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 )
88                             && ( x <= numbers_of_chars_allowed_to_remove_if_not_found_in_map ) ) {
89                         new_values = map.get( name.substring( 0, name.length() - x ) );
90                         ++x;
91                     }
92                     if ( new_values != null ) {
93                         if ( new_values.containsKey( TP_TAXONOMY_CODE ) ) {
94                             AptxUtil.ensurePresenceOfTaxonomy( node );
95                             node.getNodeData().getTaxonomy().setTaxonomyCode( new_values.get( TP_TAXONOMY_CODE ) );
96                         }
97                         if ( new_values.containsKey( TP_TAXONOMY_ID )
98                                 && new_values.containsKey( TP_TAXONOMY_ID_PROVIDER ) ) {
99                             AptxUtil.ensurePresenceOfTaxonomy( node );
100                             node.getNodeData()
101                                     .getTaxonomy()
102                                     .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ),
103                                                                     new_values.get( TP_TAXONOMY_ID_PROVIDER ) ) );
104                         }
105                         else if ( new_values.containsKey( TP_TAXONOMY_ID ) ) {
106                             AptxUtil.ensurePresenceOfTaxonomy( node );
107                             node.getNodeData().getTaxonomy()
108                                     .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ) ) );
109                         }
110                         if ( new_values.containsKey( TP_TAXONOMY_SN ) ) {
111                             AptxUtil.ensurePresenceOfTaxonomy( node );
112                             node.getNodeData().getTaxonomy().setScientificName( new_values.get( TP_TAXONOMY_SN ) );
113                         }
114                         if ( new_values.containsKey( TP_TAXONOMY_CN ) ) {
115                             AptxUtil.ensurePresenceOfTaxonomy( node );
116                             node.getNodeData().getTaxonomy().setCommonName( new_values.get( TP_TAXONOMY_CN ) );
117                         }
118                         if ( new_values.containsKey( TP_TAXONOMY_SYN ) ) {
119                             AptxUtil.ensurePresenceOfTaxonomy( node );
120                             node.getNodeData().getTaxonomy().getSynonyms().add( new_values.get( TP_TAXONOMY_SYN ) );
121                         }
122                         if ( new_values.containsKey( TP_SEQ_ACCESSION )
123                                 && new_values.containsKey( TP_SEQ_ACCESSION_SOURCE ) ) {
124                             AptxUtil.ensurePresenceOfSequence( node );
125                             node.getNodeData()
126                                     .getSequence()
127                                     .setAccession( new Accession( new_values.get( TP_SEQ_ACCESSION ),
128                                                                   new_values.get( TP_SEQ_ACCESSION_SOURCE ) ) );
129                         }
130                         if ( new_values.containsKey( TP_SEQ_ANNOTATION_DESC ) ) {
131                             AptxUtil.ensurePresenceOfSequence( node );
132                             final Annotation ann = new Annotation( "?" );
133                             ann.setDesc( new_values.get( TP_SEQ_ANNOTATION_DESC ) );
134                             node.getNodeData().getSequence().addAnnotation( ann );
135                         }
136                         if ( new_values.containsKey( TP_SEQ_ANNOTATION_REF ) ) {
137                             AptxUtil.ensurePresenceOfSequence( node );
138                             final Annotation ann = new Annotation( new_values.get( TP_SEQ_ANNOTATION_REF ) );
139                             node.getNodeData().getSequence().addAnnotation( ann );
140                         }
141                         if ( new_values.containsKey( TP_SEQ_SYMBOL ) ) {
142                             AptxUtil.ensurePresenceOfSequence( node );
143                             node.getNodeData().getSequence().setSymbol( new_values.get( TP_SEQ_SYMBOL ) );
144                         }
145                         if ( new_values.containsKey( TP_SEQ_NAME ) ) {
146                             AptxUtil.ensurePresenceOfSequence( node );
147                             node.getNodeData().getSequence().setName( new_values.get( TP_SEQ_NAME ) );
148                         }
149                         if ( new_values.containsKey( TP_SEQ_MOL_SEQ ) ) {
150                             AptxUtil.ensurePresenceOfSequence( node );
151                             node.getNodeData().getSequence().setMolecularSequence( new_values.get( TP_SEQ_MOL_SEQ ) );
152                         }
153                         if ( new_values.containsKey( TP_NODE_NAME ) ) {
154                             node.setName( new_values.get( TP_NODE_NAME ) );
155                         }
156                     }
157                 }
158                 else if ( picky ) {
159                     throw new IllegalArgumentException( "\"" + name + "\" not found in name map" );
160                 }
161             }
162         }
163     }
164
165     /**
166      * 
167      * 
168      * 
169      * 
170      * 
171      * @param phylogeny
172      * @param map
173      *            maps names (in phylogeny) to new values
174      * @param field
175      * @param picky
176      * @throws IllegalArgumentException
177      * @throws NHXFormatException
178      */
179     public static void decorate( final Phylogeny phylogeny,
180                                  final Map<String, String> map,
181                                  final FIELD field,
182                                  final boolean extract_bracketed_scientific_name,
183                                  final boolean picky,
184                                  final boolean cut_name_after_space,
185                                  final boolean process_name_intelligently,
186                                  final boolean process_similar_to,
187                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map,
188                                  final boolean move_domain_numbers_at_end_to_middle ) throws IllegalArgumentException,
189             NHXFormatException {
190         PhylogenyDecorator.decorate( phylogeny,
191                                      map,
192                                      field,
193                                      extract_bracketed_scientific_name,
194                                      picky,
195                                      null,
196                                      cut_name_after_space,
197                                      process_name_intelligently,
198                                      process_similar_to,
199                                      numbers_of_chars_allowed_to_remove_if_not_found_in_map,
200                                      move_domain_numbers_at_end_to_middle );
201     }
202
203     /**
204      * 
205      * 
206      * 
207      * @param phylogeny
208      * @param map
209      *            maps names (in phylogeny) to new values if intermediate_map is
210      *            null otherwise maps intermediate value to new value
211      * @param field
212      * @param picky
213      * @param intermediate_map
214      *            maps name (in phylogeny) to a intermediate value
215      * @throws IllegalArgumentException
216      */
217     public static void decorate( final Phylogeny phylogeny,
218                                  final Map<String, String> map,
219                                  final FIELD field,
220                                  final boolean extract_bracketed_scientific_name,
221                                  final boolean picky,
222                                  final Map<String, String> intermediate_map,
223                                  final boolean cut_name_after_space,
224                                  final boolean process_name_intelligently,
225                                  final boolean process_similar_to,
226                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map,
227                                  final boolean move_domain_numbers_at_end_to_middle ) throws IllegalArgumentException {
228         if ( extract_bracketed_scientific_name && ( field == FIELD.TAXONOMY_SCIENTIFIC_NAME ) ) {
229             throw new IllegalArgumentException( "Attempt to extract bracketed scientific name together with data field pointing to scientific name" );
230         }
231         for( final PhylogenyNodeIterator iter = phylogeny.iteratorPostorder(); iter.hasNext(); ) {
232             final PhylogenyNode node = iter.next();
233             String name = node.getName();
234             if ( !ForesterUtil.isEmpty( name ) ) {
235                 if ( intermediate_map != null ) {
236                     name = PhylogenyDecorator.extractIntermediate( intermediate_map, name );
237                 }
238                 if ( map.containsKey( name ) || ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 ) ) {
239                     String new_value = map.get( name );
240                     int x = 0;
241                     while ( ( new_value == null ) && ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 )
242                             && ( x <= numbers_of_chars_allowed_to_remove_if_not_found_in_map ) ) {
243                         new_value = map.get( name.substring( 0, name.length() - x ) );
244                         ++x;
245                     }
246                     if ( new_value != null ) {
247                         new_value = new_value.trim();
248                         new_value.replaceAll( "/\\s+/", " " );
249                         if ( extract_bracketed_scientific_name && new_value.endsWith( "]" ) ) {
250                             extractBracketedScientificNames( node, new_value );
251                         }
252                         switch ( field ) {
253                             case SEQUENCE_ANNOTATION_DESC:
254                                 if ( PhylogenyDecorator.VERBOSE ) {
255                                     System.out.println( name + ": " + new_value );
256                                 }
257                                 if ( !node.getNodeData().isHasSequence() ) {
258                                     node.getNodeData().setSequence( new Sequence() );
259                                 }
260                                 final Annotation annotation = new Annotation( "?" );
261                                 annotation.setDesc( new_value );
262                                 node.getNodeData().getSequence().addAnnotation( annotation );
263                                 break;
264                             case DOMAIN_STRUCTURE:
265                                 if ( PhylogenyDecorator.VERBOSE ) {
266                                     System.out.println( name + ": " + new_value );
267                                 }
268                                 if ( !node.getNodeData().isHasSequence() ) {
269                                     node.getNodeData().setSequence( new Sequence() );
270                                 }
271                                 node.getNodeData().getSequence()
272                                         .setDomainArchitecture( new DomainArchitecture( new_value ) );
273                                 break;
274                             case TAXONOMY_CODE:
275                                 if ( PhylogenyDecorator.VERBOSE ) {
276                                     System.out.println( name + ": " + new_value );
277                                 }
278                                 AptxUtil.ensurePresenceOfTaxonomy( node );
279                                 node.getNodeData().getTaxonomy().setTaxonomyCode( new_value );
280                                 break;
281                             case TAXONOMY_SCIENTIFIC_NAME:
282                                 if ( PhylogenyDecorator.VERBOSE ) {
283                                     System.out.println( name + ": " + new_value );
284                                 }
285                                 AptxUtil.ensurePresenceOfTaxonomy( node );
286                                 node.getNodeData().getTaxonomy().setScientificName( new_value );
287                                 break;
288                             case SEQUENCE_NAME:
289                                 if ( PhylogenyDecorator.VERBOSE ) {
290                                     System.out.println( name + ": " + new_value );
291                                 }
292                                 if ( !node.getNodeData().isHasSequence() ) {
293                                     node.getNodeData().setSequence( new Sequence() );
294                                 }
295                                 node.getNodeData().getSequence().setName( new_value );
296                                 break;
297                             case NODE_NAME:
298                                 if ( PhylogenyDecorator.VERBOSE ) {
299                                     System.out.print( name + " -> " );
300                                 }
301                                 if ( cut_name_after_space ) {
302                                     if ( PhylogenyDecorator.VERBOSE ) {
303                                         System.out.print( new_value + " -> " );
304                                     }
305                                     new_value = PhylogenyDecorator.deleteAtFirstSpace( new_value );
306                                 }
307                                 else if ( process_name_intelligently ) {
308                                     if ( PhylogenyDecorator.VERBOSE ) {
309                                         System.out.print( new_value + " -> " );
310                                     }
311                                     new_value = PhylogenyDecorator.processNameIntelligently( new_value );
312                                 }
313                                 else if ( process_similar_to ) {
314                                     if ( PhylogenyDecorator.VERBOSE ) {
315                                         System.out.print( new_value + " -> " );
316                                     }
317                                     new_value = PhylogenyDecorator.processSimilarTo( new_value );
318                                 }
319                                 if ( PhylogenyDecorator.SANITIZE ) {
320                                     new_value = PhylogenyDecorator.sanitize( new_value );
321                                 }
322                                 if ( PhylogenyDecorator.VERBOSE ) {
323                                     System.out.println( new_value );
324                                 }
325                                 node.setName( new_value );
326                                 break;
327                             default:
328                                 throw new RuntimeException( "unknown field \"" + field + "\"" );
329                         }
330                         if ( move_domain_numbers_at_end_to_middle && ( field != FIELD.NODE_NAME ) ) {
331                             node.setName( moveDomainNumbersAtEnd( node.getName() ) );
332                         }
333                     }
334                 }
335                 else if ( picky ) {
336                     throw new IllegalArgumentException( "\"" + name + "\" not found in name map" );
337                 }
338             }
339         }
340     }
341
342     public static void decorate( final Phylogeny[] phylogenies,
343                                  final Map<String, Map<String, String>> map,
344                                  final boolean picky,
345                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map )
346             throws IllegalArgumentException, NHXFormatException {
347         for( int i = 0; i < phylogenies.length; ++i ) {
348             PhylogenyDecorator.decorate( phylogenies[ i ],
349                                          map,
350                                          picky,
351                                          numbers_of_chars_allowed_to_remove_if_not_found_in_map );
352         }
353     }
354
355     public static void decorate( final Phylogeny[] phylogenies,
356                                  final Map<String, String> map,
357                                  final FIELD field,
358                                  final boolean extract_bracketed_scientific_name,
359                                  final boolean picky,
360                                  final boolean cut_name_after_space,
361                                  final boolean process_name_intelligently,
362                                  final boolean process_similar_to,
363                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map,
364                                  final boolean move_domain_numbers_at_end_to_middle ) throws IllegalArgumentException,
365             NHXFormatException {
366         for( int i = 0; i < phylogenies.length; ++i ) {
367             PhylogenyDecorator.decorate( phylogenies[ i ],
368                                          map,
369                                          field,
370                                          extract_bracketed_scientific_name,
371                                          picky,
372                                          cut_name_after_space,
373                                          process_name_intelligently,
374                                          process_similar_to,
375                                          numbers_of_chars_allowed_to_remove_if_not_found_in_map,
376                                          move_domain_numbers_at_end_to_middle );
377         }
378     }
379
380     public static void decorate( final Phylogeny[] phylogenies,
381                                  final Map<String, String> map,
382                                  final FIELD field,
383                                  final boolean extract_bracketed_scientific_name,
384                                  final boolean picky,
385                                  final Map<String, String> intermediate_map,
386                                  final boolean cut_name_after_space,
387                                  final boolean process_name_intelligently,
388                                  final boolean process_similar_to,
389                                  final int numbers_of_chars_allowed_to_remove_if_not_found_in_map,
390                                  final boolean move_domain_numbers_at_end_to_middle ) throws IllegalArgumentException,
391             NHXFormatException {
392         for( int i = 0; i < phylogenies.length; ++i ) {
393             PhylogenyDecorator.decorate( phylogenies[ i ],
394                                          map,
395                                          field,
396                                          extract_bracketed_scientific_name,
397                                          picky,
398                                          intermediate_map,
399                                          cut_name_after_space,
400                                          process_name_intelligently,
401                                          process_similar_to,
402                                          numbers_of_chars_allowed_to_remove_if_not_found_in_map,
403                                          move_domain_numbers_at_end_to_middle );
404         }
405     }
406
407     private static String deleteAtFirstSpace( final String name ) {
408         final int first_space = name.indexOf( " " );
409         if ( first_space > 1 ) {
410             return name.substring( 0, first_space ).trim();
411         }
412         return name;
413     }
414
415     private static void extractBracketedScientificNames( final PhylogenyNode node, final String new_value ) {
416         final int i = new_value.lastIndexOf( "[" );
417         final String scientific_name = new_value.substring( i + 1, new_value.length() - 1 );
418         AptxUtil.ensurePresenceOfTaxonomy( node );
419         node.getNodeData().getTaxonomy().setScientificName( scientific_name );
420     }
421
422     private static String extractIntermediate( final Map<String, String> intermediate_map, final String name ) {
423         String new_name = null;
424         if ( PhylogenyDecorator.VERBOSE ) {
425             System.out.print( name + " => " );
426         }
427         if ( intermediate_map.containsKey( name ) ) {
428             new_name = intermediate_map.get( name );
429             if ( ForesterUtil.isEmpty( new_name ) ) {
430                 throw new IllegalArgumentException( "\"" + name + "\" maps to null or empty string in secondary map" );
431             }
432         }
433         else {
434             throw new IllegalArgumentException( "\"" + name + "\" not found in name secondary map" );
435         }
436         if ( PhylogenyDecorator.VERBOSE ) {
437             System.out.println( new_name + "  " );
438         }
439         return new_name;
440     }
441
442     private static String moveDomainNumbersAtEnd( final String node_name ) {
443         final Matcher m = NODENAME_SEQNUMBER_TAXDOMAINNUMBER.matcher( node_name );
444         if ( m.matches() ) {
445             final String seq_number = m.group( 1 );
446             final String tax = m.group( 2 );
447             final String domain_number = m.group( 3 );
448             return seq_number + "_[" + domain_number + "]_" + tax;
449         }
450         else {
451             return node_name;
452         }
453     }
454
455     public static Map<String, Map<String, String>> parseMappingTable( final File mapping_table_file )
456             throws IOException {
457         final Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>();
458         BasicTable<String> mapping_table = null;
459         mapping_table = BasicTableParser.parse( mapping_table_file, "\t", false );
460         for( int row = 0; row < mapping_table.getNumberOfRows(); ++row ) {
461             final Map<String, String> row_map = new HashMap<String, String>();
462             String name = null;
463             for( int col = 0; col < mapping_table.getNumberOfColumns(); ++col ) {
464                 final String table_cell = mapping_table.getValue( col, row );
465                 if ( col == 0 ) {
466                     name = table_cell;
467                 }
468                 else if ( table_cell != null ) {
469                     final String key = table_cell.substring( 0, table_cell.indexOf( ':' ) );
470                     final String val = table_cell.substring( table_cell.indexOf( ':' ) + 1, table_cell.length() );
471                     row_map.put( key, val );
472                 }
473             }
474             map.put( name, row_map );
475         }
476         return map;
477     }
478
479     private static String processNameIntelligently( final String name ) {
480         final String[] s = name.split( " " );
481         if ( s.length < 2 ) {
482             return name;
483         }
484         else if ( ( s[ 0 ].indexOf( "_" ) > 0 ) && ( s[ 0 ].indexOf( "|" ) > 0 ) ) {
485             return s[ 0 ];
486         }
487         else if ( ( s[ 1 ].indexOf( "_" ) > 0 ) && ( s[ 1 ].indexOf( "|" ) > 0 ) ) {
488             return s[ 1 ];
489         }
490         else if ( ( s[ 0 ].indexOf( "_" ) > 0 ) && ( s[ 0 ].indexOf( "." ) > 0 ) ) {
491             return s[ 0 ];
492         }
493         else if ( ( s[ 1 ].indexOf( "_" ) > 0 ) && ( s[ 1 ].indexOf( "." ) > 0 ) ) {
494             return s[ 1 ];
495         }
496         else if ( s[ 0 ].indexOf( "_" ) > 0 ) {
497             return s[ 0 ];
498         }
499         else if ( s[ 1 ].indexOf( "_" ) > 0 ) {
500             return s[ 1 ];
501         }
502         else {
503             return s[ 0 ];
504         }
505     }
506
507     private static String processSimilarTo( final String name ) {
508         final int i = name.toLowerCase().indexOf( "similar to" );
509         String similar_to = "";
510         if ( i >= 0 ) {
511             similar_to = " similarity=" + name.substring( i + 10 ).trim();
512         }
513         final String pi = processNameIntelligently( name );
514         return pi + similar_to;
515     }
516
517     private static String sanitize( String s ) {
518         s = s.replace( ' ', '_' );
519         s = s.replace( '(', '{' );
520         s = s.replace( ')', '}' );
521         s = s.replace( '[', '{' );
522         s = s.replace( ']', '}' );
523         s = s.replace( ',', '_' );
524         return s;
525     }
526
527     public static enum FIELD {
528         NODE_NAME, SEQUENCE_ANNOTATION_DESC, DOMAIN_STRUCTURE, TAXONOMY_CODE, TAXONOMY_SCIENTIFIC_NAME, SEQUENCE_NAME;
529     }
530 }