Closed rwxayheee closed 1 week ago
Awesome thanks!
Minor request: change if pdbmol:
to if pdbmol is not None:
to follow Google's style guide https://google.github.io/styleguide/pyguide.html#2144-decision
Minor request: change if pdbmol: to if pdbmol is not None: to follow Google's style guide
Understood! use if pdbmol is None to check for failure in 4658a56
Hi @diogomart Thanks again for pointing to the styleguide. Sorry I wasn't home so I didn't taike a very careful look.. I just realized that the original PR (before https://github.com/forlilab/Meeko/pull/178/commits/4658a56aec224d646f1b950206525e5396bb4208) uses implicit False, which is compliant with the styleguide:
2.14.4 Decision Use the “implicit” false if possible, e.g., if foo: rather than if foo != []:. There are a few caveats that you should keep in mind though: ... Yes: if not users: print('no users')
Therefore, I don't think https://github.com/forlilab/Meeko/pull/178/commits/4658a56aec224d646f1b950206525e5396bb4208 is compliant. But I also don't have a strong preference, so please don't feel pressured to revert. I did the original because lazy
Ah nevermind I saw this
Always use if foo is None: (or is not None) to check for a None value. E.g., when testing whether a variable or argument that defaults to None was set to some other value. The other value might be a value that’s false in a boolean context!
Sorry for the confusion, I will merge https://github.com/forlilab/Meeko/commit/4658a56aec224d646f1b950206525e5396bb4208
In mk_prepare_receptor, RDKit's Chem.MolFromPDBBlock is used to build input_mols per residue, when
--pdb
is used to parse receptor PDB file. Sometimes, MolFromPDBBlock failed to return a Mol if residue's structure is corrupt.Currently, problems like:
would not terminate the process. The incomplete input_mols are carried on for chorizo building.
The change raises RuntimeError when MolFromPDBBlock failed to return a mol, and provide hopefully helpful information to locate the residue that didn't go through MolFromPDBBlock.
Before the change, the error message is displayed:
After, the process is terminated immediately when Chem.MolFromPDBBlock failed on a residue: