|
| 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 | + |
0 commit comments