Define set_rdkit_ring_dihedrals and make test#767
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #767 +/- ##
==========================================
+ Coverage 74.09% 74.12% +0.03%
==========================================
Files 101 101
Lines 28005 28038 +33
Branches 5860 5863 +3
==========================================
+ Hits 20751 20784 +33
Misses 5786 5786
Partials 1468 1468
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@JintaoWu98, what's the status of this PR? I don't see the new function being used, would you like to wait with it? |
ecb1262 to
5f8bca9
Compare
| return num_comb | ||
|
|
||
|
|
||
| def plot_ring_torsion_angles(conformers, plot_path=None, tolerance=15): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
| os.makedirs(plot_path) | ||
| try: | ||
| plt.savefig(ring_plot_path, bbox_inches='tight') | ||
| except FileNotFoundError: |
Check notice
Code scanning / CodeQL
Empty except Note
| torsion_0_indexed = [[tor - 0 for tor in sub_torsion] for sub_torsion in torsion] | ||
| ring_length = len(torsion_0_indexed) | ||
| head = torsion_0_indexed[0][0] | ||
| for torsion in torsion_0_indexed: |
Check notice
Code scanning / CodeQL
Nested loops with same variable Note
|
|
||
| # Remove the bond to open the ring | ||
| rd_mol_noH = Chem.RWMol(rd_mol_noH) | ||
| rd_mol_noH.RemoveBond(atom_map[ring_head], atom_map[ring_tail]) |
Check failure
Code scanning / CodeQL
Unhashable object hashed Error
| rdMT.SetDihedralDeg(conf_noH, *torsion_noH, dihedral) | ||
| # Re-add the bond to close the ring | ||
| rd_mol_noH.AddBond( | ||
| atom_map[ring_head], atom_map[ring_tail], rd_mol.GetBondBetweenAtoms(ring_head, ring_tail).GetBondType() |
Check failure
Code scanning / CodeQL
Unhashable object hashed Error
| mol = b_mol if b_mol is not None else s_mol | ||
| _, rd_mol = converter.rdkit_conf_from_mol(mol, xyz_original) | ||
|
|
||
| xyz_final = converter.set_rdkit_ring_dihedrals(rd_mol, ring_head, ring_tail, torsions, dihedrals) |
Check failure
Code scanning / CodeQL
Wrong number of arguments in a call Error
5f8bca9 to
7fce699
Compare
7fce699 to
9cbb672
Compare
This PR introduces a new helper function,
set_rdkit_ring_dihedrals, to theconverter.pymodule. This function allows for setting dihedral angles in a ring structure using RDKit, facilitating the manipulation of molecular conformations.