-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp_helix.c
50 lines (35 loc) · 1.18 KB
/
p_helix.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
#include "stride.h"
int Process_HELIX(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd)
{
int CC, HC;
char *Field[MAX_FIELD];
BUFFER Tmp;
if( Cmd->NActive && !ChInStr(Cmd->Active,SpaceToDash(Buffer[19])) )
return(SUCCESS);
for( CC=0; CC < *ChainNumber && Chain[CC]->Id != Buffer[19]; CC++ );
if( CC == *ChainNumber ) {
InitChain(&Chain[CC]);
Chain[CC]->Id = Buffer[19];
(*ChainNumber)++;
}
HC = Chain[CC]->NHelix;
Chain[CC]->Helix[HC] = (HELIX *)ckalloc(sizeof(HELIX));
SplitString(Buffer+15,Field,1);
strcpy(Chain[CC]->Helix[HC]->Res1,Field[0]);
SplitString(Buffer+27,Field,1);
strcpy(Chain[CC]->Helix[HC]->Res2,Field[0]);
strcpy(Tmp,Buffer);
Tmp[25] = ' ';
Tmp[37] = ' ';
SplitString(Tmp+21,Field,1);
strcpy(Chain[CC]->Helix[HC]->PDB_ResNumb1,Field[0]);
SplitString(Tmp+33,Field,1);
strcpy(Chain[CC]->Helix[HC]->PDB_ResNumb2,Field[0]);
Chain[CC]->Helix[HC]->InsCode1 = Buffer[25];
Chain[CC]->Helix[HC]->InsCode2 = Buffer[37];
Tmp[40] = ' ';
SplitString(Tmp+38,Field,1);
Chain[CC]->Helix[HC]->Class = atoi(Field[0]);
Chain[CC]->NHelix++;
return(SUCCESS);
}