-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphipsi.c
63 lines (46 loc) · 1.39 KB
/
phipsi.c
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
53
54
55
56
57
58
59
60
61
62
63
#include "stride.h"
void BackboneAngles(CHAIN **Chain, int NChain)
{
register int Res, Cn;
for( Cn=0; Cn<NChain; Cn++ ) {
for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
PHI(Chain[Cn],Res);
PSI(Chain[Cn],Res);
}
}
}
void DiscrPhiPsi(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
register int i, Res, Cn;
RESIDUE *r;
for( Cn=0; Cn<NChain; Cn++ ) {
for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
r = Chain[Cn]->Rsd[Res];
r->Prop->PhiZn = ERR;
r->Prop->PsiZn = ERR;
if( Res != 0 ) {
for( i=0; i<Cmd->NPixel; i++ )
if( r->Prop->Phi > MINPHIPSI+(float)(i)*Cmd->PhiPsiStep &&
r->Prop->Phi <= MINPHIPSI+(float)(i+1)*Cmd->PhiPsiStep ) {
r->Prop->PhiZn = i;
break;
}
}
if( Res != Chain[Cn]->NRes-1 ) {
for( i=0; i<Cmd->NPixel; i++ )
if( r->Prop->Psi > MINPHIPSI+(float)(i)*Cmd->PhiPsiStep &&
r->Prop->Psi <= MINPHIPSI+(float)(i+1)*Cmd->PhiPsiStep ) {
r->Prop->PsiZn = i;
break;
}
}
}
for(Res=0; Res<Chain[Cn]->NRes; Res++ ) {
r = Chain[Cn]->Rsd[Res];
if( Res != 0 && r->Prop->PsiZn == ERR )
r->Prop->PsiZn = Chain[Cn]->Rsd[Res-1]->Prop->PsiZn;
if( Res != Chain[Cn]->NRes-1 && r->Prop->PhiZn == ERR )
r->Prop->PhiZn = Chain[Cn]->Rsd[Res+1]->Prop->PhiZn;
}
}
}