-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define set_rdkit_ring_dihedrals
and make test
#767
base: main
Are you sure you want to change the base?
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
@@ -1121,6 +1126,76 @@ | |||
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
for statement
|
||
# 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
instance
list
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
instance
list
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
function set_rdkit_ring_dihedrals
5f8bca9
to
7fce699
Compare
7fce699
to
9cbb672
Compare
if plot_path is not None: | ||
arc.plotter.plot_torsion_angles(torsion_angles, torsions_sampling_points, wells_dict=wells_dict, | ||
plot_path=plot_path) | ||
ring_angle_data = arc.plotter.plot_ring_torsion_angles(conformers=conformers, plot_path=plot_path) | ||
# Process the ring angle data | ||
if ring_angle_data: |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
This PR introduces a new helper function,
set_rdkit_ring_dihedrals
, to theconverter.py
module. This function allows for setting dihedral angles in a ring structure using RDKit, facilitating the manipulation of molecular conformations.