from __future__ import absolute_import, division, print_function
import sys
from iotbx.data_manager import DataManager


def run(args):
  dm = DataManager()                    #   Initialize the DataManager and call it dm
  dm.set_overwrite(True)                #   tell the DataManager to overwrite files with the same name
  model_filename = args[0]              #   Name of model file
  model = dm.get_model(model_filename)  #   Deliver model object with model info
  pdb_hierarchy = model.get_hierarchy() #   Get hierarchy object

  adp_statistics = model.adp_statistics()
  adp_statistics.show(log=sys.stdout)
  #
  adp_result = adp_statistics.result()
  adp_overall = adp_result.overall
  adp_protein = adp_result.protein
  adp_other = adp_result.other
  b_min_protein  = adp_protein.min
  b_max_protein  = adp_protein.max
  b_mean_protein = adp_protein.mean

  #print(dir(model.adp_statistics())) # Check out methods


if __name__ == '__main__':
  run(args=sys.argv[1:])
