Skip to content

Commit 84d1d39

Browse files
committed
added printing of link status to link PDB files
1 parent 276b4c0 commit 84d1d39

File tree

3 files changed

+148
-12
lines changed

3 files changed

+148
-12
lines changed

src/printdata.f90

+25-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ subroutine printdata(print,link)
1212
character(len=1) :: ra1, ra2, aa1, aa2
1313
character(len=3) :: charobs
1414
character(len=9) :: charmax, chardist
15-
character(len=13) :: charresult
15+
character(len=13) :: statuschar
1616
character(len=800) :: lineformat
1717

1818
! Print title
@@ -89,16 +89,6 @@ subroutine printdata(print,link)
8989
end if
9090
end if
9191

92-
if ( link%status == 0 ) charresult =" OK: FOUND"
93-
if ( link%status == 1 ) charresult =" BAD: SHORT"
94-
if ( link%status == 2 ) charresult =" BAD: LONG"
95-
if ( link%status == 3 ) charresult =" BAD: EUCL"
96-
if ( link%status == 4 ) charresult ="BAD: NOTFOUND"
97-
if ( link%status == 5 ) charresult =" BAD: MISSING"
98-
if ( link%status == 6 ) charresult =" OK: LONG"
99-
if ( link%status == 7 ) charresult =" OK: EUCL"
100-
if ( link%status == 8 ) charresult =" OK: NOTFOUND"
101-
10292
ra1 = "Y" ; if ( .not. link%atom1%residue%accessible ) ra1 = "N"
10393
ra2 = "Y" ; if ( .not. link%atom2%residue%accessible ) ra2 = "N"
10494
aa1 = "Y" ; if ( .not. link%atom1%accessible ) aa1 = "N"
@@ -109,12 +99,35 @@ subroutine printdata(print,link)
10999
link%atom2%residue%name, link%atom2%residue%chain, &
110100
link%atom2%residue%index, link%atom2%name, &
111101
link%euclidean, chardist, charobs, &
112-
link%dmin, charmax, charresult, &
102+
link%dmin, charmax, statuschar(link%status), &
113103
link%n_obs_consistent, link%n_obs_expected, &
114104
link%n_type_consistent, link%n_type_expected, &
115105
ra1, ra2, aa1, aa2
116106

117107
end subroutine printdata
118108

109+
function statuschar(status)
110+
111+
implicit none
112+
integer :: status
113+
character(len=13) :: statuschar
114+
115+
if ( status == 0 ) statuschar =" OK: FOUND"
116+
if ( status == 1 ) statuschar =" BAD: SHORT"
117+
if ( status == 2 ) statuschar =" BAD: LONG"
118+
if ( status == 3 ) statuschar =" BAD: EUCL"
119+
if ( status == 4 ) statuschar ="BAD: NOTFOUND"
120+
if ( status == 5 ) statuschar =" BAD: MISSING"
121+
if ( status == 6 ) statuschar =" OK: LONG"
122+
if ( status == 7 ) statuschar =" OK: EUCL"
123+
if ( status == 8 ) statuschar =" OK: NOTFOUND"
124+
125+
end function statuschar
126+
127+
128+
129+
130+
131+
119132

120133

