[e40e335] | 1 | c **************************************************************
|
---|
| 2 | c
|
---|
| 3 | c This file contains the subroutines: contacts,c_alfa,c_cont
|
---|
| 4 | c
|
---|
| 5 | c Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,
|
---|
| 6 | c Shura Hayryan, Chin-Ku
|
---|
| 7 | c Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
|
---|
| 8 | c Jan H. Meinke, Sandipan Mohanty
|
---|
| 9 | c
|
---|
| 10 | c **************************************************************
|
---|
| 11 |
|
---|
| 12 | subroutine contacts(ncn,nham2,dham)
|
---|
| 13 |
|
---|
| 14 | c ..............................................................
|
---|
| 15 | c
|
---|
| 16 | c CALCULATES NUMBER OF CONTACTS IN GIVEN CONFORMATION, NUMBER OF
|
---|
| 17 | c CONTACTS WHICH ARE THE SAME IN GIVEN AND REFERENCE ONFORMATION,
|
---|
| 18 | c AND THE HAMMING DISTANCE BETWEEN GIVEN CONFORMATION AND THE
|
---|
| 19 | c REFERENCE CONFORMATIONa
|
---|
| 20 | c
|
---|
| 21 | c CALLS: c_cont
|
---|
| 22 | c ..............................................................
|
---|
| 23 |
|
---|
| 24 | include 'INCL.H'
|
---|
| 25 |
|
---|
| 26 | !f2py integer, intent(out) :: ncn, nham2
|
---|
| 27 | !f2py double precistion, intent(out) :: dham
|
---|
| 28 |
|
---|
| 29 | call c_cont(1,ncode)
|
---|
| 30 |
|
---|
| 31 | ncn=0
|
---|
| 32 | nham=0
|
---|
| 33 | nham2=0
|
---|
| 34 | nresi=irsml2(1)-irsml1(1)+1
|
---|
| 35 | do i=1,nresi
|
---|
| 36 | do j=nresi,i+3,-1
|
---|
| 37 |
|
---|
| 38 | if (ijcont(i,j).eq.1) then
|
---|
| 39 | ncn=ncn+1
|
---|
| 40 | if (iref(i,j).eq.1) nham2 = nham2+1
|
---|
| 41 | end if
|
---|
| 42 |
|
---|
| 43 | nham = nham + abs(ijcont(i,j)-iref(i,j))
|
---|
| 44 | end do
|
---|
| 45 | end do
|
---|
| 46 |
|
---|
| 47 | if (ncn.ne.0.and.nci.ne.0) then
|
---|
| 48 | dham = float(nham)/float(ncn)/float(nci)
|
---|
| 49 | else
|
---|
| 50 | dham = 1.0
|
---|
| 51 | end if
|
---|
| 52 |
|
---|
| 53 | return
|
---|
| 54 | end
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | c *********************************
|
---|
| 58 | subroutine c_alfa(nmol,ncode)
|
---|
| 59 |
|
---|
| 60 | c ......................................................
|
---|
| 61 | c Calculates the indices of C-alpha atoms and
|
---|
| 62 | c stores in the array ind_alf(mxrs)
|
---|
| 63 | c
|
---|
| 64 | c Usage: call c_alfa(nmol,ncode)
|
---|
| 65 | c
|
---|
| 66 | c nmol - index of the molecule
|
---|
| 67 | c ncode ---> not in use in the current version
|
---|
| 68 | c
|
---|
| 69 | c OUTPUT: ind_alf(mxrs)
|
---|
| 70 | c
|
---|
| 71 | c CALLS: none
|
---|
| 72 | c ......................................................
|
---|
| 73 |
|
---|
| 74 | include 'INCL.H'
|
---|
| 75 |
|
---|
| 76 | do n_res=irsml1(nmol),irsml2(nmol) ! Over res.
|
---|
| 77 | do ia=iatrs1(n_res),iatrs2(n_res) ! Over the atoms of res.
|
---|
| 78 |
|
---|
| 79 | c Check for C_alpha atoms
|
---|
| 80 |
|
---|
| 81 | if (nmat(ia)(1:2).eq.'ca') then
|
---|
| 82 | ind_alf(n_res)=ia
|
---|
| 83 | endif
|
---|
| 84 |
|
---|
| 85 | enddo ! Over the atoms of res.
|
---|
| 86 | enddo ! Over the res.
|
---|
| 87 |
|
---|
| 88 | return
|
---|
| 89 | end
|
---|
| 90 |
|
---|
| 91 | c **********************************
|
---|
| 92 | subroutine c_cont (nmol,ncode)
|
---|
| 93 |
|
---|
| 94 | c..............................................................
|
---|
| 95 | c Calculates the matrix of contacts between aminoacid residues
|
---|
| 96 | c of the molecule "nmol" according to L.Mirny and E.Domany,
|
---|
| 97 | c PROTEINS:Structure, Function, and Genetics 26:391-410 (1996)
|
---|
| 98 | c
|
---|
| 99 | c Two residues are in contact if their C_alpha atoms are
|
---|
| 100 | c closer than 8.5 Angstrem
|
---|
| 101 | c
|
---|
| 102 | c Usage: call c_cont(nmol,ncode)
|
---|
| 103 | c
|
---|
| 104 | c Where nmol is the index of the molecule (always 1, in the
|
---|
| 105 | c current version of SMM)
|
---|
| 106 | c ncode ---> not in use in the current version
|
---|
| 107 | c
|
---|
| 108 | c IMPORTANT: Before the first call of this subroutine "c_alfa"
|
---|
| 109 | c must be called to calculate the inices of C_alpha atoms.
|
---|
| 110 | c (ONLY ONCE)
|
---|
| 111 | c
|
---|
| 112 | c OUTPUT: The output of this routine is the contact matrix
|
---|
| 113 | c ijcont(mxrs,mxrs)
|
---|
| 114 | c
|
---|
| 115 | c ijcont(i,j)=0---> residues i and j are not in contact
|
---|
| 116 | c ijcont(i,j)=1---> ---------''----- are in contact
|
---|
| 117 | c ijcont(i,j)=2---> residues i and j are adjacent
|
---|
| 118 | c
|
---|
| 119 | c NOTE: Adjacent residues are always in contact (and therefore not
|
---|
| 120 | c counted)
|
---|
| 121 | c
|
---|
| 122 | c Here "mxrs" is the maximum number of residues for SMM
|
---|
| 123 | c Obviously, this subroutine calculates only NxN part
|
---|
| 124 | c of that matrix, N -is the number of res. in "nmol"
|
---|
| 125 | c
|
---|
| 126 | c CALLS: none
|
---|
| 127 | c..............................................................
|
---|
| 128 |
|
---|
| 129 | include 'INCL.H'
|
---|
| 130 |
|
---|
| 131 | rcut=8.5 ! Domany
|
---|
| 132 |
|
---|
| 133 |
|
---|
| 134 | do nr_i=irsml1(nmol),irsml2(nmol) ! Over res. i
|
---|
| 135 |
|
---|
| 136 | ijcont(nr_i,nr_i)=2
|
---|
| 137 | if(nr_i+1.le.irsml2(nmol)) then
|
---|
| 138 | ijcont(nr_i,nr_i+1)=2
|
---|
| 139 | ijcont(nr_i+1,nr_i)=2
|
---|
| 140 | if(nr_i+2.le.irsml2(nmol)) then
|
---|
| 141 | ijcont(nr_i,nr_i+2)=2
|
---|
| 142 | ijcont(nr_i+2,nr_i)=2
|
---|
| 143 | end if
|
---|
| 144 | end if
|
---|
| 145 |
|
---|
| 146 | do nr_j=nr_i+3,irsml2(nmol) ! Over res. j
|
---|
| 147 |
|
---|
| 148 | c write(*,'(2i3)'),nr_i,nr_j
|
---|
| 149 |
|
---|
| 150 | ic=0
|
---|
| 151 |
|
---|
| 152 | ialf=ind_alf(nr_i)
|
---|
| 153 | jalf=ind_alf(nr_j)
|
---|
| 154 |
|
---|
| 155 | rij2=(xat(ialf)-xat(jalf))**2
|
---|
| 156 | # +(yat(ialf)-yat(jalf))**2
|
---|
| 157 | # + (zat(ialf)-zat(jalf))**2
|
---|
| 158 | if(sqrt(rij2).lt.rcut) ic=1
|
---|
| 159 |
|
---|
| 160 | c write(*,'(2i3)'),nr_i,nr_j
|
---|
| 161 |
|
---|
| 162 | ijcont(nr_i,nr_j)=ic
|
---|
| 163 | ijcont(nr_j,nr_i)=ic ! The matrix is symmetrical
|
---|
| 164 |
|
---|
| 165 | end do ! Over res. j
|
---|
| 166 | end do ! Over res. i
|
---|
| 167 |
|
---|
| 168 | return
|
---|
| 169 | end
|
---|
| 170 |
|
---|