File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ def main():
371
371
372
372
# Clean data
373
373
parser_cm = subparsers .add_parser ('clean_data' ,
374
- help = 'Remove errant taxa, uninformative trees and empty sources.'
374
+ help = 'Renames all sources and trees sensibly. Removes errant taxa, uninformative trees and empty sources.'
375
375
)
376
376
parser_cm .add_argument ('input' ,
377
377
help = 'The input phyml file' )
Original file line number Diff line number Diff line change @@ -3132,9 +3132,11 @@ def clean_data(XML):
3132
3132
# check trees are informative
3133
3133
XML = _check_informative_trees (XML ,delete = True )
3134
3134
3135
+
3135
3136
# check sources
3136
3137
XML = _check_sources (XML ,delete = True )
3137
-
3138
+ XML = all_sourcenames (XML )
3139
+
3138
3140
# fix tree names
3139
3141
XML = set_unique_names (XML )
3140
3142
XML = set_all_tree_names (XML ,overwrite = True )
Original file line number Diff line number Diff line change @@ -2429,8 +2429,13 @@ def on_clean_data(self, widget = None):
2429
2429
self .tree .write (f )
2430
2430
XML = f .getvalue ()
2431
2431
try :
2432
- XML = stk .clean_data (XML )
2433
- XML = stk .all_sourcenames (XML )
2432
+ prompt_response = dialogs .prompt (self .main_window ,
2433
+ "This function will remove data and rename sources and trees. Sure you want to go ahead?" , gtk .MESSAGE_WARNING , True )
2434
+ if (prompt_response == gtk .RESPONSE_CANCEL or
2435
+ prompt_response == gtk .RESPONSE_NO ):
2436
+ return
2437
+ elif prompt_response == gtk .RESPONSE_YES :
2438
+ XML = stk .clean_data (XML )
2434
2439
except NoAuthors as detail :
2435
2440
dialogs .error (self .main_window ,detail .msg )
2436
2441
return
You can’t perform that action at this time.
0 commit comments