def check_sequences_level(self):
"""
This method is used to ask the user a confirmation before performing an alignment in certain
situations (for example when building an alignment only with sequences belonging to the same
cluster).
"""
proceed_with_alignment = False
self.clusters_are_involved = False
# ---
# For regular alignments.
# ---
if self.alignment_strategy == "regular-alignment":
self.rebuild_single_alignment_choice = False
self.extract_siblings_choice = False
if len(self.involved_clusters_mi_list) == 1 and len(self.childless_mothers_mi_list) == 0:
# If there is only one cluster selected with all its elements: the user might want to
# rebuild an alignment with all its elements, ask confirmation.
if self.involved_clusters_mi_list == self.selected_clusters_mi_list:
title = "Rebuild alignment?"
message = "Would you like to rebuild the alignment with all its sequences?"
proceed_with_alignment = tkMessageBox.askyesno(title, message, parent=self.main_window)
self.rebuild_single_alignment_choice = proceed_with_alignment
else:
title = "Extract children?"
message = "Would you like to extract the selected children and build a new alignment?"
proceed_with_alignment = tkMessageBox.askyesno(title, message, parent=self.main_window)
self.extract_siblings_choice = proceed_with_alignment
elif len(self.involved_clusters_mi_list) > 0:
self.clusters_are_involved = True
proceed_with_alignment = True
elif len(self.involved_clusters_mi_list) == 0:
proceed_with_alignment = True
# ---
# For profile alignments.
# ---
elif self.alignment_strategy == "profile-alignment":
proceed_with_alignment = True
self.clusters_are_involved = True
return proceed_with_alignment
评论列表
文章目录