pierrepo / PBxplore

A suite of tools to explore protein structures with Protein Blocks :snake:
https://pbxplore.readthedocs.org/en/latest/
MIT License
28 stars 17 forks source link

Handle production of NaN during angle calculations. #144

Closed HubLot closed 7 years ago

HubLot commented 7 years ago

Numpy can produce NaN during dihedral calculations (in get_dihedral function). This can occurs when we try to normalize the vectors ("Divide by Zero"). It usually means there is issues with some residus coordinates (for example, 2 residus superposed). The problem is the dictionary of phi/psi angle is still returned and the assignation is still made despite the NaN in the angle. This produces incorrect assignations which could be difficult to spot on a analysis of many PDBs.

This PR fix those issues by :

pierrepo commented 7 years ago

Nice work @HubLot

HubLot commented 7 years ago

shit I forgot the CHANGELOG :(

HubLot commented 7 years ago

@pierrepo, can you commit directly to the master (bad I know) with only the modification in the CHANGELOG file (like 'Handle production of NaN during angle calculations') ?

pierrepo commented 7 years ago

@HubLot already done + reformat comments

HubLot commented 7 years ago

great, thank you!