Skip to content
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

Raise an issue if a link is not applied correctly #325

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions polyply/src/gen_itp.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=[], lib=None,
LOGGER.info("applying links between residues", type="step")
meta_molecule = ApplyLinks().run_molecule(meta_molecule)

#Check missing edges and raise issues if links between amino acids are not applied.
#Bug if the backbone is correct links between amino acids in a chain are not applied correctly
for missing in find_missing_edges(meta_molecule, meta_molecule.molecule):
msg = "Link between residue {idxA} {resA} and residue {idxB} {resB} was not applied."
LOGGER.warning(msg, **missing)
Comment on lines +105 to +109
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of just adding this line we should check if there are missing edges and then raise a general error message like the "disconnected molecule warning" and then proceed to list the edges. The connected molecule check becomes then redundant and can be removed.


# Raise warning if molecule is disconnected
if not nx.is_connected(meta_molecule.molecule):
LOGGER.warning("Your molecule consists of disjoint parts."
Expand Down