src/statuschar.f90

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
!
2+
! Subroutine that prints the output data of each link search
3+
!
4+
5+
subroutine printdata(print,link)
6+
7+
use ioformat
8+
use topolink_data
9+
implicit none
10+
integer :: print, ib
11+
type(specific_link) :: link
12+
character(len=1) :: ra1, ra2, aa1, aa2
13+
character(len=3) :: charobs
14+
character(len=9) :: charmax, chardist
15+
character(len=13) :: charresult
16+
character(len=800) :: lineformat
17+
18+
! Print title
19+
20+
if ( print == -1 ) then
21+
write(*,dashes)
22+
write(*,"( ' RESIDUE1 ATOM1 RESIDUE2 ATOM2 EUCLDIST TOPODIST OBSERVED&
23+
& DMIN DMAX RESULT OBSRES REACRES RA AA')")
24+
write(*,dashes)
25+
return
26+
end if
27+
28+
! Output line format for each link
29+
! -------------------------------------------------------------------------------------------------------------------------
30+
! RESIDUE1 ATOM1 RESIDUE2 ATOM2 EUCLDIST TOPODIST OBSERVED DMIN DMAX RESULT OBSRES REACRES RA AA
31+
! LINK: LYSX A 1000 XXCB LYSX A 1008 XXCB 0014.000 >0013.756 YES 0000.000 >0034.000 NOTFOUND GOOD 00/00 11/11 YN YN
32+
33+
lineformat = "( t3,"//&
34+
&"'LINK:',"//& ! LINK:
35+
&"t9,a4,"//& ! LYS
36+
&"t14,a1,"//& ! A
37+
&"t16,i4,"//& ! 6
38+
&"t21,a4,"//& ! CB
39+
&"t26,a4,"//& ! LYS
40+
&"t31,a1,"//& ! A
41+
&"t33,i4,"//& ! 8
42+
&"t38,a4,"//& ! CB
43+
&"t43,f8.3,"//& ! 14.000
44+
&"t52,a9,"//& ! 13.756
45+
&"t64,a3,"//& ! YES
46+
&"t70,f8.3,"//& ! 0.000
47+
&"t79,a9,"//& ! 34.000
48+
&"t89,a13,"//& ! FOUND GOOD
49+
&"t105,i2,'/',i2,"//& ! 00/00
50+
&"t113,i2,'/',i2,"//& ! 11/11
51+
&"t119,a1,a1,"//& ! YN
52+
&"t122,a1,a1,"//& ! YN
53+
&")"
54+
55+
if ( link%observed ) then
56+
charobs = 'YES'
57+
write(charmax,"( f9.3 )") link%dmax
58+
ib = 9 - len(trim(adjustl(charmax)))
59+
charmax(ib:ib) = " "
60+
else
61+
charobs = 'NO'
62+
write(charmax,"( f9.3 )") link%dmin
63+
ib = 9 - len(trim(adjustl(charmax)))
64+
charmax(ib:ib) = ">"
65+
end if
66+
67+
! If a topological distance was found, print it
68+
69+
if ( link%status == 0 .or. &
70+
link%status == 1 .or. &
71+
link%status == 2 .or. &
72+
link%status == 5 .or. &
73+
link%status == 6 ) then
74+
write(chardist,"( f9.3 )") link%topodist
75+
ib = 9 - len(trim(adjustl(chardist)))
76+
chardist(ib:ib) = " "
77+
78+
! Otherwise, report that it is greater than dmaxlink
79+
80+
else
81+
if ( link%observed ) then
82+
write(chardist,"( f9.3 )") link%dmax
83+
ib = 9 - len(trim(adjustl(chardist)))
84+
chardist(ib:ib) = ">"
85+
else
86+
write(chardist,"( f9.3 )") link%dmin
87+
ib = 9 - len(trim(adjustl(chardist)))
88+
chardist(ib:ib) = ">"
89+
end if
90+
end if
91+
92+
if ( link%status == 0 ) charresult =" OK: FOUND"
93+
if ( link%status == 1 ) charresult =" BAD: SHORT"
94+
if ( link%status == 2 ) charresult =" BAD: LONG"
95+
if ( link%status == 3 ) charresult =" BAD: EUCL"
96+
if ( link%status == 4 ) charresult ="BAD: NOTFOUND"
97+
if ( link%status == 5 ) charresult =" BAD: MISSING"
98+
if ( link%status == 6 ) charresult =" OK: LONG"
99+
if ( link%status == 7 ) charresult =" OK: EUCL"
100+
if ( link%status == 8 ) charresult =" OK: NOTFOUND"
101+
102+
ra1 = "Y" ; if ( .not. link%atom1%residue%accessible ) ra1 = "N"
103+
ra2 = "Y" ; if ( .not. link%atom2%residue%accessible ) ra2 = "N"
104+
aa1 = "Y" ; if ( .not. link%atom1%accessible ) aa1 = "N"
105+
aa2 = "Y" ; if ( .not. link%atom2%accessible ) aa2 = "N"
106+
107+
write(*,lineformat) link%atom1%residue%name, link%atom1%residue%chain, &
108+
link%atom1%residue%index, link%atom1%name, &
109+
link%atom2%residue%name, link%atom2%residue%chain, &
110+
link%atom2%residue%index, link%atom2%name, &
111+
link%euclidean, chardist, charobs, &
112+
link%dmin, charmax, charresult, &
113+
link%n_obs_consistent, link%n_obs_expected, &
114+
link%n_type_consistent, link%n_type_expected, &
115+
ra1, ra2, aa1, aa2
116+
117+
end subroutine printdata
118+
119+
120+
121+

src/topolink.f90

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ program topolink
3535
character(len=200) :: record, linkfile, inputfile, endread
3636
character(len=200), allocatable :: logline(:)
3737
character(len=20) :: floatout, intout, intout2
38+
character(len=13) :: statuschar
3839
logical :: error, r1, r2, inexp, warning, interchain, isprotein
3940

4041
external :: computef, computeg
@@ -1355,6 +1356,7 @@ program topolink
13551356
stop
13561357
end if
13571358
write(10,"( 'REMARK F: ', 3(tr2,f12.5) )") f, overlap(n,x), stretch(n,x)
1359+
write(10,"( 'REMARK LINK STATUS: ', a13 )") statuschar(link(i)%status)
13581360
writeatom = atom(atom1)
13591361
writeatom%residue%name = "LINK"
13601362
writeatom%residue%chain = "A"

0 commit comments

Comments
 (0)