• RE: Hydrogen Bond Propensity calculations with Python 3

     Thanks for providing this script. I had some trouble getting it work and thought these notes might help others.

    - Should the line of code pasted below follow line 240? This addition would mirror the code on line 236.

    coord_cols = [i for i in range(len(coordination_scores.predictions_for_label(a.label, 'a')[1]))]

    - Line on 308 causes problems on linux

     coformer_files = glob.glob(r'%s\*.mol2' % library)

    This should work on any OS

     coformer_files = glob.glob(os.path.join(library, '*.mol2')


    - If the structure file is not in the working directory line  285 causes a problem. I changed it to these two lines

    basename = os.path.basename(identifier)
    prefix, _ = os.path.splitext(basename)
    output_file = os.path.join(directory, '%s_MC_HBP_report.docx' % prefix)


    - Line 332 can fail as the sorting key can receive a mix of strings and numbers. Changing 329 to the following helps

    nan = float('nan')
    mc_dictionary[coformer_name] = [nan, nan, nan, nan, nan, crystal.identifier]