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

Fix issue #270 #271

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,11 @@ def makeCompatibleWith(
if len(matches) < num_atoms0:
# Atom names or order might have changed. Try to match by coordinates.
matcher = _SireMol.AtomCoordMatcher()
matches = matcher.match(mol0, mol1)

try:
matches = matcher.match(mol0, mol1)
except:
matches = []

# We need to rename the atoms.
is_renamed = True
Expand Down Expand Up @@ -1003,7 +1007,11 @@ def makeCompatibleWith(
matcher = _SireMol.AtomCoordMatcher()

# Get the matches for this molecule and append to the list.
match = matcher.match(mol0, mol)
try:
match = matcher.match(mol0, mol)
except:
match = []

matches.append(match)
num_matches += len(match)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,7 @@ def getRestraintAtoms(
string = (
"(not water) and (resname "
+ ",".join(_prot_res)
+ ","
+ ",".join(_nucl_res)
+ ") and (atomname N,CA,C,O,P,/C5'/,/C3'/,/O3'/,/O5'/)"
)
Expand Down Expand Up @@ -1943,6 +1944,7 @@ def getRestraintAtoms(
string = (
"(not water) and (resname "
+ ",".join(_prot_res)
+ ","
+ ",".join(_nucl_res)
+ ") and (atomname N,CA,C,O,P,/C5'/,/C3'/,/O3'/,/O5'/)"
)
Expand Down
12 changes: 6 additions & 6 deletions python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
Utilities.
"""

# A set of protein residues. Taken from MDAnalysis.
_prot_res = {
# A list of protein residues. Taken from MDAnalysis.
_prot_res = [
# CHARMM top_all27_prot_lipid.rtf
"ALA",
"ARG",
Expand Down Expand Up @@ -135,10 +135,10 @@
"CMET",
"CME",
"ASF",
}
]

# A set of nucleic acid residues. Taken from MDAnalysis.
_nucl_res = {
# A list of nucleic acid residues. Taken from MDAnalysis.
_nucl_res = [
"ADE",
"URA",
"CYT",
Expand Down Expand Up @@ -173,7 +173,7 @@
"RU3",
"RG3",
"RC3",
}
]

# A list of ion elements.
_ions = [
Expand Down
12 changes: 10 additions & 2 deletions python/BioSimSpace/_SireWrappers/_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,11 @@ def makeCompatibleWith(
if len(matches) < num_atoms0:
# Atom names or order might have changed. Try to match by coordinates.
matcher = _SireMol.AtomCoordMatcher()
matches = matcher.match(mol0, mol1)

try:
matches = matcher.match(mol0, mol1)
except:
matches = []

# We need to rename the atoms.
is_renamed = True
Expand Down Expand Up @@ -959,7 +963,11 @@ def makeCompatibleWith(
matcher = _SireMol.AtomCoordMatcher()

# Get the matches for this molecule and append to the list.
match = matcher.match(mol0, mol)
try:
match = matcher.match(mol0, mol)
except:
match = []

matches.append(match)
num_matches += len(match)

Expand Down
2 changes: 2 additions & 0 deletions python/BioSimSpace/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,7 @@ def getRestraintAtoms(
string = (
"(not water) and (resname "
+ ",".join(_prot_res)
+ ","
+ ",".join(_nucl_res)
+ ") and (atomname N,CA,C,O,P,/C5'/,/C3'/,/O3'/,/O5'/)"
)
Expand Down Expand Up @@ -1864,6 +1865,7 @@ def getRestraintAtoms(
string = (
"(not water) and (resname "
+ ",".join(_prot_res)
+ ","
+ ",".join(_nucl_res)
+ ") and (atomname N,CA,C,O,P,/C5'/,/C3'/,/O3'/,/O5'/)"
)
Expand Down
12 changes: 6 additions & 6 deletions python/BioSimSpace/_SireWrappers/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
Utilities.
"""

# A set of protein residues. Taken from MDAnalysis.
_prot_res = {
# A list of protein residues. Taken from MDAnalysis.
_prot_res = [
# CHARMM top_all27_prot_lipid.rtf
"ALA",
"ARG",
Expand Down Expand Up @@ -135,10 +135,10 @@
"CMET",
"CME",
"ASF",
}
]

# A set of nucleic acid residues. Taken from MDAnalysis.
_nucl_res = {
# A list of nucleic acid residues. Taken from MDAnalysis.
_nucl_res = [
"ADE",
"URA",
"CYT",
Expand Down Expand Up @@ -173,7 +173,7 @@
"RU3",
"RG3",
"RC3",
}
]

# A list of ion elements.
_ions = [
Expand Down