forked from dseeliger/pmx
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathtest_build.py
More file actions
52 lines (38 loc) · 1.36 KB
/
test_build.py
File metadata and controls
52 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from pmx import Molecule, Chain
from pmx.builder import build_dna_strand
def test_build():
# start a peptide chain from an amino acid
mol = Molecule().new_aa( "ALA" ) # build alanine
c = Chain( residues = [ mol ] ) # initialize chain
c.nbuild("T") # extend at n-terminus
c.cbuild("R") # extend at c-terminus
c.write('TAR.pdb') # write pdb file
# build a peptide chain from sequence
sequence = "FRTLKNCWQ"
c = Chain().create( sequence )
c.write("extended.pdb")
for resi in c.residues:
resi.set_phi( -57, True )
resi.set_psi( -47, True )
c.write("helix_pep.pdb")
# fusing two chains
seq = "LMNFRTS"
c2 = Chain().create(seq)
c.fuse( c2 )
c.write("fused_pep.pdb")
# create repeating seuqences
rep_seq = "HEATLLFT"
c = Chain().create( rep_seq ) # start with new chain
new_chain = c.copy()
for i in range(5):
c.fuse( new_chain.copy() )
c.write("rep_pep.pdb")
print(c.sequence())
helical_residues = c.fetch_residues(["HIS","GLU","ALA","THR","LEU"])
for resi in helical_residues:
resi.set_phi( -57, True )
resi.set_psi( -47, True )
c.write("repeat_helix.pdb")
# building a DNA strand
model = build_dna_strand("ACGTGTCA")
model.write("dna.pdb")