INNER CODE UNIT · Python
check_model_validity
nickjcroucher/gubbins · python/gubbins/common.py:778
def check_model_validity(current_model,current_tree_builder,mar,recon_model,model_fitter,custom_model,custom_recon_model):
# Check substitution model consistent with tree building algorithm
invalid_model = False
# Determine model to be used for subsequent iterations
if not custom_model and current_model not in tree_models[current_tree_builder]:
sys.stderr.write('Evolutionary model ' + current_model +
' and algorithm ' + current_tree_builder +
' are incompatible\n')
invalid_model = True
# Determine model to be used for ancestral state reconstruction
if not mar:
if not custom_recon_model and recon_model not in tree_models[model_fitter]:
sys.stderr.write('Evolutionary model ' + recon_model +
' and algorithm ' + model_fitter +
' are incompatible\n')
invalid_model = True
# Information for rectifying incompatible combinations
if invalid_model: