forked from ConorFWild/ligand_neighbourhood_alignment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from xchem/assembly_based_alignment
Assembly based alignment
- Loading branch information
Showing
25 changed files
with
54,749 additions
and
286 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
assemblies: | ||
dimer: | ||
reference: Mpro-IBM0045 | ||
biomol: A,B | ||
chains: A,A(-x,y,-z) | ||
monomer: | ||
reference: 7ql8 | ||
biomol: B | ||
chains: A | ||
fake_dimer: | ||
reference: 8e1y | ||
biomol: A,C | ||
chains: A,B | ||
fake_tetramer: | ||
reference: 8dz9 | ||
biomol: D,C,E,F | ||
chains: A,B,C,D | ||
crystalforms: | ||
xtalform1: | ||
reference: Mpro-IBM0045 | ||
assemblies: | ||
1: | ||
assembly: dimer | ||
chains: A,A(-x,y,-z) | ||
xtalform2: | ||
reference: 7ql8 | ||
assemblies: | ||
1: | ||
assembly: monomer | ||
chains: A | ||
xtalform3: | ||
reference: 8e1y | ||
assemblies: | ||
1: | ||
assembly: dimer | ||
chains: A,B |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import gemmi | ||
from ligand_neighbourhood_alignment import alignment_heirarchy, dt | ||
|
||
|
||
def main(): | ||
dtag = 'Mpro-x0107' | ||
file = 'data/refine_8.split.bound-state.pdb' | ||
st = gemmi.read_structure(file) | ||
generators = [ | ||
dt.Generator('A', 'A', 'x,y,z'), | ||
dt.Generator('B', 'A', '-x,y,-z'), | ||
] | ||
|
||
# Setup new structure to add biochains to | ||
new_st = gemmi.Structure() | ||
new_st.spacegroup_hm = gemmi.SpaceGroup('P 1').xhm() | ||
new_st.cell = st.cell | ||
new_model = gemmi.Model("0") | ||
new_st.add_model(new_model) | ||
|
||
# Iterate over chain, biochain, transform tuples in the assembly | ||
for generator in generators: | ||
# Generate the symmetry operation | ||
op = gemmi.Op(generator.triplet) | ||
|
||
# Create a clone of base chain to transform | ||
new_chain = st[0][generator.chain].clone() | ||
|
||
# Transform the residues | ||
for residue in new_chain: | ||
for atom in residue: | ||
atom_frac = st.cell.fractionalize(atom.pos) | ||
new_pos_frac = op.apply_to_xyz([atom_frac.x, atom_frac.y, atom_frac.z]) | ||
new_pos_orth = st.cell.orthogonalize(gemmi.Fractional(*new_pos_frac)) | ||
atom.pos = gemmi.Position(*new_pos_orth) | ||
new_chain.name = generator.biomol | ||
new_st[0].add_chain(new_chain) | ||
|
||
new_st.setup_entities() | ||
print(new_st.cell) | ||
print(new_st.spacegroup_hm) | ||
new_st.write_pdb('Mpro-x0107_fake_P1.pdb') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.