@@ -10,8 +10,8 @@ subroutine link_to_pdb(link,nlinkatoms,linkdir,pdbfile,natoms,atom,n,x)
10
10
implicit none
11
11
12
12
integer :: ioerr
13
- integer :: j, ix, iy, iz
14
- integer :: natoms, nlinkatoms
13
+ integer :: j, ix, iy, iz, index
14
+ integer :: natoms, nlinkatoms, nsteps
15
15
16
16
type (specific_link) :: link
17
17
type (pdbatom) :: writeatom, atom(natoms)
@@ -20,7 +20,7 @@ subroutine link_to_pdb(link,nlinkatoms,linkdir,pdbfile,natoms,atom,n,x)
20
20
character (len= 4 ) :: char1, char2
21
21
22
22
integer :: n
23
- double precision :: x(n)
23
+ double precision :: x(n), stepx, stepy, stepz
24
24
double precision :: overlap, stretch
25
25
character (len= 13 ) :: statuschar
26
26
@@ -41,33 +41,57 @@ subroutine link_to_pdb(link,nlinkatoms,linkdir,pdbfile,natoms,atom,n,x)
41
41
stop
42
42
end if
43
43
write (11 ," ( 'REMARK EUCLIDEAN DISTANCE: ', (tr2,f12.5) )" ) link% euclidean
44
- write (11 ," ( 'REMARK TOPOLOGICAL DISTANCE: ', (tr2,f12.5) )" ) link% topodist
45
- write (11 ," ( 'REMARK OVERLAP and STRETCH: ', 2(tr2,f12.5) )" ) overlap(n,x), stretch(n,x)
46
44
write (11 ," ( 'REMARK LINK STATUS: ', a13 )" ) statuschar(link% status)
45
+ if ( link% found ) then
46
+ write (11 ," ( 'REMARK TOPOLOGICAL DISTANCE: ', (tr2,f12.5) )" ) link% topodist
47
+ write (11 ," ( 'REMARK OVERLAP and STRETCH: ', 2(tr2,f12.5) )" ) overlap(n,x), stretch(n,x)
48
+ end if
49
+ index = 1
47
50
writeatom = atom(link% atom1% index)
48
51
writeatom% residue% name = " LINK"
49
52
writeatom% residue% chain = " A"
50
53
writeatom% residue% index = 1
51
- writeatom% index = 1
54
+ writeatom% index = index
52
55
write (11 ," (a)" ) trim (print_pdbhetatm(writeatom))
53
- do j = 1 , nlinkatoms
54
- ix = (j-1 )* 3 + 1
55
- iy = ix + 1
56
- iz = ix + 2
57
- writeatom% index = j + 1
58
- writeatom% name = " O"
59
- writeatom% residue% name = " LINK"
60
- writeatom% residue% chain = " A"
61
- writeatom% residue% index = 1
62
- writeatom% x = x(ix)
63
- writeatom% y = x(iy)
64
- writeatom% z = x(iz)
65
- write (11 ," (a)" ) trim (print_pdbhetatm(writeatom))
66
- end do
56
+ if ( link% found ) then
57
+ do j = 1 , nlinkatoms
58
+ index = index + 1
59
+ ix = (j-1 )* 3 + 1
60
+ iy = ix + 1
61
+ iz = ix + 2
62
+ writeatom% index = index
63
+ writeatom% name = " N"
64
+ writeatom% residue% name = " LINK"
65
+ writeatom% residue% chain = " A"
66
+ writeatom% residue% index = 1
67
+ writeatom% x = x(ix)
68
+ writeatom% y = x(iy)
69
+ writeatom% z = x(iz)
70
+ write (11 ," (a)" ) trim (print_pdbhetatm(writeatom))
71
+ end do
72
+ else
73
+ nsteps = int (link% euclidean)- 2
74
+ stepx = (link% atom2% x - link% atom1% x)/ nsteps
75
+ stepy = (link% atom2% y - link% atom1% y)/ nsteps
76
+ stepz = (link% atom2% z - link% atom1% z)/ nsteps
77
+ do j = 1 , nsteps
78
+ index = index + 1
79
+ writeatom% index = index
80
+ writeatom% name = " O"
81
+ writeatom% residue% name = " LINK"
82
+ writeatom% residue% chain = " A"
83
+ writeatom% residue% index = 1
84
+ writeatom% x = link% atom1% x + j* stepx
85
+ writeatom% y = link% atom1% y + j* stepy
86
+ writeatom% z = link% atom1% z + j* stepz
87
+ write (11 ," (a)" ) trim (print_pdbhetatm(writeatom))
88
+ end do
89
+ end if
90
+ index = index + 1
67
91
writeatom = atom(link% atom2% index)
68
92
writeatom% residue% name = " LINK"
69
93
writeatom% residue% chain = " A"
70
- writeatom% residue% index = 1
94
+ writeatom% residue% index = index
71
95
writeatom% index = nlinkatoms + 2
72
96
write (11 ," (a)" ) trim (print_pdbhetatm(writeatom))
73
97
close (11 )
0 commit comments