initial commit

main
josch 11 years ago
commit 79d3138e97

@ -0,0 +1,17 @@
Whole PDB entry:
stride 1bed.brk -$ -k
Residue range:
stride 2gsq.brk -$ -k -x76 -y202
Single chain:
stride 1alv.brk -$ -k -ra
Residue range in a chain:
stride 1bmt.brk -$ -k -ra -x651 -y740

@ -0,0 +1,32 @@
#FLAGS = -lm -L/usr/pub/lib -lefence -o
#CC = cc -O2 -fullwarn -TENV:large_GOT
#CC = cc -g -Wall
CC = gcc -O2 # at least for SunOS
#CC = cc -g
#CC = cc -O2 -fullwarn
#CC = cc -O2
FLAGS = -lm -o
SOURCE = stride.c splitstr.c rdpdb.c initchn.c geometry.c thr2one.c one2thr.c filename.c tolostr.c strutil.c place_h.c hbenergy.c memory.c helix.c sheet.c rdmap.c phipsi.c command.c molscr.c die.c hydrbond.c mergepat.c fillasn.c escape.c p_jrnl.c p_rem.c p_atom.c p_helix.c p_sheet.c p_turn.c p_ssbond.c p_expdta.c p_model.c p_compnd.c report.c nsc.c area.c ssbond.c chk_res.c chk_atom.c turn.c pdbasn.c dssp.c outseq.c chkchain.c elem.c measure.c asngener.c p_endmdl.c stred.c contact_order.c contact_map.c
OBJECT = ${SOURCE:.c=.o}
BINDIR = .
.c.o:
$(CC) -c $< -o $@
stride : $(OBJECT)
$(CC) $(OBJECT) $(FLAGS) $(BINDIR)/stride${ARCH}
$(OBJECT) : stride.h protot.h
clean:
rm -f $(OBJECT)
show:
echo $(SOURCE)

@ -0,0 +1,68 @@
#include "stride.h"
void Area(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
double *Coord, *Radii, OverallArea, *AreaPerAtom, *p1, *p2;
int At, TotalAt=0, Cn, Res, DotsPerSphere=600;
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( Res=0; Res<Chain[Cn]->NRes; Res++ )
for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ )
if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) )
TotalAt ++;
}
Coord = (double *)ckalloc(3*TotalAt*sizeof(double));
Radii = (double *)ckalloc(TotalAt*sizeof(double));
p1 = Coord;
p2 = Radii;
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( Res=0; Res<Chain[Cn]->NRes; Res++ )
for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ )
if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) ) {
(*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][0];
(*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][1];
(*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][2];
(*p2++) = GetAtomRadius(Chain[Cn]->Rsd[Res]->AtomType[At])+1.4;
}
}
p1 = Coord;
p2 = Radii;
NSC(Coord,Radii,TotalAt,DotsPerSphere,FLAG_ATOM_AREA,&OverallArea,
&AreaPerAtom,NULL,NULL,NULL);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
Chain[Cn]->Rsd[Res]->Prop->Solv = 0.0;
for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ )
if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) ) {
Chain[Cn]->Rsd[Res]->Prop->Solv += (*AreaPerAtom++);
}
}
}
free(Coord);
free(Radii);
}

@ -0,0 +1,192 @@
#include "stride.h"
/*************************************************************************
** **
** Remove short stretches of secondary structure from the assignment **
** **
** INPUT: *Asn String with one letter secondary structure **
** assignment **
** Length Length of the string **
** SecStrType Type of the secondary structure to which this **
** operation should be applied **
** EditChar Character to be used instead of removed symbols **
** MaxLength Maximal length of secondary struture segments to **
** be removed **
** **
** OUTPUT: *Asn Edited secondary structure assignment **
** **
*************************************************************************/
void CorrectAsn(char *Asn, int Length, char SecStrType, char EditChar, int MaxLength)
{
int NStr = 0, Res, Flag = 0, Bound[MAX_ASSIGN][2], i;
for( Res=0; Res<Length; Res++ ) {
if( Asn[Res] == SecStrType && Flag == 0 ) {
Flag = 1;
Bound[NStr][0] = Res;
}
else
if( Asn[Res] != SecStrType && Flag == 1 ) {
Flag = 0;
Bound[NStr++][1] = Res-1;
}
}
for( i=0; i<NStr; i++ )
if( Bound[i][1]-Bound[i][0]+1 <= MaxLength )
for( Res=Bound[i][0]; Res<=Bound[i][1]; Res++ )
Asn[Res] = EditChar;
}
void CorrectAsnDouble(char *Asn1, char *Asn2, char *KnownAsn, int Length,
char SecStrType, char EditChar)
{
register int Res;
for( Res=0; Res<Length; Res++ )
if( (Asn1[Res] == SecStrType || Asn2[Res] == SecStrType) && KnownAsn[Res] != SecStrType &&
( (Res == 0 && Asn1[Res+1] != SecStrType && Asn2[Res+1] != SecStrType) ||
(Res == Length-1 && Asn1[Res-1] != SecStrType && Asn2[Res-1] != SecStrType) ||
(Res > 0 && Res < Length-1 &&
Asn1[Res-1] != SecStrType && Asn2[Res-1] != SecStrType &&
Asn1[Res+1] != SecStrType && Asn2[Res+1] != SecStrType) ) )
Asn1[Res] = Asn2[Res] = EditChar;
}
/*************************************************************************
** **
** Calculate the number of true positives, true negatives, false **
** negatives and false positives resulting from comparison of test and **
** known secondary structure assignments for a particular secondary **
** structure type **
** **
** INPUT: *TestAsn String with one letter test secondary structure **
** assignment **
** *KnownAsn String with one letter known secondary structure **
** assignment **
** Length Length of the assignment **
** SecStrType Type of the secondary structure to which this **
** operation should be applied **
** **
** OUTPUT: *Quality Pointer to the structure with quality assessment **
** **
*************************************************************************/
int Difference(char *TestAsn, char *KnownAsn, int Length, char SecStrType, QUALITY *Qual)
{
register int Res;
Qual->TP = Qual->TN = Qual->FP = Qual->FN = 0;
for( Res=0; Res<Length; Res++ ) {
if( KnownAsn[Res] != 'X' ) {
if( KnownAsn[Res] == SecStrType && TestAsn[Res] == SecStrType ) Qual->TP++;
else
if( KnownAsn[Res] != SecStrType && TestAsn[Res] != SecStrType ) Qual->TN++;
else
if( KnownAsn[Res] != SecStrType && TestAsn[Res] == SecStrType ) Qual->FP++;
else
if( KnownAsn[Res] == SecStrType && TestAsn[Res] != SecStrType ) Qual->FN++;
}
}
if( Qual->TP == 0 && Qual->TN == 0 && Qual->FP == 0 && Qual->FN == 0 ) {
Qual->Perc = 0.0;
return(FAILURE);
}
Qual->Perc =
((float)Qual->TP+(float)Qual->TN)/
((float)Qual->TP+(float)Qual->TN+(float)Qual->FP+(float)Qual->FN);
return(SUCCESS);
}
/*************************************************************************
** **
** Calculate percent of the correctly assigned residues **
** **
** INPUT: *TestAsn String with one letter test secondary structure **
** assignment **
** *KnownAsn String with one letter known secondary structure **
** assignment **
** Length Length of the assignment **
** **
** RETURNS: Percent correct **
** **
*************************************************************************/
float PercentCorrect(char *TestAsn, char *KnownAsn, int Length)
{
int Res, Count=0;;
for( Res=0; Res<Length; Res++ )
if( KnownAsn[Res] == TestAsn[Res] )
Count++;
return( ((float)Count/(float)Length) );
}
/*************************************************************************
** **
** Calculate measures of secondary structure assignment quality based **
** on the number of true positives, true negatives, false negatives and **
** false positives resulting from comparison of test and known **
** assignments **
** **
** INPUT: *Quality Pointer to the structure with quality assessment **
** assignment **
** OUTPUT: Quality->Corr Correlation coefficient between the two **
** assignments as suggested by B.Matthews **
** (1975) Biochim. Biophys. Acta, 405, 442-451 **
** Quality->Perc Percent correct **
** **
*************************************************************************/
int AssessCorr(QUALITY *Qual)
{
float TP, TN, FP, FN;
if( (Qual->TP == 0 && Qual->FN == 0) || (Qual->TP == 0 && Qual->FP == 0) ) return(FAILURE);
else {
TP = (float)Qual->TP;
TN = (float)Qual->TN;
FP = (float)Qual->FP;
FN =(float)Qual->FN;
Qual->Corr = (TP*TN - FN*FP)/sqrt((TN+FN)*(TN+FP)*(TP+FN)*(TP+FP));
return(SUCCESS);
}
}
int AssessPerc(QUALITY *Qual)
{
float TP, TN, FP, FN;
TP = (float)Qual->TP;
TN = (float)Qual->TN;
FP = (float)Qual->FP;
FN =(float)Qual->FN;
Qual->Perc = (TP+TN)/(TP+TN+FP+FN);
return(SUCCESS);
}
void ExcludeObvious(char *Asn1, char *Asn2, char *KnownAsn, int Length)
{
register int i;
for( i=0; i<Length; i++ )
if( Asn1[i] == Asn2[i] ) {
KnownAsn[i] = 'X';
Asn1[i] = 'X';
Asn2[i] = 'X';
}
}

@ -0,0 +1,24 @@
#include "stride.h"
int CheckAtom(char *At)
{
int AtomTypeCnt, AtomTypeNumber = 95;
static char *Atom[MAX_AtomType] = {
"AD1", "AD2", "AE1", "AE2", "C", "CA", "CB", "CD", "CD1", "CD2", "CE", "CE1", "CE2",
"CE3", "CG", "CG1", "CG2", "CH2", "CH3", "CZ", "CZ2", "CZ3", "HG", "HG1", "HH", "HH2",
"HZ", "HZ2", "HZ3", "N", "ND1", "ND2", "NE", "NE1", "NE2", "NH1", "NH2", "NZ", "O",
"OD1", "OD2", "OE", "OE1", "OE2", "OG", "OG1", "OH", "OXT", "SD", "SG", "H", "HA", "HB",
"HD1", "HD2", "HE", "HE1", "HE2", "HE3", "1H", "1HA", "1HB", "1HD", "1HD1", "1HD2",
"1HE", "1HE2", "1HG", "1HG1", "1HG2", "1HH1", "1HH2", "1HZ", "2H", "2HA", "2HB", "2HD",
"2HD1", "2HD2", "2HE", "2HE2", "2HG", "2HG1", "2HG2", "2HH1", "2HH2", "2HZ", "3H", "3HB",
"3HD1", "3HD2", "3HE", "3HG1", "3HG2", "3HZ"
};
for( AtomTypeCnt=0; AtomTypeCnt<AtomTypeNumber; AtomTypeCnt++ )
if( !strcmp(At,Atom[AtomTypeCnt]) )
return(SUCCESS);
return(FAILURE);
}

@ -0,0 +1,23 @@
#include "stride.h"
int CheckRes(char *Res)
{
register int ResTypeCnt;
int ResTypeNumber = 45;
static char *Rsd[MAX_ResType] = {
"ACE", "ALA", "ARG", "ASN", "ASP", "ASX", "CYS", "GLN", "GLU", "GLX", "GLY", "HIS", "ILE",
"LEU", "LYS", "MET", "PRO", "PHE", "SER", "THR", "TRP", "TYR", "VAL", "FOR", "UNK", "HOH",
/* Residues found empirically in the protein files */
/* 1gp1 1gp1 1hne 1tmn 2mcg 5hvp 6cha 1bbo 1ctg act1 act1 aom1 rom7 */
"SEC", "ALM", "MSU", "CLT", "PCA", "STA", "EXC", "ABU", "HYP", "HMS", "ASS", "OCT", "CYH",
/* sod0 7adh 2psg tim1 tim2 2pia */
"MN", "INI", "PO3", "SUL", "WAT", "FMN"
};
for( ResTypeCnt=0; ResTypeCnt<ResTypeNumber; ResTypeCnt++ )
if( !strcmp(Res,Rsd[ResTypeCnt]) )
return(SUCCESS);
return(FAILURE);
}

@ -0,0 +1,189 @@
#include "stride.h"
int CheckChain(CHAIN *Chain, COMMAND *Cmd)
{
int Res, HelAlp, HelPI, Hel310, Sheet, Turn, Bound[300][2];
int i, j, AsnNumb=0, At, SuspCnt, Beg, End;
float Content;
if( Cmd->NProcessed && !ChInStr(Cmd->Processed,SpaceToDash(Chain->Id)) ) {
Chain->Valid = NO;
return(FAILURE);
}
if( Chain->NRes < 5 )
return(NotValid(Chain,"less than 5 residues"));
if( !Cmd->Stringent )
return(SUCCESS);
for( Res=0; Res<Chain->NRes; Res++ ){
if( !CheckRes(Chain->Rsd[Res]->ResType) )
Chain->NonStandRes++;
for( At=0; At<Chain->Rsd[Res]->NAtom; At++) {
if( !CheckAtom(Chain->Rsd[Res]->AtomType[At]) )
Chain->NonStandAtom++;
if(Chain->Rsd[Res]->Coord[At][0] < MIN_X || Chain->Rsd[Res]->Coord[At][0] > MAX_X ||
Chain->Rsd[Res]->Coord[At][1] < MIN_Y || Chain->Rsd[Res]->Coord[At][1] > MAX_Y ||
Chain->Rsd[Res]->Coord[At][2] < MIN_Z || Chain->Rsd[Res]->Coord[At][2] > MAX_Z ||
Chain->Rsd[Res]->Occupancy[At] < MIN_Occupancy ||
Chain->Rsd[Res]->Occupancy[At] > MAX_Occupancy ||
Chain->Rsd[Res]->TempFactor[At] < MIN_TempFactor ||
Chain->Rsd[Res]->TempFactor[At] > MAX_TempFactor )
break;
}
if( At < Chain->Rsd[Res]->NAtom )
break;
}
if( Res < Chain->NRes )
return(NotValid(Chain,"suspicious coordinates, occupancy or temperature factor"));
if( 100.0*(float)Chain->NonStandRes/(float)Chain->NRes > MAXNONSTAND )
return(NotValid(Chain,"too many non-standard residues"));
if( Chain->NRes < Cmd->MinLength )
return(NotValid(Chain,"Short chain"));
if( Chain->NRes > Cmd->MaxLength )
return(NotValid(Chain,"Long chain"));
if( Chain->Method == XRay &&
(Chain->Resolution < Cmd->MinResolution || Chain->Resolution > Cmd->MaxResolution ) )
return(NotValid(Chain,"Resolution out of range"));
if( (int)strlen(Cmd->Cond) != 0 ) {
if( ChInStr(Cmd->Cond,'c') ) {
for( Res=0; Res<Chain->NRes; Res++ )
if( FindAtom(Chain,Res,"N",&At) ||
FindAtom(Chain,Res,"O",&At) ||
FindAtom(Chain,Res,"C",&At) )
break;
if( Res == Chain->NRes )
return(NotValid(Chain,"only CA"));
}
if( Chain->Method == NMR && !ChInStr(Cmd->Cond,'n') )
return(NotValid(Chain,"NMR chain"));
if( Chain->Method == XRay && !ChInStr(Cmd->Cond,'x') )
return(NotValid(Chain,"XRay chain"));
if( Chain->Method == Model && !ChInStr(Cmd->Cond,'m') )
return(NotValid(Chain,"Model chain"));
if( Chain->Published == NO && ChInStr(Cmd->Cond,'p') )
return(NotValid(Chain,"Not published"));
if( Chain->DsspAssigned == YES && ChInStr(Cmd->Cond,'d') )
return(NotValid(Chain,"Assigned according to DSSP"));
if( ChInStr(Cmd->Cond,'a') ) {
if( Chain->Valid && Chain->NHelix == 0 && Chain->NSheet == -1 && Chain->NTurn == 0 )
return(NotValid(Chain,"No assignment"));
if( (Content = SecStrContent(Chain,&HelAlp,&HelPI,&Hel310,&Sheet,&Turn)) < 0.4 ||
Content > 0.9 )
return(NotValid(Chain,"Suspicious content"));
SuspCnt = 0;
for( Res=1; Res<Chain->NRes-1; Res++ ) {
if( ( Chain->Rsd[Res]->Prop->PdbAsn != 'H' && Chain->Rsd[Res]->Prop->PdbAsn != 'T' &&
Chain->Rsd[Res]->Prop->Phi > -150.0 && Chain->Rsd[Res]->Prop->Phi < 0.0 &&
Chain->Rsd[Res]->Prop->Psi > -100.0 && Chain->Rsd[Res]->Prop->Psi < 10.0) )
SuspCnt++;
}
if( (float)SuspCnt/(float)Chain->NRes > 0.4 )
return(NotValid(Chain,"Suspicious assignment"));
for( i=0; i<Chain->NHelix; i++ ) {
if( !PdbN2SeqN(Chain,Chain->Helix[i]->PDB_ResNumb1,&Beg) ||
!PdbN2SeqN(Chain,Chain->Helix[i]->PDB_ResNumb2,&End) ||
/* !CheckRes(Chain->Helix[i]->PDB_ResNumb1) ||
!CheckRes(Chain->Helix[i]->PDB_ResNumb2) || */
Chain->Helix[i]->Class > 10 ||
Chain->Helix[i]->Class < 1 ||
End-Beg > 100 || End-Beg < 0 )
break;
else
if( Chain->Helix[i]->Class == 1 ) {
Bound[AsnNumb][0] = Beg;
Bound[AsnNumb][1] = End;
AsnNumb++;
}
}
if( i < Chain->NHelix )
return(NotValid(Chain,"Erraneous helix assignment"));
for( i=0; i<Chain->NSheet; i++ )
for( j=0; j<Chain->Sheet[i]->NStrand; j++ ) {
if( !PdbN2SeqN(Chain,Chain->Sheet[i]->PDB_ResNumb1[j],&Beg) ||
!PdbN2SeqN(Chain,Chain->Sheet[i]->PDB_ResNumb2[j],&End) ||
/* !CheckRes(Chain->Sheet[i]->PDB_ResNumb1[j]) ||
!CheckRes(Chain->Sheet[i]->PDB_ResNumb2[j]) || */
End-Beg > 100 || End-Beg < 0 )
break;
else
if( Chain->Sheet[i]->Sence[j] != 0 ) {
Bound[AsnNumb][0] = Beg;
Bound[AsnNumb][1] = End;
AsnNumb++;
}
if( j < Chain->Sheet[i]->NStrand )
break;
}
if( i < Chain->NSheet )
return(NotValid(Chain,"Erraneous sheet assignment"));
for( i=0; i<Chain->NTurn; i++ )
if( !PdbN2SeqN(Chain,Chain->Turn[i]->PDB_ResNumb1,&Beg) ||
!PdbN2SeqN(Chain,Chain->Turn[i]->PDB_ResNumb2,&End) ||
End-Beg > 100 || End-Beg < 0 )
break;
if( i < Chain->NTurn )
NotValid(Chain,"Erraneous turn assignment");
for( i=0; i<AsnNumb-1; i++ ) {
for( j=i+1; j<AsnNumb; j++ ) {
if( Bound[i][0] == Bound[j][0] && Bound[i][1] == Bound[j][1] ) continue;
if( (Bound[j][0] > Bound[i][0] && Bound[j][0] < Bound[i][1]) ||
(Bound[j][1] > Bound[i][0] && Bound[j][1] < Bound[i][1]) ||
(Bound[i][0] > Bound[j][0] && Bound[i][0] < Bound[j][1]) ||
(Bound[i][1] > Bound[j][0] && Bound[i][1] < Bound[j][1]) )
break;
}
if( j < AsnNumb )
break;
}
if( i < AsnNumb-1 )
return(NotValid(Chain,"Assignment overlap"));
}
}
fprintf(stderr,"ACCEPTED %s %c %4d %7.3f\n",
Chain->File,Chain->Id,Chain->NRes,Chain->Resolution);
return(SUCCESS);
}
int NotValid(CHAIN *Chain, char *Message)
{
fprintf(stderr,"IGNORED %s %c ",Chain->File,SpaceToDash(Chain->Id));
fprintf(stderr,"(%s)\n",Message);
Chain->Valid = NO;
return(FAILURE);
}

@ -0,0 +1,68 @@
#include "stride.h"
FILE *efopen(char *file, char *mode, char *progname) /* fopen file, die if can't */
{
FILE *fp;
if( (fp=fopen(file,mode)) )
return fp;
else
die("%s: can't open file %s mode %s\n",progname,file,mode);
return(FAILURE);
}
int Uniq(char **List, int ListLength)
{
int i, j;
for( i=1; i<ListLength-1; i++ ) {
if( *List[i] != '-' ) continue;
for( j=i+1; j<ListLength; j++ ) {
if( *List[j] != '-' ) continue;
if( !strcmp(List[i],List[j] ) ) return(0);
}
}
return(1);
}
BOOLEAN Specified(char **List, int ListLength, char Option)
{
int i;
for( i=1; i<ListLength; i++ )
if( *List[i] == '-' && *(List[i]+1) == Option )
return(YES);
return(NO);
}
int Parse(char **List, int ListLength, char *Option)
{
int i;
for( i=1; i<ListLength; i++ ) {
if( *List[i] != '-' ) continue;
if( !strcmp(List[i],Option) ) return(i);
}
return(0);
}
int CollectOptions(char **List, int ListLength, int Stream, int *Options)
{
int OptCnt, i;
OptCnt = 0;
for( i=1; i<ListLength; i++ )
if( *List[i] == '-' && !isdigit( *(List[i]+1) ) && atoi( List[i]+2 ) == Stream )
Options[OptCnt++] = i;
return(OptCnt);
}

@ -0,0 +1,41 @@
#include "stride.h"
void ContactMap(CHAIN **Chain, int NChain, COMMAND *Cmd )
{
register int Res1, Res2;
int Cn1, Cn2, CA1, CA2;
float D;
for( Cn1=0; Cn1<NChain; Cn1++ ) {
if( !Chain[Cn1]->Valid )
continue;
for( Cn2=0; Cn2<NChain; Cn2++ ) {
if( !Chain[Cn2]->Valid )
continue;
for( Res1=0; Res1<Chain[Cn1]->NRes; Res1++ ) {
if( !FindAtom(Chain[Cn1],Res1,"CA",&CA1) )
continue;
for( Res2=0; Res2<Chain[Cn2]->NRes; Res2++ ) {
if( !FindAtom(Chain[Cn2],Res2,"CA",&CA2) )
continue;
D = Dist(Chain[Cn1]->Rsd[Res1]->Coord[CA1],
Chain[Cn2]->Rsd[Res2]->Coord[CA2]);
printf("%c %d <-> %c %d : %7.3f\n",
SpaceToDash(Chain[Cn1]->Id),Res1,
SpaceToDash(Chain[Cn2]->Id),Res2,D);
}
}
}
}
exit(0);
}

@ -0,0 +1,66 @@
#include "stride.h"
#define CO_DIST 6.0
void ContactOrder(CHAIN **Chain, int NChain, COMMAND *Cmd )
{
register int Res1, Res2, At1, At2;
int Cn, From, To, NumberOfContacts;
char PDB_Start[RES_FIELD], PDB_End[RES_FIELD];
double CO;
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
NumberOfContacts = 0;
CO = 0.0;
if( !strcmp(Cmd->FirstResidue,"") ) {
From = 0;
strcpy(PDB_Start,Chain[Cn]->Rsd[0]->PDB_ResNumb);
}
else {
if( !PdbN2SeqN(Chain[Cn],Cmd->FirstResidue,&From) ) {
fprintf(stderr,"Residue %s does not exist in %s chain %c\n",
Cmd->FirstResidue,Chain[Cn]->PdbIdent,SpaceToDash(Chain[Cn]->Id));
exit(1);
}
strcpy(PDB_Start,Cmd->FirstResidue);
}
if( !strcmp(Cmd->LastResidue,"") ) {
To = Chain[Cn]->NRes;
strcpy(PDB_End,Chain[Cn]->Rsd[Chain[Cn]->NRes-1]->PDB_ResNumb);
}
else {
if( !PdbN2SeqN(Chain[Cn],Cmd->LastResidue,&To) ) {
fprintf(stderr,"Residue %s does not exist in %s chain %c\n",
Cmd->LastResidue,Chain[Cn]->PdbIdent,SpaceToDash(Chain[Cn]->Id));
exit(1);
}
strcpy(PDB_End,Cmd->LastResidue);
}
for( Res1=From; Res1<To-1; Res1++ ) {
for( At1=0; At1<Chain[Cn]->Rsd[Res1]->NAtom; At1++ ) {
if( !strcmp(Chain[Cn]->Rsd[Res1]->AtomType[At1],"H") )
continue;
for( Res2 = Res1+1; Res2<To; Res2++ ) {
for( At2=0; At2<Chain[Cn]->Rsd[Res2]->NAtom; At2++ ) {
if( !strcmp(Chain[Cn]->Rsd[Res2]->AtomType[At2],"H") )
continue;
if( Dist(Chain[Cn]->Rsd[Res1]->Coord[At1],
Chain[Cn]->Rsd[Res2]->Coord[At2]) < CO_DIST) {
CO += abs(Res1-Res2);
NumberOfContacts++;
}
}
}
}
}
CO = 100.0*CO/NumberOfContacts;
CO /= (To-From+1);
printf("%s %c %d ( %s ) %d ( %s ) %5.1f\n",
Chain[Cn]->PdbIdent,SpaceToDash(Chain[Cn]->Id),From,PDB_Start,To-1,PDB_End,CO);
}
exit(0);
}

BIN
core

Binary file not shown.

12
die.c

@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdio.h>
void die(char *format, ... ) {
void exit(int return_code);
va_list ptr;
va_start(ptr,format);
vfprintf(stderr,format,ptr);
exit(1);
va_end(ptr);
}

@ -0,0 +1,18 @@
STRIDE was initially developed for UNIX and ported to MSDOS using the freely
available DJGPP compiler which is a port of the GNU C compiler to MSDOS by
DJ Delorie. I tested STRIDE for DOS on hundreds of PDB files using a 486DX2
PC with 8mB of memory and another one with 16 mB. In general it runs without
problems, but for VERY large PDB files 16 mB of memory are strongly recommended.
Dmitrij Frishman
European Molecular Biology Laboratory
Meyerhofstr. 1, 69012 Heidelberg, Germany
tel. +49 -6221 - 387231
fax. +49 -6221 - 387517
frishman@embl-heidelberg.de

@ -0,0 +1,58 @@
STRIDE was initially developed for UNIX and thoroughly tested on 3000 PDB files and many
different computers. For Macintosh I compiled STRIDE using the commercially available Metrowerks C
compiler. Two versions of the executable were prepared stored in BinHex format: mac68K.hqx for older
Macs and powmac.hqx for PowerMacintosh.
NOTE ABOUT INTERFACE: STRIDE uses unix-style command line interface. Since Mac has no command
line, I had to use the SIOUX console IO library and modify main() (file stride.c) by adding
just two lines in the very beginning:
---------------------------------------------------------
#include "stride.h"
#include <console.h> /* First modification */
main()....
..............
argc = ccommand(&argv); /* Second modification */
---------------------------------------------------------
Note that these two lines are commented out in the source code, so if you want to recompile
the program, you will have to uncomment them.
Now if you click on the appropriate executable, a simple window pops up where you can type
all command line parameters exactly as under UNIX, for example:
1acp.brk -h -f1acp.str (see documentation).
After you press RETURN, the computer will freeze for 1 to 20 minutes, dependent on the PDB
structure size, and then come back to life again. The PowerMac version is 10-20 times faster
on a PowerMac than mac68K.bin.
If you need a fancier, more Macintosh-like interface, you are more than welcome to develop
it. I am perfectly willing to cooperate, so please do not hesitate to contact me.
IMPORTANT NOTE: I am not a Mac expert and this is the first time I used a Mac for anything
other than typing text. I have no idea about Mac's architecture. For example, the current
settings of minimal and typical memory required for the program and stack size were made
essentially randomly. You might want to change these settings using the appropriate Mac
utilities. Any feedback is welcome. Also, since I do not know how to run command scripts
on Mac (is it possible?), the only way for me to test the program was to type command line
parameters for every PDB file. I did it for about 100 randomly selected PDB structures and
the results were correct. Still this is only a limited test...
Dmitrij Frishman
European Molecular Biology Laboratory
Meyerhofstr. 1, 69012 Heidelberg, Germany
tel. +49 -6221 - 387231
fax. +49 -6221 - 387517
frishman@embl-heidelberg.de

@ -0,0 +1,32 @@
========================29.01.96 ==========================
1. I can not supply the compiled Vax VMS version any
more since I have no access to old VAXes. OPENVMS
version is still available.
2. Bug fixed: if a PDB file has no HEADER record,
or if this record does not contain the 4-letter
structure code, STRIDE produces output with no
line breaks. This has now been fixed. I thank
STRIDE users for reporting this bug
3. Please note that the maximal number of atoms in
one residue is set to 50. This is in principle
more than enough. However, if your coordinate set
contains large things (like FAD) which are erraneously
in the ATOM records, STRIDE will not work. Such groups
should be put in HETATM records, where the current limit
is 200 atoms. You can always change these limits by
modifying the following two lines in the file stride.h:
#define MAX_AT_IN_RES 50
#define MAX_AT_IN_HETERORES 200
===========================================================
Dmitrij Frishman
European Molecular Biology Laboratory
Meyerhofstr. 1, 69012 Heidelberg, Germany
tel. +49 -6221 - 387231
fax. +49 -6221 - 387517
frishman@mailserver.embl-heidelberg.de

@ -0,0 +1,394 @@
STRIDE: Protein secondary structure assignment
from atomic coordinates
Dmitrij Frishman & Patrick Argos
European Molecular Biology Laboratory
Postfach 102209, Meyerhofstr. 1
69012 Heidelberg
Germany
FRISHMAN@EMBL-HEIDELBERG.DE
ARGOS@EMBL-HEIDELBERG.DE
CONTENTS
1. About the method
2. Copyright notice
3. Availability
4. Installation
5. Using STRIDE
6. Output format
7. Bug reports and user feedback
8. References
----------------------------------------------------------------------
1. About the method
STRIDE [1] is a program to recognize secondary structural elements in
proteins from their atomic coordinates. It performs the same task as
DSSP by Kabsch and Sander [2] but utilizes both hydrogen bond energy
and mainchain dihedral angles rather than hydrogen bonds alone. It
relies on database-derived recognition parameters with the
crystallographers' secondary structure definitions as a standard-of-
truth. Please see Frishman and Argos [1] for detailed description of
the algorithm.
2. Copyright notice
All rights reserved, whether the whole or part of the program is
concerned. Permission to use, copy, and modify this software and its
documentation is granted for academic use, provided that:
i. this copyright notice appears in all copies of the software and
related documentation;
ii. the reference given below (Frishman and Argos, 1995) must be
cited in any publication of scientific results based in part or
completely on the use of the program;
iii. bugs will be reported to the authors.
The use of the software in commercial activities is not allowed
without a prior written commercial license agreement.
WARNING: STRIDE is provided "as-is" and without warranty of any kind,
express, implied or otherwise, including without limitation any
warranty of merchantability or fitness for a particular purpose. In no
event will the authors be liable for any special, incidental, indirect
or consequential damages of any kind, or any damages whatsoever
resulting from loss of data or profits, whether or not advised of the
possibility of damage, and on any theory of liability, arising out of
or in connection with the use or performance of this software.
For calculation of the residue solvent accessible area the program NSC
[3,4] is used and was kindly provided by Dr. F.Eisenhaber
(EISENHABER@EMBL-HEIDELBERG.DE). Please direct to him all questions
concerning specifically accessibility calculations.
3. Availability
Executables of STRIDE for several UNIX platforms, VAX/VMS, OpenVMS,
Dos and Mac together with documentation and source code are available
by anonymous FTP from ftp.ebi.ac.uk (directories
/pub/software/unix/stride, /pub/software/dos/stride,
/pub/software/vms/stride, /pub/software/mac/stride). We are willing to
compile the program for other architectures if temporary access to
them will be granted by an interested user.
Data files with STRIDE secondary structure assignments for the current
release of the PDB [5] databank are in the directory
/pub/databases/stride of the same site. Atomic coordinate sets can be
submitted for secondary structure assignment through electronic mail
to stride@embl-heildelberg.de. A mail message containing HELP in the
first line will be answered with appropriate instructions. See also
WWW page http://www.embl-heidelberg.de/stride/stride_info.html.
4. Installation
For UNIX, DOS and Mac no installation is needed. Just download the
executable corresponding to your platform, and you are all set. For
VAX and OpenVMS you need only to link the executable with a logical
name; for example:
yourlogicalname:= $ $yourdiskname:[your.directory.name]stride.exe
and then use yourlogicalname as the program name.
5. Using STRIDE
The only required parameter for STRIDE is the name of the file
containing a set of atomic coordinates in PDB [5] format. By default
STRIDE writes to standard output, i.e. your screen. On systems that
allow to redirect output you can do so to create a disk file. Help is
available if you just type STRIDE without parameters. The following
options are accepted:
-fFilename Write output to the file "Filename" rather than to
stdout.
-h Report hydrogen bonds. By default no hydrogen bond
information is included in the output.
-o Report secondary structure summary only.
-rId1Id2.. Read only chains Id1, Id2 etc. of the PDB file *). All
other chains will be ignored. By default all valid
protein chains are read.
-cId1Id2.. Process only chains Id1, Id2 ...etc *). Secondary
structure assignment will be produced only for these
chains, but other chains that are present will be taken
into account while calculating residue accessible
surface and detecting inter-chain hydrogen bonds and,
possibly, interchain beta-sheets. By default all
protein chains read are processed.
-mFilename Generate a Molscript [6] file. Using the program
Molscript by Per Craulis you can create a postscript
picture of your structure. You can manually edit the
Molscript file produced by STRIDE to achieve the
desired orientation and to include additional details.
-q[Filename] Generate sequence file in FASTA [7] format and die.
Filename is optional. If no file name is specified,
stdandard output is used.
All options are case- and position-insensitive.
Examples:
1. Calculate secondary structure assignment for 1ACP including
hydrogen bond information:
stride 1acp.brk -h
2. Calculate secondary structure assignment for 4RUB and write the
output to the file 4rub.str
stride 4rub.brk -f4rub.str
3. Calculate secondary structure assignment for chain B of 4RUB.
Ignore all other chains. Generate a Molscript file 4rub.mol.
stride 4rub.brk -rb -m4rub.mol
4. Calculate secondary structure assignment for chain C of 2GLS in
the presence of chains A and B. Report secondary structure
summary only.
stride 2gls.brk -rabc -cc -o
6. Output format
STRIDE produces output that is easily readable both visually and with
computer programs. The side effect of this conveniency is larger file
size of individual STRIDE entries. Every record is 79 symbols long and
has the following general format:
Position Description
1-3 Record code
4-5 Not used
6-73 Data
74-75 Not used
75-79 Four letter PDB code (if available)
Below follows the description of each record type.
Code Description and format of data
REM Remarks and blank lines
Format: free
HDR Header. Protein name, date of file creation and PDB code
Format: free
CMP Compound.Full name of the molecule and identifying
information
Format: free
SRC Species, organ, tissue, and mutant from which the molecule
has been obtained
Format: free
AUT Names of the structure authors
Format: free
CHN File name and PDB chain identifier*).
Format: File name beginning from position 6 followed
by one space and one-letter chain identifier
SEQ Amino acid sequence
Format: 6-9 First residue PDB number
11-60 Sequence
62-65 Last residue PDB number
STR Secondary structure summary
Format: 11-60 Secondary structure assignment **)
LOC Location of secondary structure elements
Format: 6-17 Element name
19-21 First residue name
32-26 First residue PDB number
28-28 First residue chain identifier
36-38 Last residue name
42-45 Last residue PDB number
47-47 Last residue chain identifier
ASG Detailed secondary structure assignment
Format: 6-8 Residue name
10-10 Protein chain identifier
12-15 PDB residue number
17-20 Ordinal residue number
25-25 One letter secondary structure code **)
27-39 Full secondary structure name
43-49 Phi angle
53-59 Psi angle
65-69 Residue solvent accessible area
DNR Donor residue
Format: 6-8 Donor residue name
10-10 Protein chain identifier
12-15 PDB residue number
17-20 Ordinal residue number
26-28 Acceptor residue name
30-30 Protein chain identifier
32-35 PDB residue number
37-40 Ordinal residue number
42-45 N..0 distance
47-52 N..O=C angle
54-59 O..N-C angle
61-66 Angle between the planes of donor
complex and O..N-C
68-73 angle between the planes of acceptor
complex and N..O=C
ACC Acceptor residue
Format: 6-8 Acceptor residue name
10-10 Protein chain identifier
12-15 PDB residue number
17-20 Ordinal residue number
26-28 Donor residue name
30-30 Protein chain identifier
32-35 PDB residue number
37-40 Ordinal residue number
42-45 N..0 distance
47-52 N..O=C angle
54-59 O..N-C angle
61-66 Angle between the planes of donor
complex and O..N-C
68-73 angle between the planes of acceptor
complex and N..O=C
HDR, CMP, SCR and AUT records are directly copied from the PDB file,
if supplied by the authors. If only the secondary structure summary is
requested, only CHN, SEQ, STR and LOC records will be output.
Hydrogen bond information (records DNR and ACC) was made very
redundant to facilitate human reading and will not be reported by
default.
*) IMPORTANT NOTE: if the protein chain identifier is ' ' (space), it
will be substituted by '-' (dash) everywhere in the STRIDE output.
The same is true for command line parameters involving chain
identifiers where you have to specify '-' instead of ' '.
**) One-letter secondary structure code is nearly the same as used in
DSSP [2] (see Frishman and Argos [1] for details):
H Alpha helix
G 3-10 helix
I PI-helix
E Extended conformation
B or b Isolated bridge
T Turn
C Coil (none of the above)
For each record (data line) except those with codes REM and STR the
number of fields is consistent and is readily suitable for processing
with external tools, such as awk, perl, etc.
7. Bug reports and user feedback
Please send your suggestions, questions and bug reports to
FRISHMAN@EMBL-HEIDELBERG.DE. Send your contact address to get
information on updates and new features.
8. References
1. Frishman,D & Argos,P. (1995) Knowledge-based secondary structure
assignment. Proteins: structure, function and genetics, 23,
566-579.
2. Kabsch,W. & Sander,C. (1983) Dictionary of protein secondary
structure: pattern recognition of hydrogen-bonded and
geometrical features. Biopolymers, 22: 2577-2637.
3. Eisenhaber, F. and Argos, P. (1993) Improved strategy in
analytic surface calculation for molecular systems: handling of
singularities and computational efficiency. J. comput. Chem. 14,
1272-1280.
4. Eisenhaber, F., Lijnzaad, P., Argos, P., Sander, C., and Scharf,
M. (1995) The double cubic lattice method: efficient approaches
to numerical integration of surface area and volume and to dot
surface contouring of molecular assemblies. J. comput. Chem. 16,
273-284.
5. Bernstein, F.C., Koetzle, T.F., Williams, G.J., Meyer, E.F.,
Brice, M.D., Rodgers, J.R., Kennard, O., Shimanouchi, T., and
Tasumi, M. (1977) The protein data bank: a computer-based
archival file for macromolecular structures. J. Mol. Biol. 112,
535-542.
6. Kraulis, P.J. (1991) MOLSCRIPT: a program to produce both
detailed and schematic plots of protein structures. J. Appl.
Cryst. 24, 946-950.
7. Pearson, W.R. (1990) Rapid and sensitive sequence comparison
with FASTP and FASTA. Methods. Enzymol. 183, 63-98.

210
dssp.c

@ -0,0 +1,210 @@
#include "stride.h"
int ReadDSSP(CHAIN **Chain, DSSP **Dssp, COMMAND *Cmd)
{
FILE *fi;
int ChainNumber = -1, Start = 0, i;
BOOLEAN DuplicateChain = NO;
BUFFER Buffer, Tmp1, Tmp2;
char *Fields[MAX_FIELD];
if( strlen(Cmd->DsspFile) == 0 ) {
strcpy(Cmd->DsspFile,DSSPPATH);
GetFileNameFromPath(Chain[0]->File,Tmp1);
StripPathFromLastExtention(Tmp1,Tmp2);
strcat(Cmd->DsspFile,Tmp2);
strcat(Cmd->DsspFile,".dssp");
}
if( (fi = fopen(Cmd->DsspFile,"r")) ) {
while( fgets(Buffer,BUFSZ,fi) != NULL && !DuplicateChain ) {
if( Buffer[2] == '#' ) Start = 1;
else
if( Start == 1 ) {
if( Buffer[13] == '!' ) continue;
if( ChainNumber > 0 ) {
for( i=0; i<ChainNumber; i++ )
if( Dssp[i]->Id == Buffer[11] ) {
DuplicateChain = YES;
fprintf(stderr,"# Duplicate chain(s) in DSSP file %s\n",Cmd->DsspFile);
break;
}
}
if( ( ChainNumber == -1 || Buffer[11] != Dssp[ChainNumber]->Id ) ) {
ChainNumber++;
Dssp[ChainNumber] = (DSSP *)ckalloc(sizeof(DSSP));
Dssp[ChainNumber]->ResType = CharMatrix(MAX_RES,RES_FIELD);
Dssp[ChainNumber]->PDB_ResNumb = CharMatrix(MAX_RES,RES_FIELD);
Dssp[ChainNumber]->SecondStr = (char *)ckalloc(MAX_RES*sizeof(char));
Dssp[ChainNumber]->Accessibility = (float *)ckalloc(MAX_RES*sizeof(float));
strcpy(Dssp[ChainNumber]->File,Cmd->DsspFile);
Dssp[ChainNumber]->Id = Buffer[11];
Dssp[ChainNumber]->NRes = 0;
}
if( islower(Buffer[13]) ) Buffer[13] = 'C';
strcpy(Dssp[ChainNumber]->ResType[ Dssp[ChainNumber]->NRes ],OneToThree(Buffer[13]));
if( Buffer[16] == ' ' )
Dssp[ChainNumber]->SecondStr[ Dssp[ChainNumber]->NRes ] = 'C';
else
Dssp[ChainNumber]->SecondStr[ Dssp[ChainNumber]->NRes ] = Buffer[16];
SplitString(Buffer+6,Fields,1);
strcpy(Dssp[ChainNumber]->PDB_ResNumb[Dssp[ChainNumber]->NRes],Fields[0]);
SplitString(Buffer+34,Fields,1);
Dssp[ChainNumber]->Accessibility[ Dssp[ChainNumber]->NRes ] = atof(Fields[0]);
Dssp[ChainNumber]->NRes++;
}
}
fclose(fi);
}
ChainNumber++;
for( i=0; i<ChainNumber; i++ )
Dssp[i]->Id = SpaceToDash(Dssp[i]->Id);
return(ChainNumber);
}
/*************************************************************************
** **
** Check whether PDB and DSSP files correspond to each other **
** **
** INPUT: *Chain Pointer to a PDB chain **
** *Dssp Pointer to a DSSP chain **
** **
*************************************************************************/
int CompPdbDssp(CHAIN *Chain, DSSP *Dssp)
{
int Res, CA;
/* If the first or the last PDB residue does not have Ca, insert one residue in
coil conformation in the beginning or in the end of the DSSP chain */
if( !FindAtom(Chain,0,"CA",&CA) )
InsertFirst(Dssp,Chain);
if( Chain->NRes-1 > 0 && !FindAtom(Chain,Chain->NRes-1,"CA",&CA) )
InsertLast(Dssp,Chain);
/* Check correspondence of residue types */
for( Res=0; Res<Chain->NRes; Res++ )
if( strcmp(Chain->Rsd[Res]->ResType,Dssp->ResType[Res]) )
return(FAILURE);
/* If DSSP chain is still longer than PDB chain, shrink it */
if( Chain->NRes != Dssp->NRes )
Dssp->NRes = Chain->NRes;
return(SUCCESS);
}
/*************************************************************************
** **
** Insert one residue in the beginning of a DSSP chain and assign coil **
** conformation to it. This is neccessary to get rid of descrepancy **
** between the DSSP and PDB protein chains resulting from the fact **
** that DSSP does not consider residues without Ca atoms. Such residues,**
** e.g. ACE, often occur as first residues in PDB files **
** **
** INPUT: *Chain Pointer to protein chain **
** *Dssp Pointer to DSSP chain **
** **
** OUTPUT: *DSSP Pointer to modified DSSP chain **
** **
*************************************************************************/
void InsertFirst(DSSP *Dssp, CHAIN *Chain)
{
int Res;
for( Res=Dssp->NRes; Res>=1; Res-- ) {
strcpy(Dssp->ResType[Res],Dssp->ResType[Res-1]);
strcpy(Dssp->PDB_ResNumb[Res],Dssp->PDB_ResNumb[Res-1]);
Dssp->SecondStr[Res] = Dssp->SecondStr[Res-1];
}
strcpy(Dssp->ResType[0],Chain->Rsd[0]->ResType);
strcpy(Dssp->PDB_ResNumb[0],Chain->Rsd[0]->PDB_ResNumb);
Dssp->SecondStr[0] = 'C';
Dssp->NRes++;
}
/*************************************************************************
** **
** Insert one residue in the end a DSSP chain and assign coil **
** conformation to it. This is neccessary to get rid of descrepancy **
** between the DSSP and PDB protein chains resulting from the fact **
** that DSSP does not consider residues without Ca atoms. Such residues,**
** often occur as last residues in PDB files **
** **
** INPUT: *Chain Pointer to protein chain **
** *Dssp Pointer to DSSP chain **
** **
** OUTPUT: *DSSP Pointer to modified DSSP chain **
** **
*************************************************************************/
void InsertLast(DSSP *Dssp, CHAIN *Chain)
{
strcpy(Dssp->ResType[Dssp->NRes],Chain->Rsd[Dssp->NRes]->ResType);
strcpy(Dssp->PDB_ResNumb[Dssp->NRes],Chain->Rsd[Dssp->NRes]->PDB_ResNumb);
Dssp->SecondStr[Dssp->NRes] = 'C';
Dssp->NRes++;
}
/*************************************************************************
** **
** Get DSSP secondary structure assignment for every residue **
** **
*************************************************************************/
void GetDsspAsn(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
DSSP **Dssp;
int NDsspChain=0, DsspCn, Cn, i;
Dssp = (DSSP **)ckalloc(MAX_CHAIN*sizeof(DSSP *));
if( (NDsspChain = ReadDSSP(Chain,Dssp,Cmd)) == 0 )
die("NODSSP Dssp file for %s not found\n",Chain[0]->File);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( DsspCn=0; DsspCn<NDsspChain; DsspCn++ )
if( SpaceToDash(Chain[Cn]->Id) == Dssp[DsspCn]->Id )
break;
if( DsspCn == NDsspChain ) {
fprintf(stderr,"No DSSP chain corresponding to %s%c\n",
Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id));
continue;
}
if( !CompPdbDssp(Chain[Cn],Dssp[DsspCn]) )
die("PDBDSSPDIF Chain %s%c differs from %s%c\n",
Dssp[DsspCn]->File,Dssp[DsspCn]->Id,Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id));
for( i=0; i<Chain[Cn]->NRes; i++ ) {
Chain[Cn]->Rsd[i]->Prop->DsspAsn = Dssp[DsspCn]->SecondStr[i];
Chain[Cn]->Rsd[i]->Prop->DsspSolv = Dssp[DsspCn]->Accessibility[i];
}
}
if( Cmd->DsspAsn ) {
for( i=0; i<NDsspChain; i++ ) free(Dssp[i]);
free(Dssp);
}
}

150
elem.c

@ -0,0 +1,150 @@
#include "stride.h"
/*************************************************************************
** **
** Calculate the number of individual secondary structure elements of **
** type SecStrType and length not less than ElemLength that are: **
** - Present in Asn1 and Asn2 and absent in Asn3 (YYN) **
** - Present in Asn2 and Asn3 and absent in Asn1 (NYY) **
** - Absent in Asn2 and Asn3 and present in Asn1 (YYN) **
** - Absent in Asn1 and Asn2 and present in Asn3 (YYN) **
** **
*************************************************************************/
int FullElement(char *Asn1, char *Asn2, char *Asn3, int Length, char SecStrType, int ElemLength,
char EditChar, int *YYN, int *NYY, int *YNN, int *NNY)
{
register int i, j, Count1, Count2, Count3;
int Beg, ElLength;
*YYN = 0;
*NYY = 0;
*YNN = 0;
*NNY = 0;
if( ElemLength >= Length )
return(0);
ElLength = ElemLength-1;
Count1 = 0;
Count2 = 0;
Count3 = 0;
Beg = -1;
for( i=1; i<Length; i++ ) {
if( ( i == 0 &&
( Asn1[i] == SecStrType && Asn2[i] == SecStrType && Asn3[i] == SecStrType) ||
( Asn1[i] != SecStrType && Asn2[i] != SecStrType && Asn3[i] != SecStrType) )
||
( i > 0 &&
( Asn1[i] != Asn1[i-1] || Asn2[i] != Asn2[i-1] || Asn3[i] != Asn3[i-1] ) )
||
i == Length-1 ) {
if( Count1 >= ElLength && Count2 >= ElLength && Count3 < ElLength )
(*YYN)++;
else
if( Count1 < ElLength && Count2 >= ElLength && Count3 >= ElLength )
(*NYY)++;
else
if( Count1 >= ElLength && Count2 < ElLength && Count3 < ElLength )
(*YNN)++;
else
if( Count1 < ElLength && Count2 < ElLength && Count3 >= ElLength )
(*NNY)++;
/* if( Count1 >= ElLength || Count2 >= ElLength || Count3 >= ElLength ) {
* for( j=Beg-1; j<i; j++ ) {
* Asn1[j] = 'X';
* Asn2[j] = 'X';
* Asn3[j] = 'X';
* }
* }
*
*/
if( Count1 >= ElLength && ( Count2 < ElLength || Count3 < ElLength ) )
for( j=Beg-1; j<i; j++ )
Asn1[j] = EditChar;
if( Count2 >= ElLength && ( Count1 < ElLength || Count3 < ElLength ) )
for( j=Beg-1; j<i; j++ )
Asn2[j] = EditChar;
if( Count3 >= ElLength && ( Count1 < ElLength || Count2 < ElLength ) )
for( j=Beg-1; j<i; j++ )
Asn3[j] = EditChar;
Count1 = 0;
Count2 = 0;
Count3 = 0;
Beg = -1;
}
else {
if( Asn1[i] == SecStrType ) Count1++;
if( Asn2[i] == SecStrType ) Count2++;
if( Asn3[i] == SecStrType ) Count3++;
if( Beg == -1 && (Count1 == 1 || Count2 == 1 || Count3 == 1) ) Beg = i;
}
}
CorrectAsn(Asn1,Length,SecStrType,EditChar,ElLength);
CorrectAsn(Asn2,Length,SecStrType,EditChar,ElLength);
CorrectAsn(Asn3,Length,SecStrType,EditChar,ElLength);
return( (*YYN) * (*NYY) * (*YNN) * (*NNY) );
}
/*************************************************************************
** **
** Calculate the number of individual secondary structure elements of **
** type SecStrType in the known assignment Asn2 that are: **
** - Reproduced in Asn1 better than in Asn3 (Better) **
** - Reproduced in Asn1 worse than in Asn3 (Worse) **
** **
*************************************************************************/
int CompareElements(char *Asn1, char *Asn2, char *Asn3, int Length,
char SecStrType, int *Better, int *Worse)
{
register int i, j, Count1, Count2;
int TotalNumber = 0, Beg;
*Better = 0;
*Worse = 0;
Beg = -1;
for( i=0; i<Length; i++ ) {
if( (Asn1[i] == SecStrType || Asn2[i] == SecStrType || Asn3[i] == SecStrType) &&
(i == 0 ||
( Asn1[i-1] != SecStrType && Asn2[i-1] != SecStrType && Asn3[i-1] != SecStrType) ) ) {
TotalNumber++;
Beg = i;
}
else
if( Beg != -1 && ( i == Length-1 ||
( Asn1[i] != SecStrType && Asn2[i] != SecStrType && Asn3[i] != SecStrType ) ) ) {
Count1 = Count2 = 0;
for( j=Beg; j<=i; j++ ) {
if( (Asn1[j] == SecStrType || Asn2[j] == SecStrType) && Asn1[j] != Asn2[j] )
Count1++;
if( (Asn3[j] == SecStrType || Asn2[j] == SecStrType) && Asn3[j] != Asn2[j] )
Count2++;
}
if( Count1 > Count2 )
(*Worse)++;
else
if( Count2 > Count1 )
(*Better)++;
Beg = -1;
}
}
return(TotalNumber);
}

@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdio.h>
int escape(int RetVal, char *format, ... ) {
va_list ptr;
va_start(ptr,format);
vfprintf(stderr,format,ptr);
va_end(ptr);
return(RetVal);
}

@ -0,0 +1,28 @@
#include <stdio.h>
#include <string.h>
void GetFileNameFromPath(char *Path, char *FileName)
{
int i;
static char DirDelim[5] = { ':','/','\\',']','\0'};
for( i = (int)strlen(Path)-1; i>=0; i-- )
if( strchr(DirDelim,Path[i]) ) break;
strcpy(FileName,Path+i+1);
}
void StripPathFromLastExtention(char *Path, char *StrippedPath)
{
int i;
strcpy(StrippedPath,Path);
for( i = (int)strlen(StrippedPath); i>=0; i-- )
if( StrippedPath[i] == '.' ) {
StrippedPath[i] = '\0';
break;
}
}

@ -0,0 +1,462 @@
#include "stride.h"
void FillAsnAntiPar(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2,
PATTERN **Pat, int NPat, COMMAND *Cmd)
{
register int i, j;
int Beg1, Beg2, End1, End2;
int B1D, B1A, B2D, B2A, E1D, E1A, E2D, E2A;
char B1DCn, B1ACn, B2DCn, B2ACn, E1DCn, E1ACn, E2DCn, E2ACn, Beg1Cn, Beg2Cn;
PATTERN *CurrPat, *PrevPat;;
for( i=0; i<NPat; i++ ) {
if( Pat[i]->Nei1 != NULL && Pat[i]->Nei2 == NULL )
CurrPat = Pat[i]->Nei1;
else
if( Pat[i]->Nei2 != NULL && Pat[i]->Nei1 == NULL )
CurrPat = Pat[i]->Nei2;
else
continue;
if( Cmd->Info ) {
fprintf(stdout,"From: %c %c ",
Pat[i]->Hb1->Dnr->Chain->Id,Pat[i]->Hb2->Dnr->Chain->Id);
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn1]->Rsd[Pat[i]->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb2->Acc->A_Res]->PDB_ResNumb);
else
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn2]->Rsd[Pat[i]->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb2->Acc->A_Res]->PDB_ResNumb);
}
PrevPat = Pat[i];
while( CurrPat->Nei1 != NULL && CurrPat->Nei2 != NULL ) {
if( (CurrPat->Nei1->Nei1 == CurrPat || CurrPat->Nei1->Nei2 == CurrPat) &&
CurrPat->Nei1 != PrevPat ) {
PrevPat = CurrPat;
CurrPat = CurrPat->Nei1;
}
else
if( (CurrPat->Nei2->Nei1 == CurrPat || CurrPat->Nei2->Nei2 == CurrPat) &&
CurrPat->Nei2 != PrevPat ) {
PrevPat = CurrPat;
CurrPat = CurrPat->Nei2;
}
else {
fprintf(stdout,"Cycle Anti%s%c i = %d \n",Chain[Cn1]->File,Chain[Cn1]->Id,i);
break;
}
}
if( Cmd->Info ) {
fprintf(stdout,"To: %c %c ",
CurrPat->Hb1->Dnr->Chain->Id,CurrPat->Hb2->Dnr->Chain->Id);
if( CurrPat->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn1]->Rsd[CurrPat->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb2->Acc->A_Res]->PDB_ResNumb);
else
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn2]->Rsd[CurrPat->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb2->Acc->A_Res]->PDB_ResNumb);
}
Alias(&B1D,&B1A,&B2D,&B2A,&B1DCn,&B1ACn,&B2DCn,&B2ACn,Pat[i]);
Alias(&E1D,&E1A,&E2D,&E2A,&E1DCn,&E1ACn,&E2DCn,&E2ACn,CurrPat);
if( (Cn1 != Cn2 || E1D - B2A < E2D - B2A ) &&
( MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E2A,E1D,E2ACn,&Beg2,E2D,E1A,&Beg2Cn,E2DCn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ||
MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E1D,E2A,E1DCn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || E2D - B2A < E1D - B2A ) &&
( MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E1A,E2D,E1ACn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ||
MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E2D,E1A,E2DCn,&Beg2,E2A,E1D,&Beg2Cn,E2ACn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || B2A - E1D < B2A - E2D ) &&
( MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E2D,E1A,E2DCn,&Beg2,E2A,E1D,&Beg2Cn,E2ACn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ||
MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E1A,E2D,E1ACn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || B2A - E2D < B2A - E1D ) &&
( MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E1D,E2A,E1DCn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ||
MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E2A,E1D,E2ACn,&Beg2,E2D,E1A,&Beg2Cn,E2DCn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || B1D - E2A < B2D - E2A ) &&
( MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B2A,B1D,B2ACn,&Beg2,B2D,B1A,&Beg2Cn,B2DCn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ||
MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B1D,B2A,B1DCn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || B2D - E2A < B1D - E2A ) &&
( MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B1A,B2D,B1ACn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ||
MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B2D,B1A,B2DCn,&Beg2,B2A,B1D,&Beg2Cn,B2ACn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || E2A - B1D < E2A - B2D ) &&
( MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B2D,B1A,B2DCn,&Beg2,B2A,B1D,&Beg2Cn,B2ACn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ||
MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B1A,B2D,B1ACn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || E2A - B2D < E2A - B1D ) &&
( MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B1D,B2A,B1DCn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ||
MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B2A,B1D,B2ACn,&Beg2,B2D,B1A,&Beg2Cn,B2DCn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ) )
;
else {
/* fprintf(stdout,"Ne tot variant.. Anti.. %s%c\n",Chain[Cn1]->File,Chain[Cn1]->Id);*/
continue;
}
if( Beg1Cn == Chain[Cn1]->Id ) {
for( j=Beg1; j<=End1; j++ )
Asn1[j] = 'N';
for( j=Beg2; j<=End2; j++ )
Asn2[j] = 'N';
}
else {
for( j=Beg1; j<=End1; j++ )
Asn2[j] = 'N';
for( j=Beg2; j<=End2; j++ )
Asn1[j] = 'N';
}
Pat[i]->Nei1 = NULL;
Pat[i]->Nei2 = NULL;
CurrPat->Nei1 = NULL;
CurrPat->Nei2 = NULL;
}
}
void FillAsnPar(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2,
PATTERN **Pat, int NPat, COMMAND *Cmd)
{
register int i, j;
int Beg1, Beg2, End1, End2;
int B1D, B1A, B2D, B2A, E1D, E1A, E2D, E2A;
char B1DCn, B1ACn, B2DCn, B2ACn, E1DCn, E1ACn, E2DCn, E2ACn, Beg1Cn, Beg2Cn;
PATTERN *CurrPat, *PrevPat;;
for( i=0; i<NPat; i++ ) {
if( Pat[i]->Nei1 != NULL && Pat[i]->Nei2 == NULL )
CurrPat = Pat[i]->Nei1;
else
if( Pat[i]->Nei2 != NULL && Pat[i]->Nei1 == NULL )
CurrPat = Pat[i]->Nei2;
else
continue;
if( Cmd->Info ) {
fprintf(stdout,"From: %c %c ",
Pat[i]->Hb1->Dnr->Chain->Id,Pat[i]->Hb2->Dnr->Chain->Id);
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn1]->Rsd[Pat[i]->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb2->Acc->A_Res]->PDB_ResNumb);
else
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn2]->Rsd[Pat[i]->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[Pat[i]->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[Pat[i]->Hb2->Acc->A_Res]->PDB_ResNumb);
}
PrevPat = Pat[i];
while( CurrPat->Nei1 != NULL && CurrPat->Nei2 != NULL ) {
if( (CurrPat->Nei1->Nei1 == CurrPat || CurrPat->Nei1->Nei2 == CurrPat) &&
CurrPat->Nei1 != PrevPat ) {
PrevPat = CurrPat;
CurrPat = CurrPat->Nei1;
}
else {
PrevPat = CurrPat;
CurrPat = CurrPat->Nei2;
}
}
if( Cmd->Info ) {
fprintf(stdout,"To: %c %c ",
CurrPat->Hb1->Dnr->Chain->Id,CurrPat->Hb2->Dnr->Chain->Id);
if( CurrPat->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn1]->Rsd[CurrPat->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb2->Acc->A_Res]->PDB_ResNumb);
else
fprintf(stdout,"%s %s %s %s \n",
Chain[Cn2]->Rsd[CurrPat->Hb1->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb1->Acc->A_Res]->PDB_ResNumb,
Chain[Cn1]->Rsd[CurrPat->Hb2->Dnr->D_Res]->PDB_ResNumb,
Chain[Cn2]->Rsd[CurrPat->Hb2->Acc->A_Res]->PDB_ResNumb);
}
Alias(&B1D,&B1A,&B2D,&B2A,&B1DCn,&B1ACn,&B2DCn,&B2ACn,Pat[i]);
Alias(&E1D,&E1A,&E2D,&E2A,&E1DCn,&E1ACn,&E2DCn,&E2ACn,CurrPat);
if( ( Cn1 != Cn2 || abs(E1D-B2A) < abs(E2D-B2A) ) &&
( MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E2A,E1D,E2ACn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E2D,E1A,E2DCn,Pat,NPat) ||
MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E1D,E2A,E1DCn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(E2D-B2A) < abs(E1D-B2A) ) &&
( MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E1A,E2D,E1ACn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ||
MakeEnds(&Beg1,B1D,B2A,&Beg1Cn,B1DCn,&End1,E2D,E1A,E2DCn,&Beg2,B1A,B2D,&Beg2Cn,B1ACn,
&End2,E2A,E1D,E2ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(B2A-E1D) < abs(B2A-E2D) ) &&
( MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E2D,E1A,E2DCn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E2A,E1D,E2ACn,Pat,NPat) ||
MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E1A,E2D,E1ACn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E1D,E2A,E1DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(B2A-E2D) < abs(B2A-E1D) ) &&
( MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E1D,E2A,E1DCn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E1A,E2D,E1ACn,Pat,NPat) ||
MakeEnds(&Beg1,B1A,B2D,&Beg1Cn,B1ACn,&End1,E2A,E1D,E2ACn,&Beg2,B1D,B2A,&Beg2Cn,B1DCn,
&End2,E2D,E1A,E2DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(B1D-E2A) < abs(B2D-E2A) ) &&
( MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B2A,B1D,B2ACn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B2D,B1A,B2DCn,Pat,NPat) ||
MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B1D,B2A,B1DCn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(B2D-E2A) < abs(B1D-E2A) ) &&
( MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B1A,B2D,B1ACn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ||
MakeEnds(&Beg1,E1D,E2A,&Beg1Cn,E1DCn,&End1,B2D,B1A,B2DCn,&Beg2,E1A,E2D,&Beg2Cn,E1ACn,
&End2,B2A,B1D,B2ACn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(E2A-B1D) < abs(E2A-B2D) ) &&
( MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B2D,B1A,B2DCn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B2A,B1D,B2ACn,Pat,NPat) ||
MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B1A,B2D,B1ACn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B1D,B2A,B1DCn,Pat,NPat) ) )
;
else
if( ( Cn1 != Cn2 || abs(E2A-B2D) < abs(E2A-B1D) ) &&
( MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B1D,B2A,B1DCn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B1A,B2D,B1ACn,Pat,NPat) ||
MakeEnds(&Beg1,E1A,E2D,&Beg1Cn,E1ACn,&End1,B2A,B1D,B2ACn,&Beg2,E1D,E2A,&Beg2Cn,E1DCn,
&End2,B2D,B1A,B2DCn,Pat,NPat) ) )
;
else {
/* fprintf(stdout,"Ne tot variant.. Par %s%c\n",Chain[Cn1]->File,Chain[Cn1]->Id);*/
continue;
}
if( Beg1Cn == Chain[Cn1]->Id ) {
for( j=Beg1; j<=End1; j++ ) Asn1[j] = 'P';
for( j=Beg2; j<=End2; j++ ) Asn2[j] = 'P';
}
else {
for( j=Beg1; j<=End1; j++ ) Asn2[j] = 'P';
for( j=Beg2; j<=End2; j++ ) Asn1[j] = 'P';
}
Pat[i]->Nei1 = NULL;
Pat[i]->Nei2 = NULL;
CurrPat->Nei1 = NULL;
CurrPat->Nei2 = NULL;
}
}
int MakeEnds(int *Beg1, int ResBeg1, int NeiBeg1, char *Beg1Cn, char ResBeg1Cn, int *End1,
int ResEnd1, int NeiEnd1, char ResEnd1Cn, int *Beg2, int ResBeg2, int NeiBeg2,
char *Beg2Cn, char ResBeg2Cn, int *End2, int ResEnd2, int NeiEnd2,
char ResEnd2Cn, PATTERN **Pat, int NPat)
{
register int i;
int Flag1 = 0, Flag2 = 0;
if( ResBeg1 <= NeiBeg1 && NeiBeg1 <= NeiEnd1 && NeiEnd1 <= ResEnd1 &&
ResBeg2 <= NeiBeg2 && NeiBeg2 <= NeiEnd2 && NeiEnd2 <= ResEnd2 &&
ResBeg1Cn == ResEnd1Cn && ResBeg2Cn == ResEnd2Cn ) {
*Beg1 = ResBeg1;
*End1 = ResEnd1;
*Beg2 = ResBeg2;
*End2 = ResEnd2;
*Beg1Cn = ResBeg1Cn;
*Beg2Cn = ResBeg2Cn;
for( i=0; i<NPat && (Flag1 == 0 || Flag2 == 0); i++ ) {
if( ( (Pat[i]->Hb1->Dnr->D_Res == (*Beg1)
&& Pat[i]->Hb1->Acc->A_Res == (*End2)
&& Pat[i]->Hb1->Dnr->Chain->Id == (*Beg1Cn)
&& Pat[i]->Hb1->Acc->Chain->Id == (*Beg2Cn) )
||
(Pat[i]->Hb1->Acc->A_Res == (*Beg1)
&& Pat[i]->Hb1->Dnr->D_Res == (*End2)
&& Pat[i]->Hb1->Acc->Chain->Id == (*Beg1Cn)
&& Pat[i]->Hb1->Dnr->Chain->Id == (*Beg2Cn) ) )
&& Pat[i]->Hb1->Dnr->D_Res == Pat[i]->Hb2->Acc->A_Res
&& Pat[i]->Hb2->Dnr->D_Res == Pat[i]->Hb1->Acc->A_Res )
Flag1 = 1;
if( ( (Pat[i]->Hb1->Dnr->D_Res == (*Beg2)
&& Pat[i]->Hb1->Acc->A_Res == (*End1)
&& Pat[i]->Hb1->Dnr->Chain->Id == (*Beg2Cn)
&& Pat[i]->Hb1->Acc->Chain->Id == (*Beg1Cn) )
||
(Pat[i]->Hb1->Acc->A_Res == (*Beg2)
&& Pat[i]->Hb1->Dnr->D_Res == (*End1)
&& Pat[i]->Hb1->Acc->Chain->Id == (*Beg2Cn)
&& Pat[i]->Hb1->Dnr->Chain->Id == (*Beg1Cn) ) )
&& Pat[i]->Hb1->Dnr->D_Res == Pat[i]->Hb2->Acc->A_Res
&& Pat[i]->Hb2->Dnr->D_Res == Pat[i]->Hb1->Acc->A_Res )
Flag2 = 1;
}
if( !Flag1 ) {
if( *Beg1 != NeiBeg1 ) (*Beg1)++;
if( *End2 != NeiEnd2 ) (*End2)--;
}
if( !Flag2 ) {
if( *End1 != NeiEnd1 ) (*End1)--;
if( *Beg2 != NeiBeg2 ) (*Beg2)++;
}
return(SUCCESS);
}
return(FAILURE);
}
void FilterAntiPar(PATTERN **Pat, int NPat)
{
register int i, j;
int I1A, I1D, I2A, I2D, J1A, J1D, J2A, J2D;
char I1ACn, I1DCn, I2ACn, I2DCn, J1ACn, J1DCn, J2ACn, J2DCn;
for( i=0; i<NPat; i++ ) {
if( !Pat[i]->ExistPattern ) continue;
Alias(&I1D,&I1A,&I2D,&I2A,&I1DCn,&I1ACn,&I2DCn,&I2ACn,Pat[i]);
for( j=0; j<NPat; j++ ) {
if( j == i || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( J1D == J2A && J2D == J1A && I1D != I2A && I2D != I1A &&
( (J1D == I1D && J1A == I1A) || (J1D == I1A && J1A == I1D) ||
(J1D == I2A && J1A == I2D) || (J1D == I2D && J1A == I2A) ) ) continue;
if( ( ( I1D < I2A || I2D < I1A ) &&
( (J1A <= I2A && J1A >= I1D && J2D <= I2A && J2D >= I1D && J2DCn == I1DCn &&
J2A <= I1A && J2A >= I2D && J1D <= I1A && J1D >= I2D && J1DCn == I2DCn) ||
(J2A <= I2A && J2A >= I1D && J1D <= I2A && J1D >= I1D && J1DCn == I1DCn &&
J1A <= I1A && J1A >= I2D && J2D <= I1A && J2D >= I2D && J2DCn == I2DCn) ) ) ||
( ( I1D > I2A || I2D > I1A ) &&
( (J1A >= I2A && J1A <= I1D && J2D >= I2A && J2D <= I1D && J2DCn == I1DCn &&
J2A >= I1A && J2A <= I2D && J1D >= I1A && J1D <= I2D && J1DCn == I2DCn) ||
(J2A >= I2A && J2A <= I1D && J1D >= I2A && J1D <= I1D && J1DCn == I1DCn &&
J1A >= I1A && J1A <= I2D && J2D >= I1A && J2D <= I2D && J2DCn == I2DCn) ) ) ) {
Pat[j]->ExistPattern = NO;
}
}
}
}
void FilterPar(PATTERN **Pat, int NPat)
{
register int i, j;
int I1A, I1D, I2A, I2D, J1A, J1D, J2A, J2D;
char I1ACn, I1DCn, I2ACn, I2DCn, J1ACn, J1DCn, J2ACn, J2DCn;
for( i=0; i<NPat; i++ ) {
if( !Pat[i]->ExistPattern ) continue;
Alias(&I1D,&I1A,&I2D,&I2A,&I1DCn,&I1ACn,&I2DCn,&I2ACn,Pat[i]);
for( j=0; j<NPat; j++ ) {
if( j == i || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( ( ( I1A >= I2D && I1D >= I2A ) &&
( (J1A >= I2A && J1A <= I1D && J2D >= I2A && J2D <= I1D && J2DCn == I1DCn &&
J2A <= I1A && J2A >= I2D && J1D <= I1A && J1D >= I2D && J1DCn == I2DCn) ||
(J2A >= I2A && J2A <= I1D && J1D >= I2A && J1D <= I1D && J1DCn == I1DCn &&
J1A <= I1A && J1A >= I2D && J2D <= I1A && J2D >= I2D && J2DCn == I2DCn) ) ) ||
( I2A >= I1D && I2D >= I1A &&
( (J1A <= I2A && J1A >= I1D && J2D <= I2A && J2D >= I1D && J2DCn == I1DCn &&
J2A >= I1A && J2A <= I2D && J1D >= I1A && J1D <= I2D && J1DCn == I2DCn) ||
(J2A <= I2A && J2A >= I1D && J1D <= I2A && J1D >= I1D && J1DCn == I1DCn &&
J1A >= I1A && J1A <= I2D && J2D >= I1A && J2D <= I2D && J2DCn == I2DCn) ) ) ) {
Pat[j]->ExistPattern = NO;
}
}
}
}
void Alias(int *D1,int *A1,int *D2,int *A2,char *D1Cn,char *A1Cn,char *D2Cn,char *A2Cn,
PATTERN *Pat)
{
*D1 = Pat->Hb1->Dnr->D_Res;
*A1 = Pat->Hb1->Acc->A_Res;
*D2 = Pat->Hb2->Dnr->D_Res;
*A2 = Pat->Hb2->Acc->A_Res;
*D1Cn = Pat->Hb1->Dnr->Chain->Id;
*A1Cn = Pat->Hb1->Acc->Chain->Id;
*D2Cn = Pat->Hb2->Dnr->Chain->Id;
*A2Cn = Pat->Hb2->Acc->Chain->Id;
}

@ -0,0 +1,389 @@
/*************************************************************************
** **
** Calculate torsion angle **
** **
** INPUT: *Coord1, *Coord2, *Coord3, *Coord4 Coordinates of four atoms **
** **
** RETURNS: Calculate torsion angle **
** **
** Adapted from the program of D.S.Moss. **
** Reference: Moss, D. S. (1992) Molecular geometry. In: **
** Computer modelling of biomolecular processess, Goodfellow, J.M, **
** Moss,D.S., eds, pp. 5-18. **
** **
*************************************************************************/
#include "stride.h"
float Torsion(float *Coord1, float *Coord2, float *Coord3, float *Coord4)
{
double Comp[3][3], ScalarProd, TripleScalarProd, AbsTorsAng;
double Perp_123[3], Perp_234[3], Len_Perp_123, Len_Perp_234;
int i, j, k;
/* Find the components of the three bond vectors */
for( i=0; i<3; i++ ) {
Comp[0][i] = (double)(Coord2[i]-Coord1[i]);
Comp[1][i] = (double)(Coord3[i]-Coord2[i]);
Comp[2][i] = (double)(Coord4[i]-Coord3[i]);
}
/* Calculate vectors perpendicular to the planes 123 and 234 */
Len_Perp_123 = 0.0; Len_Perp_234 = 0.0;
for( i=0; i<3; i++ ) {
j = (i+1)%3;
k = (j+1)%3;
Perp_123[i] = Comp[0][j]*Comp[1][k] - Comp[0][k]*Comp[1][j];
Perp_234[i] = Comp[1][j]*Comp[2][k] - Comp[1][k]*Comp[2][j];
Len_Perp_123 += Perp_123[i]*Perp_123[i];
Len_Perp_234 += Perp_234[i]*Perp_234[i];
}
Len_Perp_123 = sqrt(Len_Perp_123);
Len_Perp_234 = sqrt(Len_Perp_234);
/* Normalize the vectors perpendicular to 123 and 234 */
for( i=0; i<3; i++ ) {
Perp_123[i] /= Len_Perp_123;
Perp_234[i] /= Len_Perp_234;
}
/* Find the scalar product of the unit normals */
ScalarProd = 0.0;
for( i=0; i<3; i++ )
ScalarProd += Perp_123[i]*Perp_234[i];
/* Find the absolute value of the torsion angle */
if( ScalarProd > 0.0 && fabs(ScalarProd - 1.0) < Eps )
ScalarProd -= Eps;
else
if( ScalarProd < 0.0 && fabs(ScalarProd + 1.0) < Eps )
ScalarProd += Eps;
AbsTorsAng = RADDEG*acos(ScalarProd);
/* Find the triple scalar product of the three bond vectors */
TripleScalarProd = 0.0;
for( i=0; i<3; i++ )
TripleScalarProd += Comp[0][i]*Perp_234[i];
/* Torsion angle has the sign of the triple scalar product */
return( (TripleScalarProd > 0.0) ? (float)AbsTorsAng : (float)(-AbsTorsAng) );
}
/*************************************************************************
** **
** INPUT: *Coord1 Coordinates of the first point **
** *Coord2 Coordinates of the second point **
** **
** RETURNS: Distance between two points **
** **
*************************************************************************/
float Dist(float *Coord1, float *Coord2)
{
register int i;
float Dist=0;
for( i=0; i<3; i++ )
Dist += (Coord1[i]-Coord2[i])*(Coord1[i]-Coord2[i]);
return( sqrt(Dist) );
}
/*************************************************************************
** **
** INPUT: *Coord1 Coordinates of the first point **
** *Coord2 Coordinates of the second point **
** *Coord3 Coordinates of the third point **
** **
** RETURNS: Angle 1-2-3 **
** **
*************************************************************************/
float Ang(float *Coord1, float *Coord2, float *Coord3)
{
float Vector1[3], Vector2[3];
double A, B, C, D;
Vector1[0] = Coord1[0] - Coord2[0];
Vector1[1] = Coord1[1] - Coord2[1];
Vector1[2] = Coord1[2] - Coord2[2];
Vector2[0] = Coord3[0] - Coord2[0];
Vector2[1] = Coord3[1] - Coord2[1];
Vector2[2] = Coord3[2] - Coord2[2];
A = Vector1[0]*Vector2[0]+Vector1[1]*Vector2[1]+Vector1[2]*Vector2[2];
B = sqrt( Vector1[0]*Vector1[0]+Vector1[1]*Vector1[1]+Vector1[2]*Vector1[2]);
C = sqrt( Vector2[0]*Vector2[0]+Vector2[1]*Vector2[1]+Vector2[2]*Vector2[2]);
D = A/(B*C);
if( D > 0.0 && fabs(D - 1.0) < Eps )
D -= Eps;
else
if( D < 0.0 && fabs(D + 1.0) < Eps )
D += Eps;
return((float)(RADDEG*acos(D)));
}
/*************************************************************************
** **
** INPUT: *Chain Protein chain **
** *Res Residue number **
** **
** OUTPUT: Chain->Rsd[Res]->Prop->Phi Phi torsional angle **
** **
*************************************************************************/
void PHI(CHAIN *Chain, int Res)
{
int C_Prev, N_Curr, CA_Curr, C_Curr;
RESIDUE *r, *rr;
r = Chain->Rsd[Res];
r->Prop->Phi = 360.0;
if( Res == 0 )
return;
rr = Chain->Rsd[Res-1];
if( FindAtom(Chain,Res-1,"C",&C_Prev) && FindAtom(Chain,Res,"N",&N_Curr) &&
FindAtom(Chain,Res,"CA",&CA_Curr) && FindAtom(Chain,Res,"C",&C_Curr) &&
Dist(rr->Coord[C_Prev],r->Coord[N_Curr]) < BREAKDIST ) {
r->Prop->Phi = Torsion(rr->Coord[C_Prev],r->Coord[N_Curr],
r->Coord[CA_Curr],r->Coord[C_Curr]);
}
}
/*************************************************************************
** **
** INPUT: *Chain Protein chain **
** *Res Residue number **
** **
** OUTPUT: Chain->Rsd[Res]->Prop->Psi Psi torsional angle **
** **
*************************************************************************/
void PSI(CHAIN *Chain, int Res)
{
int N_Curr, CA_Curr, C_Curr, N_Next;
RESIDUE *r, *rr;
r = Chain->Rsd[Res];
r->Prop->Psi = 360.0;
if( Res == Chain->NRes-1 )
return;
rr = Chain->Rsd[Res+1];
if( FindAtom(Chain,Res,"N",&N_Curr) && FindAtom(Chain,Res,"CA",&CA_Curr) &&
FindAtom(Chain,Res,"C",&C_Curr) && FindAtom(Chain,Res+1,"N",&N_Next) &&
Dist(r->Coord[C_Curr],rr->Coord[N_Next]) < BREAKDIST ){
r->Prop->Psi = Torsion(r->Coord[N_Curr],r->Coord[CA_Curr],
r->Coord[C_Curr],rr->Coord[N_Next]);
}
}
/*************************************************************************
** **
** INPUT: *Chain Protein chain **
** *Res Residue number **
** **
** OUTPUT: *Omega Omega torsional angle **
** **
*************************************************************************/
void OMEGA(CHAIN *Chain, int Res)
{
int CA_Prev, C_Prev, N_Curr, CA_Curr;
RESIDUE *r, *rr;
r = Chain->Rsd[Res];
r->Prop->Omega = 360.0;
if( Res == 0 )
return;
rr = Chain->Rsd[Res-1];
if( FindAtom(Chain,Res-1,"CA",&CA_Prev) && FindAtom(Chain,Res-1,"C",&C_Prev) &&
FindAtom(Chain,Res,"N",&N_Curr) && FindAtom(Chain,Res,"CA",&CA_Curr) ) {
r->Prop->Omega = Torsion(rr->Coord[CA_Prev],rr->Coord[C_Prev],
r->Coord[N_Curr],r->Coord[CA_Curr]);
}
}
/*************************************************************************
** **
** Place atom X in the plane of atoms 1,2 and 3 given the **
** distance |X-3| and angle 2-3-X **
** **
** INPUT: *Coord1, *Coord2, *Coord3 Coordinates of three atoms in the **
** plane **
** Dist3X Distance between atom 3 and the **
** atom to be placed **
** Ang23X Angle between atoms 2,3 and the **
** atom to be placed **
** **
** OUTPUT: *Coordx Coordinates of the placed atom **
** **
*************************************************************************/
void Place123_X(float *Coord1, float *Coord2, float *Coord3, float Dist3X, float Ang23X,
float *CoordX)
{
/*
Atom1
\ AtomX
\ ^UnVect2 /
\| /
Atom2----------Atom3->UnVect1
*/
float Length_23, Length_12;
float Proj3X_1, Proj3X_2, Proj12_1, Proj12_2, Rad1, Rad2;
float UnVect1[3], UnVect2[3];
int i;
Length_23 = Dist(Coord3,Coord2);
Length_12 = Dist(Coord2,Coord1);
Rad1 = RAD(180.0-Ang23X);
Rad2 = RAD(Ang(Coord1,Coord2,Coord3)-90.0);
Proj3X_1 = Dist3X*cos(Rad1);
Proj3X_2 = Dist3X*sin(Rad1);
Proj12_2 = cos(Rad2)*Length_12;
Proj12_1 = sin(Rad2)*Length_12;
for( i=0; i<3; i++ ) {
UnVect1[i] = (Coord3[i]-Coord2[i])/Length_23;
UnVect2[i] = ((Coord1[i]-Coord2[i]) - ( -UnVect1[i]*Proj12_1))/Proj12_2;
}
for( i=0; i<3; i++ )
CoordX[i] = Proj3X_1*UnVect1[i]+Proj3X_2*UnVect2[i]+Coord3[i];
}
/*************************************************************************
** **
** INPUT: *Vector1, Vector2 **
** **
** OUTPUT: *Product Vector pruduct of Vector1 and Vector2 **
** **
*************************************************************************/
float VectorProduct(float *Vector1, float *Vector2, float *Product)
{
int i, j, k;
float ProductLength;
ProductLength = 0.0;
for( i=0; i<3; i++ ) {
j = (i+1)%3;
k = (j+1)%3;
Product[i] = Vector1[j]*Vector2[k] - Vector1[k]*Vector2[j];
ProductLength += Product[i]*Product[i];
}
return(sqrt(ProductLength));
}
/*************************************************************************
** **
** Find projection of an atom to a plane **
** **
** INPUT: *Coord1, *Coord2, *Coord3 Coordinates of three atoms in a **
** plance **
** *Coord4 Coordinates of the fourth atom **
** **
** OUTPUT: *Coord_Proj4_123 Coordinates of the fourth atom's **
** projection to the place **
** **
*************************************************************************/
void Project4_123(float *Coord1, float *Coord2, float *Coord3, float *Coord4,
float *Coord_Proj4_123)
{
/*
Atom4
Atom3 .
\ .
\ .
\ . .Proj4_123
\ ..
Atom2-------Atom1
*/
float Vector21[3], Vector23[3], Vector14[3], VectorNormal_123[3];
float Length_21 = 0.0, Length_23 = 0.0, Length_14 = 0.0, NormalLength;
float COS_Norm_14, Proj_14_Norm;
int i;
for( i=0; i<3; i++ ) {
Vector21[i] = Coord1[i] - Coord2[i];
Vector23[i] = Coord3[i] - Coord2[i];
Vector14[i] = Coord4[i] - Coord1[i];
Length_21 += Vector21[i]*Vector21[i];
Length_23 += Vector23[i]*Vector23[i];
Length_14 += Vector14[i]*Vector14[i];
}
Length_21 = sqrt(Length_21);
Length_23 = sqrt(Length_23);
Length_14 = sqrt(Length_14);
NormalLength = VectorProduct(Vector21,Vector23,VectorNormal_123);
for( i=0; i<3; i++ )
VectorNormal_123[i] /= NormalLength;
COS_Norm_14 = 0.0;
for( i=0; i<3; i++ )
COS_Norm_14 += VectorNormal_123[i]*Vector14[i];
COS_Norm_14 /= (Length_14*NormalLength);
if( COS_Norm_14 < 0.0 ) {
COS_Norm_14 = fabs(COS_Norm_14);
for( i=0; i<3; i++ )
VectorNormal_123[i] = -VectorNormal_123[i];
}
Proj_14_Norm = Length_14*COS_Norm_14;
for( i=0; i<3; i++ ) {
VectorNormal_123[i] *= Proj_14_Norm;
Coord_Proj4_123[i] = (Vector14[i] - VectorNormal_123[i]) + Coord1[i];
}
}
double GetAtomRadius(char *AtomType)
{
if( !strcmp(AtomType,"O") )
return(1.40);
else
if( !strcmp(AtomType,"N") )
return(1.65);
else
if( !strcmp(AtomType,"CA") )
return(1.87);
else
if( !strcmp(AtomType,"C") )
return(1.76);
else
return(1.80);
}

@ -0,0 +1,72 @@
#include "stride.h"
/*************************************************
Calculate the hydrogen bond energy as defined by
Boobbyer et al., 1989
**************************************************/
void GRID_Energy(float *CA2, float *C, float *O, float *H, float *N, COMMAND *Cmd, HBOND *HBond)
{
float ProjH[3];
/***** Distance dependence ( 8-6 potential ) ****/
if( Cmd->Truncate && HBond->AccDonDist < RmGRID )
HBond->AccDonDist = RmGRID;
HBond->Er = CGRID/pow(HBond->AccDonDist,8.0) - DGRID/pow(HBond->AccDonDist,6.0);
/************** Angular dependance ****************/
/* Find projection of the hydrogen on the O-C-CA plane */
Project4_123(O,C,CA2,H,ProjH);
/* Three angles determining the direction of the hydrogen bond */
HBond->ti = fabs(180.0 - Ang(ProjH,O,C));
HBond->to = Ang(H,O,ProjH);
HBond->p = Ang(N,H,O);
/* Calculate both angle-dependent HB energy components Et and Ep */
if( HBond->ti >= 0.0 && HBond->ti < 90.0 )
HBond->Et = cos(RAD(HBond->to))*(0.9+0.1*sin(RAD(2*HBond->ti)));
else
if( HBond->ti >= 90.0 && HBond->ti < 110.0 )
HBond->Et = K1GRID*cos(RAD(HBond->to))*
(pow((K2GRID-pow(cos(RAD(HBond->ti)),2.0)),3.0));
else
HBond->Et = 0.0;
if( HBond->p > 90.0 && HBond->p < 270.0 )
HBond->Ep = pow(cos(RAD(HBond->p)),2.0);
else
HBond->Ep = 0.0;
/******** Full hydrogen bond energy *********************/
HBond->Energy = 1000.0*HBond->Er*HBond->Et*HBond->Ep;
}
#define Q -27888.0
/********************************************************
Calculate the energy of polar interaction as defined by
Kabsch and Sander (1983)
*********************************************************/
void DSSP_Energy(float *Dummy, float *C, float *O, float *H, float *N, COMMAND *Cmd,
HBOND *HBond)
/* Dummy not used, for compatibility with GRID_Energy */
{ HBond->Energy = Q/Dist(O,H) + Q/Dist(C,N) - Q/HBond->AccDonDist - Q/Dist(C,H); }

@ -0,0 +1,114 @@
#include "stride.h"
void Helix(CHAIN **Chain, int Cn, HBOND **HBond, COMMAND *Cmd, float **PhiPsiMap)
{
int BondNumb, i;
float *Prob, CONST;
RESIDUE **r;
CONST = 1+Cmd->C1_H;
Prob = (float *)ckalloc(MAX_RES*sizeof(float));
for( i=0; i<Chain[Cn]->NRes; i++ )
Prob[i] = 0.0;
for( i=0; i<Chain[Cn]->NRes-5; i++ ) {
r = &Chain[Cn]->Rsd[i];
if( r[0]->Prop->PhiZn != ERR && r[0]->Prop->PsiZn != ERR &&
r[1]->Prop->PhiZn != ERR && r[1]->Prop->PsiZn != ERR &&
r[2]->Prop->PhiZn != ERR && r[2]->Prop->PsiZn != ERR &&
r[3]->Prop->PhiZn != ERR && r[3]->Prop->PsiZn != ERR &&
r[4]->Prop->PhiZn != ERR && r[4]->Prop->PsiZn != ERR ) {
if( (BondNumb = FindPolInt(HBond,r[4],r[0])) != ERR ) {
Prob[i] = HBond[BondNumb]->Energy*(CONST+Cmd->C2_H*
0.5*(PhiPsiMap[r[0]->Prop->PhiZn][r[0]->Prop->PsiZn]+
PhiPsiMap[r[4]->Prop->PhiZn][r[4]->Prop->PsiZn]));
}
}
}
for( i=0; i<Chain[Cn]->NRes-5; i++ ) {
if( Prob[i] < Cmd->Treshold_H1 && Prob[i+1] < Cmd->Treshold_H1 ) {
r = &Chain[Cn]->Rsd[i];
r[1]->Prop->Asn = 'H';
r[2]->Prop->Asn = 'H';
r[3]->Prop->Asn = 'H';
r[4]->Prop->Asn = 'H';
if( r[0]->Prop->PhiZn!= ERR && r[0]->Prop->PsiZn != ERR &&
PhiPsiMap[r[0]->Prop->PhiZn][r[0]->Prop->PsiZn] > Cmd->Treshold_H3 )
r[0]->Prop->Asn = 'H';
if( r[5]->Prop->PhiZn != ERR && r[5]->Prop->PsiZn != ERR &&
PhiPsiMap[r[5]->Prop->PhiZn][r[5]->Prop->PsiZn] > Cmd->Treshold_H4 )
r[5]->Prop->Asn = 'H';
}
}
for( i=0; i<Chain[Cn]->NRes-4; i++ ) {
r = &Chain[Cn]->Rsd[i];
if( FindBnd(HBond,r[3],r[0]) != ERR && FindBnd(HBond,r[4],r[1]) != ERR &&
/*************************** This should be improved **************************/
( (r[1]->Prop->Asn != 'H' && r[2]->Prop->Asn != 'H') ||
(r[2]->Prop->Asn != 'H' && r[3]->Prop->Asn != 'H') ) )
/******************************************************************************/
{
r[1]->Prop->Asn = 'G';
r[2]->Prop->Asn = 'G';
r[3]->Prop->Asn = 'G';
}
}
for( i=0; i<Chain[Cn]->NRes-6; i++ ) {
r = &Chain[Cn]->Rsd[i];
if( FindBnd(HBond,r[5],r[0]) != ERR && FindBnd(HBond,r[6],r[1]) != ERR &&
r[1]->Prop->Asn == 'C' && r[2]->Prop->Asn == 'C' &&
r[3]->Prop->Asn == 'C' && r[4]->Prop->Asn == 'C' &&
r[5]->Prop->Asn == 'C' ) {
r[1]->Prop->Asn = 'I';
r[2]->Prop->Asn = 'I';
r[3]->Prop->Asn = 'I';
r[4]->Prop->Asn = 'I';
r[5]->Prop->Asn = 'I';
}
}
if( Cmd->Info ) {
fprintf(stdout,"%s%c\n",Chain[Cn]->File,Chain[Cn]->Id);
for( i=0; i<Chain[Cn]->NRes-4; i++ ) {
r = &Chain[Cn]->Rsd[i];
if( r[0]->Prop->PhiZn != ERR && r[0]->Prop->PsiZn != ERR &&
r[4]->Prop->PhiZn != ERR && r[4]->Prop->PsiZn != ERR ) {
fprintf(stdout,"%s (%d) %c %10.7f %8.5f %8.5f | %4d %4d\n",
r[0]->PDB_ResNumb,i,r[0]->Prop->Asn,Prob[i],
PhiPsiMap[r[0]->Prop->PhiZn][r[0]->Prop->PsiZn],
PhiPsiMap[r[4]->Prop->PhiZn][r[4]->Prop->PsiZn],
r[4]->Prop->PhiZn,r[4]->Prop->PsiZn);
}
}
}
free(Prob);
}

@ -0,0 +1,612 @@
#include "stride.h"
int FindDnr(CHAIN *Chain, DONOR **Dnr, int *NDnr, COMMAND *Cmd)
{
int Res, dc;
char Rsd[RES_FIELD];
dc = *NDnr;
for( Res=0; Res<Chain->NRes; Res++ ) {
strcpy(Rsd,Chain->Rsd[Res]->ResType);
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Peptide,1.90,0);
if( !Cmd->SideChainHBond ) continue;
if( !strcmp(Rsd,"TRP") )
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Trp,1.90,0);
else if( !strcmp(Rsd,"ASN") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Asn,1.90,0);
else if( !strcmp(Rsd,"GLN") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Gln,1.90,0);
else if( !strcmp(Rsd,"ARG") ) {
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,1);
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,2);
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,3);
}
else if( !strcmp(Rsd,"HIS") ) {
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,His,1.90,1);
DefineDnr(Chain,Dnr,&dc,Res,Nsp2,His,1.90,2);
}
else if( !strcmp(Rsd,"LYS") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp3,Lys,2.10,0);
else if( !strcmp(Rsd,"SER") ) DefineDnr(Chain,Dnr,&dc,Res,Osp3,Ser,1.70,0);
else if( !strcmp(Rsd,"THR") ) DefineDnr(Chain,Dnr,&dc,Res,Osp3,Thr,1.70,0);
else if( !strcmp(Rsd,"TYR") ) DefineDnr(Chain,Dnr,&dc,Res,Osp2,Tyr,1.70,0);
}
*NDnr = dc;
return(dc);
}
int DefineDnr(CHAIN *Chain, DONOR **Dnr, int *dc, int Res, enum HYBRID Hybrid, enum GROUP Group,
float HB_Radius, int N)
{
Dnr[*dc] = (DONOR *)ckalloc(sizeof(DONOR));
Dnr[*dc]->Chain = Chain;
Dnr[*dc]->D_Res = Res;
if( Group != Peptide )
Dnr[*dc]->DD_Res = Res;
else
Dnr[*dc]->DD_Res = Res-1;
Dnr[*dc]->DDI_Res = Res;
Dnr[*dc]->Hybrid = Hybrid;
Dnr[*dc]->Group = Group;
Dnr[*dc]->HB_Radius = HB_Radius;
if( Group == Peptide ) {
if( Res != 0 ) {
FindAtom(Chain,Res,"N",&Dnr[*dc]->D_At);
FindAtom(Chain,Res-1,"C",&Dnr[*dc]->DD_At);
}
else {
Dnr[*dc]->D_At = ERR;
Dnr[*dc]->DD_At = ERR;
}
FindAtom(Chain,Res,"CA",&Dnr[*dc]->DDI_At);
FindAtom(Chain,Res,"H",&Dnr[*dc]->H);
}
else if( Group == Trp ) {
FindAtom(Chain,Res,"NE1",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CE2",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CD1",&Dnr[*dc]->DDI_At);
}
else if( Group == Asn ) {
FindAtom(Chain,Res,"ND1",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CG",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CB",&Dnr[*dc]->DDI_At);
}
else if( Group == Gln ) {
FindAtom(Chain,Res,"NE2",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CD",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CG",&Dnr[*dc]->DDI_At);
}
else if( Group == Arg ) {
if( N == 1 ) {
FindAtom(Chain,Res,"NE",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CZ",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CD",&Dnr[*dc]->DDI_At);
}
else
if( N == 2 ) {
FindAtom(Chain,Res,"NH1",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CZ",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"NE",&Dnr[*dc]->DDI_At);
}
else
if( N == 3 ) {
FindAtom(Chain,Res,"NH2",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CZ",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"NE",&Dnr[*dc]->DDI_At);
}
}
else if( Group == His ) {
if( N == 1 ) {
FindAtom(Chain,Res,"ND1",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CG",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CE1",&Dnr[*dc]->DDI_At);
}
else if( N == 2 ) {
FindAtom(Chain,Res,"NE2",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CE1",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CD2",&Dnr[*dc]->DDI_At);
}
}
else if( Group == Tyr ) {
FindAtom(Chain,Res,"OH",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CZ",&Dnr[*dc]->DD_At);
FindAtom(Chain,Res,"CE1",&Dnr[*dc]->DDI_At);
}
else if( Group == Lys ) {
FindAtom(Chain,Res,"NZ",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CE",&Dnr[*dc]->DD_At);
}
else if( Group == Ser ) {
FindAtom(Chain,Res,"OG",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CB",&Dnr[*dc]->DD_At);
}
else if( Group == Thr ) {
FindAtom(Chain,Res,"OG1",&Dnr[*dc]->D_At);
FindAtom(Chain,Res,"CB",&Dnr[*dc]->DD_At);
}
if( Dnr[*dc]->H == ERR || Dnr[*dc]->D_At == ERR || Dnr[*dc]->DD_At == ERR ||
(Dnr[*dc]->DDI_At == ERR && (Hybrid == Nsp2 || Hybrid == Osp2 )) ) {
free(Dnr[*dc]); return(FAILURE);
}
else (*dc)++;
return(SUCCESS);
}
int FindAcc(CHAIN *Chain, ACCEPTOR **Acc, int *NAcc, COMMAND *Cmd)
{
int Res, ac;
char Rsd[RES_FIELD];
ac = *NAcc;
for( Res=0; Res<Chain->NRes; Res++ ) {
strcpy(Rsd,Chain->Rsd[Res]->ResType);
DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Peptide,1.60,0);
if( !Cmd->SideChainHBond ) continue;
if( !strcmp(Rsd,"HIS") ) {
DefineAcceptor(Chain,Acc,&ac,Res,Nsp2,His,1.60,0);
DefineAcceptor(Chain,Acc,&ac,Res,Nsp2,His,1.60,0);
}
else if( !strcmp(Rsd,"SER") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp3,Ser,1.70,0);
else if( !strcmp(Rsd,"THR") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp3,Thr,1.70,0);
else if( !strcmp(Rsd,"ASN") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asn,1.60,0);
else if( !strcmp(Rsd,"GLN") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Gln,1.60,0);
else if( !strcmp(Rsd,"ASP") ) {
DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asp,1.60,1);
DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asp,1.60,2);
}
else if( !strcmp(Rsd,"GLU") ) {
DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Glu,1.60,1);
DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Glu,1.60,2);
}
else if( !strcmp(Rsd,"TYR") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Tyr,1.70,0);
else if( !strcmp(Rsd,"MET") ) DefineAcceptor(Chain,Acc,&ac,Res,Ssp3,Met,1.95,0);
else if( !strcmp(Rsd,"CYS") ) DefineAcceptor(Chain,Acc,&ac,Res,Ssp3,Cys,1.70,0);
}
*NAcc = ac;
return(ac);
}
int DefineAcceptor(CHAIN *Chain, ACCEPTOR **Acc, int *ac, int Res, enum HYBRID Hybrid,
enum GROUP Group, float HB_Radius, int N)
{
Acc[*ac] = (ACCEPTOR *)ckalloc(sizeof(ACCEPTOR));
Acc[*ac]->Chain = Chain;
Acc[*ac]->A_Res = Res;
Acc[*ac]->AA_Res = Res;
Acc[*ac]->AA2_Res = Res;
Acc[*ac]->Hybrid = Hybrid;
Acc[*ac]->Group = Group;
Acc[*ac]->HB_Radius = HB_Radius;
if( Group == Peptide ) {
if( Res != Chain->NRes-1 ) {
FindAtom(Chain,Res,"O",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"C",&Acc[*ac]->AA_At);
}
else {
Acc[*ac]->A_At = ERR;
Acc[*ac]->AA_At = ERR;
}
FindAtom(Chain,Res,"CA",&Acc[*ac]->AA2_At);
}
else if( Group == His ) {
if( N == 1 ) {
FindAtom(Chain,Res,"ND1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CE1",&Acc[*ac]->AA2_At);
}
else if( N == 2 ) {
FindAtom(Chain,Res,"NE2",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CE1",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CD2",&Acc[*ac]->AA2_At);
}
}
else if( Group == Asn ) {
FindAtom(Chain,Res,"OD1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA2_At);
}
else if( Group == Gln ) {
FindAtom(Chain,Res,"OE1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CD",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA2_At);
}
else if( Group == Asp ) {
if( N == 1 ) {
FindAtom(Chain,Res,"OD1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA2_At);
}
else if( N == 2 ) {
FindAtom(Chain,Res,"ND2",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA2_At);
}
}
else if( Group == Glu ) {
if( N == 1 ) {
FindAtom(Chain,Res,"OE1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CD",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA2_At);
}
else if( N == 2 ) {
FindAtom(Chain,Res,"NE2",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CD",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA2_At);
}
}
else if( Group == Tyr ) {
FindAtom(Chain,Res,"OH",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CZ",&Acc[*ac]->AA_At);
FindAtom(Chain,Res,"CE1",&Acc[*ac]->AA2_At);
}
else if( Group == Ser ) {
FindAtom(Chain,Res,"OG",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA_At);
}
else if( Group == Thr ) {
FindAtom(Chain,Res,"OG1",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA_At);
}
else if( Group == Met ) {
FindAtom(Chain,Res,"SD",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CG",&Acc[*ac]->AA_At);
}
else if( Group == Cys ) {
FindAtom(Chain,Res,"SG",&Acc[*ac]->A_At);
FindAtom(Chain,Res,"CB",&Acc[*ac]->AA_At);
}
if( Acc[*ac]->A_At == ERR || Acc[*ac]->AA_At == ERR ||
(Acc[*ac]->AA2_At == ERR && (Hybrid == Nsp2 || Hybrid == Osp2 )) ) {
free(Acc[*ac]); return(FAILURE);
}
else (*ac)++;
return(SUCCESS);
}
int FindHydrogenBonds(CHAIN **Chain, int NChain, HBOND **HBond, COMMAND *Cmd)
{
DONOR **Dnr;
ACCEPTOR **Acc;
BOOLEAN *BondedDonor, *BondedAcceptor;
int NDnr=0, NAcc=0;
int dc, ac, ccd, cca, cc, hc=0, i;
void (*HBOND_Energy)();
BUFFER Text;
Dnr = (DONOR **)ckalloc(MAXDONOR*sizeof(DONOR *));
Acc = (ACCEPTOR **)ckalloc(MAXACCEPTOR*sizeof(ACCEPTOR *));
for( cc=0; cc<NChain; cc++ ) {
FindDnr(Chain[cc],Dnr,&NDnr,Cmd);
FindAcc(Chain[cc],Acc,&NAcc,Cmd);
}
BondedDonor = (BOOLEAN *)ckalloc(NDnr*sizeof(BOOLEAN));
BondedAcceptor = (BOOLEAN *)ckalloc(NAcc*sizeof(BOOLEAN));
for( i=0; i<NDnr; i++ )
BondedDonor[i] = NO;
for( i=0; i<NAcc; i++ )
BondedAcceptor[i] = NO;
if( Cmd->EnergyType == 'D' )
HBOND_Energy = DSSP_Energy;
else
HBOND_Energy = GRID_Energy;
for( dc=0; dc<NDnr; dc++ ) {
if( Dnr[dc]->Group != Peptide && !Cmd->SideChainHBond ) continue;
for( ac=0; ac<NAcc; ac++ ) {
if( abs(Acc[ac]->A_Res - Dnr[dc]->D_Res) < 2 && Acc[ac]->Chain->Id == Dnr[dc]->Chain->Id )
continue;
if( Acc[ac]->Group != Peptide && !Cmd->SideChainHBond ) continue;
if( hc == MAXHYDRBOND )
die("Number of hydrogen bonds exceeds current limit of %d in %s\n",
MAXHYDRBOND,Chain[0]->File);
HBond[hc] = (HBOND *)ckalloc(sizeof(HBOND));
HBond[hc]->ExistHydrBondRose = NO;
HBond[hc]->ExistHydrBondBaker = NO;
HBond[hc]->ExistPolarInter = NO;
if( (HBond[hc]->AccDonDist =
Dist(Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At]) ) <=
Cmd->DistCutOff ) {
if( Cmd->MainChainPolarInt && Dnr[dc]->Group == Peptide &&
Acc[ac]->Group == Peptide && Dnr[dc]->H != ERR) {
HBOND_Energy(Acc[ac]->Chain->Rsd[Acc[ac]->AA2_Res]->Coord[Acc[ac]->AA2_At],
Acc[ac]->Chain->Rsd[Acc[ac]->AA_Res]->Coord[Acc[ac]->AA_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->H],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Cmd,HBond[hc]);
if( HBond[hc]->Energy < -10.0 &&
( (Cmd->EnergyType == 'G' && fabs(HBond[hc]->Et) > Eps &&
fabs(HBond[hc]->Ep) > Eps ) || Cmd->EnergyType != 'G' ) )
HBond[hc]->ExistPolarInter = YES;
}
if( Cmd->MainChainHBond &&
(HBond[hc]->OHDist =
Dist(Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->H],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At])) <= 2.5 &&
(HBond[hc]->AngNHO =
Ang(Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->H],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At])) >= 90.0 &&
HBond[hc]->AngNHO <= 180.0 &&
(HBond[hc]->AngCOH =
Ang(Acc[ac]->Chain->Rsd[Acc[ac]->AA_Res]->Coord[Acc[ac]->AA_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->H])) >= 90.0 &&
HBond[hc]->AngCOH <= 180.0 )
HBond[hc]->ExistHydrBondBaker = YES;
if( Cmd->MainChainHBond &&
HBond[hc]->AccDonDist <= Dnr[dc]->HB_Radius+Acc[ac]->HB_Radius ) {
HBond[hc]->AccAng =
Ang(Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At],
Acc[ac]->Chain->Rsd[Acc[ac]->AA_Res]->Coord[Acc[ac]->AA_At]);
if( ( ( Acc[ac]->Hybrid == Nsp2 || Acc[ac]->Hybrid == Osp2 ) &&
( HBond[hc]->AccAng >= MINACCANG_SP2 &&
HBond[hc]->AccAng <= MAXACCANG_SP2 ) ) ||
( ( Acc[ac]->Hybrid == Ssp3 || Acc[ac]->Hybrid == Osp3 ) &&
( HBond[hc]->AccAng >= MINACCANG_SP3 &&
HBond[hc]->AccAng <= MAXACCANG_SP3 ) ) ) {
HBond[hc]->DonAng =
Ang(Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->DD_Res]->Coord[Dnr[dc]->DD_At]);
if( ( ( Dnr[dc]->Hybrid == Nsp2 || Dnr[dc]->Hybrid == Osp2 ) &&
( HBond[hc]->DonAng >= MINDONANG_SP2 &&
HBond[hc]->DonAng <= MAXDONANG_SP2 ) ) ||
( ( Dnr[dc]->Hybrid == Nsp3 || Dnr[dc]->Hybrid == Osp3 ) &&
( HBond[hc]->DonAng >= MINDONANG_SP3 &&
HBond[hc]->DonAng <= MAXDONANG_SP3 ) ) ) {
if( Dnr[dc]->Hybrid == Nsp2 || Dnr[dc]->Hybrid == Osp2 ) {
HBond[hc]->AccDonAng =
fabs(Torsion(Dnr[dc]->Chain->Rsd[Dnr[dc]->DDI_Res]->Coord[Dnr[dc]->DDI_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Dnr[dc]->Chain->Rsd[Dnr[dc]->DD_Res]->Coord[Dnr[dc]->DD_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At]));
if( HBond[hc]->AccDonAng > 90.0 && HBond[hc]->AccDonAng < 270.0 )
HBond[hc]->AccDonAng = fabs(180.0 - HBond[hc]->AccDonAng);
}
if( Acc[ac]->Hybrid == Nsp2 || Acc[ac]->Hybrid == Osp2 ) {
HBond[hc]->DonAccAng =
fabs(Torsion(Dnr[dc]->Chain->Rsd[Dnr[dc]->D_Res]->Coord[Dnr[dc]->D_At],
Acc[ac]->Chain->Rsd[Acc[ac]->A_Res]->Coord[Acc[ac]->A_At],
Acc[ac]->Chain->Rsd[Acc[ac]->AA_Res]->Coord[Acc[ac]->AA_At],
Acc[ac]->Chain->Rsd[Acc[ac]->AA2_Res]->Coord[Acc[ac]->AA2_At]));
if(HBond[hc]->DonAccAng > 90.0 && HBond[hc]->DonAccAng < 270.0)
HBond[hc]->DonAccAng = fabs(180.0 - HBond[hc]->DonAccAng);
}
if( ( Dnr[dc]->Hybrid != Nsp2 && Dnr[dc]->Hybrid != Osp2 &&
Acc[ac]->Hybrid != Nsp2 && Acc[ac]->Hybrid != Osp2 ) ||
( Acc[ac]->Hybrid != Nsp2 && Acc[ac]->Hybrid != Osp2 &&
( Dnr[dc]->Hybrid == Nsp2 || Dnr[dc]->Hybrid == Osp2 ) &&
HBond[hc]->AccDonAng <= ACCDONANG ) ||
( Dnr[dc]->Hybrid != Nsp2 && Dnr[dc]->Hybrid != Osp2 &&
( Acc[ac]->Hybrid == Nsp2 || Acc[ac]->Hybrid == Osp2 ) &&
HBond[hc]->DonAccAng <= DONACCANG ) ||
( ( Dnr[dc]->Hybrid == Nsp2 || Dnr[dc]->Hybrid == Osp2 ) &&
( Acc[ac]->Hybrid == Nsp2 || Acc[ac]->Hybrid == Osp2 ) &&
HBond[hc]->AccDonAng <= ACCDONANG &&
HBond[hc]->DonAccAng <= DONACCANG ) )
HBond[hc]->ExistHydrBondRose = YES;
}
}
}
}
if( (HBond[hc]->ExistPolarInter && HBond[hc]->Energy < 0.0)
|| HBond[hc]->ExistHydrBondRose || HBond[hc]->ExistHydrBondBaker ) {
HBond[hc]->Dnr = Dnr[dc];
HBond[hc]->Acc = Acc[ac];
BondedDonor[dc] = YES;
BondedAcceptor[ac] = YES;
if( (ccd = FindChain(Chain,NChain,Dnr[dc]->Chain->Id)) != ERR ) {
if( Chain[ccd]->Rsd[Dnr[dc]->D_Res]->Inv->NBondDnr < MAXRESDNR )
Chain[ccd]->Rsd[Dnr[dc]->D_Res]->Inv->
HBondDnr[Chain[ccd]->Rsd[Dnr[dc]->D_Res]->Inv->NBondDnr++] = hc;
else
fprintf(stderr,"Residue %s %s of chain %s%c is involved in %d hydrogen bonds (%d are allowed)\n",
Chain[ccd]->Rsd[Dnr[dc]->D_Res]->ResType,
Chain[ccd]->Rsd[Dnr[dc]->D_Res]->PDB_ResNumb,
Chain[ccd]->File,SpaceToDash(Chain[ccd]->Id),
Chain[ccd]->Rsd[Dnr[dc]->D_Res]->Inv->NBondDnr,MAXRESDNR-1);
}
if( (cca = FindChain(Chain,NChain,Acc[ac]->Chain->Id)) != ERR ) {
if( Chain[cca]->Rsd[Acc[ac]->A_Res]->Inv->NBondAcc < MAXRESACC )
Chain[cca]->Rsd[Acc[ac]->A_Res]->Inv->
HBondAcc[Chain[cca]->Rsd[Acc[ac]->A_Res]->Inv->NBondAcc++] = hc;
else
fprintf(stderr,"Residue %s %s of chain %s%c is involved in %d hydrogen bonds (%d are allowed)\n",
Chain[cca]->Rsd[Acc[ac]->A_Res]->ResType,
Chain[cca]->Rsd[Acc[ac]->A_Res]->PDB_ResNumb,
Chain[cca]->File,SpaceToDash(Chain[cca]->Id),
Chain[cca]->Rsd[Acc[ac]->A_Res]->Inv->NBondAcc,MAXRESACC-1);
}
if( ccd != cca && ccd != ERR ) {
Chain[ccd]->Rsd[Dnr[dc]->D_Res]->Inv->InterchainHBonds = YES;
Chain[cca]->Rsd[Acc[ac]->A_Res]->Inv->InterchainHBonds = YES;
if( HBond[hc]->ExistHydrBondRose ) {
Chain[0]->NHydrBondInterchain++;
Chain[0]->NHydrBondTotal++;
}
}
else
if( ccd == cca && ccd != ERR && HBond[hc]->ExistHydrBondRose ) {
Chain[ccd]->NHydrBond++;
Chain[0]->NHydrBondTotal++;
}
hc++;
}
else
free(HBond[hc]);
}
}
if( Cmd->Info )
for( i=0; i<hc; i++ ) {
if( HBond[i]->Energy < 0.0 ) {
sprintf(Text,"%3d ",i);
PrintHydrBond(Text,HBond[i]);
}
}
for( i=0; i<NDnr; i++ )
if( !BondedDonor[i] )
free(Dnr[i]);
for( i=0; i<NAcc; i++ )
if( !BondedAcceptor[i] )
free(Acc[i]);
if( NDnr )
free(BondedDonor);
if( NAcc )
free(BondedAcceptor);
return(hc);
}
void PrintHydrBond(char *Text, HBOND *HBond)
{
fprintf(stdout,"HB %s %20s %3s %4s %4d %c <> %3s %4s %4d %c ",Text,
HBond->Dnr->Chain->File,
HBond->Dnr->Chain->Rsd[HBond->Dnr->D_Res]->ResType,
HBond->Dnr->Chain->Rsd[HBond->Dnr->D_Res]->PDB_ResNumb,
HBond->Dnr->D_Res,HBond->Dnr->Chain->Id,
HBond->Acc->Chain->Rsd[HBond->Acc->A_Res]->ResType,
HBond->Acc->Chain->Rsd[HBond->Acc->A_Res]->PDB_ResNumb,
HBond->Acc->A_Res,HBond->Acc->Chain->Id);
fprintf(stdout," %7.1f ",HBond->AccDonDist);
if( HBond->ExistPolarInter )
fprintf(stdout,"%7.1f ",HBond->Energy);
else
fprintf(stdout,"XXXXXXX ");
if( HBond->ExistHydrBondRose )
fprintf(stdout,"YES ");
else
fprintf(stdout,"NO ");
if( HBond->ExistHydrBondBaker )
fprintf(stdout,"YES\n");
else
fprintf(stdout,"NO\n");
}
int FindPolInt(HBOND **HBond, RESIDUE *Res1, RESIDUE *Res2)
{
register int i, j, hb;
INVOLVED *p1, *p2;
p1 = Res1->Inv;
p2 = Res2->Inv;
if( p1->NBondDnr && p2->NBondAcc ) {
for( i=0; i<p1->NBondDnr; i++ ) {
hb = p1->HBondDnr[i];
for( j=0; j<p2->NBondAcc; j++ )
if( hb == p2->HBondAcc[j] && HBond[hb]->ExistPolarInter )
return(hb);
}
}
return(ERR);
}
int FindBnd(HBOND **HBond, RESIDUE *Res1, RESIDUE *Res2)
{
register int i, j, hb;
INVOLVED *p1, *p2;
p1 = Res1->Inv;
p2 = Res2->Inv;
if( p1->NBondDnr && p2->NBondAcc ) {
for( i=0; i<p1->NBondDnr; i++ ) {
hb = p1->HBondDnr[i];
for( j=0; j<p2->NBondAcc; j++ )
if( hb == p2->HBondAcc[j] && HBond[hb]->ExistHydrBondRose )
return(hb);
}
}
return(ERR);
}
int NoDoubleHBond(HBOND **HBond, int NHBond)
{
int i, j, NExcl=0;
for( i=0; i<NHBond-1; i++ )
for( j=i+1; j<NHBond; j++ )
if( HBond[i]->Dnr->D_Res == HBond[j]->Dnr->D_Res &&
HBond[i]->Dnr->Chain->Id == HBond[j]->Dnr->Chain->Id &&
HBond[i]->ExistPolarInter && HBond[j]->ExistPolarInter ) {
if( HBond[i]->Energy < 5.0*HBond[j]->Energy ) {
HBond[j]->ExistPolarInter = NO;
NExcl++;
}
else
if( HBond[j]->Energy < 5.0*HBond[i]->Energy ) {
HBond[i]->ExistPolarInter = NO;
NExcl++;
}
}
return(NExcl);
}

@ -0,0 +1,39 @@
#include "stride.h"
void InitChain(CHAIN **Chain)
{
*Chain = (CHAIN *)ckalloc(sizeof(CHAIN));
(*Chain)->NRes = 0;
(*Chain)->NHetRes = 0;
(*Chain)->NonStandRes = 0;
(*Chain)->NHet = 0;
(*Chain)->NonStandAtom = 0;
(*Chain)->NHelix = 0;
(*Chain)->NSheet = -1;
(*Chain)->NTurn = 0;
(*Chain)->NAssignedTurn = 0;
(*Chain)->NBond = 0;
(*Chain)->NHydrBond = 0;
(*Chain)->NHydrBondTotal = 0;
(*Chain)->NHydrBondInterchain = 0;
(*Chain)->Method = XRay;
(*Chain)->Ter = 0;
(*Chain)->Resolution = 0.0;
(*Chain)->File = (char *)ckalloc(BUFSZ*sizeof(char));
(*Chain)->Rsd = (RESIDUE **)ckalloc(MAX_RES*sizeof(RESIDUE *));
(*Chain)->HetRsd = (HETERORESIDUE **)ckalloc(MAX_HETRES*sizeof(HETERORESIDUE *));
(*Chain)->Het = (HET **)ckalloc(MAX_HET*sizeof(HET *));
(*Chain)->Helix = (HELIX **)ckalloc(MAX_HELIX*sizeof(HELIX *));
(*Chain)->Sheet = (SHEET **)ckalloc(MAX_SHEET*sizeof(SHEET *));
(*Chain)->Turn = (TURN **)ckalloc(MAX_TURN*sizeof(TURN *));
(*Chain)->AssignedTurn = (TURN **)ckalloc(MAX_TURN*sizeof(TURN *));
(*Chain)->SSbond = (SSBOND **)ckalloc(MAX_BOND*sizeof(SSBOND *));
(*Chain)->Info = (char **)ckalloc(MAX_INFO*sizeof(char *));
(*Chain)->Valid = YES;
}

@ -0,0 +1,299 @@
#include "stride.h"
void Measure(CHAIN **Chain, int NChain, int El, COMMAND *Cmd, FILE *Out)
{
QUALITY QualDssp_H, QualDssp_E, Qual_H, Qual_E;
int i, Cn, Flag1, Flag2;
float Q2_, Q2_Dssp, O_, O_Dssp;
float Content, AlphaCont, BetaCont, PerCor, PerCorDssp;
int HelAlp, HelPI, Hel310, Sheet, Turn;
int YYN_H, NYY_H, YNN_H, NNY_H, YYN_E, NYY_E, YNN_E, NNY_E;
int Total_H, Better_H, Worse_H, Total_E, Better_E, Worse_E;
char Tmp[3][MAX_RES], *Asn, *PdbAsn, *DsspAsn;
CHAIN *c;
for( Cn=0; Cn<NChain; Cn++ ) {
c = Chain[Cn];
if( !c->Valid )
continue;
Asn = (char *)ckalloc(c->NRes*sizeof(char));
PdbAsn = (char *)ckalloc(c->NRes*sizeof(char));
DsspAsn = (char *)ckalloc(c->NRes*sizeof(char));
ExtractAsn(Chain,Cn,Asn);
ExtractPdbAsn(Chain,Cn,PdbAsn);
ExtractDsspAsn(Chain,Cn,DsspAsn);
for( i=0; i<c->NRes; i++ ) {
if( Asn[i] != 'H' && Asn[i] != 'E' && Asn[i] != 'B' )
Asn[i] = 'C';
if( PdbAsn[i] != 'H' && PdbAsn[i] != 'E' )
PdbAsn[i] = 'C';
if( DsspAsn[i] != 'H' && DsspAsn[i] != 'E' && DsspAsn[i] != 'B' )
DsspAsn[i] = 'C';
if( Asn[i] == 'B' )
Asn[i] = 'E';
if( DsspAsn[i] == 'B' )
DsspAsn[i] = 'E';
}
CorrectAsnDouble(Asn,DsspAsn,PdbAsn,c->NRes,'E','C');
if( El ) {
FullElement(Asn,PdbAsn,DsspAsn,c->NRes,'H',4,'z',&YYN_H,&NYY_H,&YNN_H,&NNY_H);
FullElement(Asn,PdbAsn,DsspAsn,c->NRes,'E',1,'y',&YYN_E,&NYY_E,&YNN_E,&NNY_E);
fprintf(Out,"DIFF_EL ");
}
else
fprintf(Out,"DIFF ");
Content = SecStrContent(c,&HelAlp,&HelPI,&Hel310,&Sheet,&Turn);
AlphaCont = (float)HelAlp/(float)c->NRes;
BetaCont = (float)Sheet/(float)c->NRes;
Presnell(PdbAsn,c->NRes,DsspAsn,c->NRes,'E',0.5,&Q2_Dssp,&O_Dssp);
Presnell(PdbAsn,c->NRes,Asn,c->NRes,'E',0.5,&Q2_,&O_);
Difference(DsspAsn,PdbAsn,c->NRes,'H',&QualDssp_H);
Difference(DsspAsn,PdbAsn,c->NRes,'E',&QualDssp_E);
Difference(Asn,PdbAsn,c->NRes,'H',&Qual_H);
Difference(Asn,PdbAsn,c->NRes,'E',&Qual_E);
PerCor = PercentCorrect(Asn,PdbAsn,c->NRes);
PerCorDssp = PercentCorrect(DsspAsn,PdbAsn,c->NRes);
Total_H = CompareElements(Asn,PdbAsn,DsspAsn,c->NRes,'H',&Better_H,&Worse_H);
Total_E = CompareElements(Asn,PdbAsn,DsspAsn,c->NRes,'E',&Better_E,&Worse_E);
if( (Flag1=AssessCorr(&Qual_H)) )
fprintf(Out,"%6.4f ",Qual_H.Corr);
else fprintf(Out," None ");
fprintf(Out,"%6.4f ",Qual_H.Perc);
if( (Flag2=AssessCorr(&QualDssp_H)) )
fprintf(Out,"%6.4f ",QualDssp_H.Corr);
else fprintf(Out," None ");
fprintf(Out,"%6.4f ",QualDssp_H.Perc);
if( Flag1 && Flag2 )
fprintf(Out,"%7.4f ",Qual_H.Corr-QualDssp_H.Corr);
else fprintf(Out," None ");
fprintf(Out,"%7.4f | ",Qual_H.Perc-QualDssp_H.Perc);
if( (Flag1=AssessCorr(&Qual_E)) )
fprintf(Out,"%6.4f ",Qual_E.Corr);
else fprintf(Out," None ");
fprintf(Out,"%6.4f ",Qual_E.Perc);
if( (Flag2=AssessCorr(&QualDssp_E)) )
fprintf(Out,"%6.4f ",QualDssp_E.Corr);
else fprintf(Out," None ");
fprintf(Out,"%6.4f ",QualDssp_E.Perc);
if( Flag1 && Flag2 )
fprintf(Out,"%7.4f ",Qual_E.Corr-QualDssp_E.Corr);
else fprintf(Out," None ");
fprintf(Out,"%7.4f | ",Qual_E.Perc-QualDssp_E.Perc);
fprintf(Out,"%6.4f %6.4f | %6.4f %6.4f | ",Q2_,Q2_Dssp,O_,O_Dssp);
fprintf(Out,"%4d %4d %4d %4d | %4d %4d %4d %4d |%4d %4d %4d %4d |%4d %4d %4d %4d | %s%c %4d %4.2f | %5.3f %5.3f %5.3f",
Qual_H.TP,Qual_H.TN,Qual_H.FP,Qual_H.FN,
QualDssp_H.TP,QualDssp_H.TN,QualDssp_H.FP,QualDssp_H.FN,
Qual_E.TP,Qual_E.TN,Qual_E.FP,Qual_E.FN,
QualDssp_E.TP,QualDssp_E.TN,QualDssp_E.FP,QualDssp_E.FN,
c->File,c->Id,c->NRes,c->Resolution,Content,AlphaCont,BetaCont);
if( El ) {
fprintf(Out," FullH: YYN %2d NYY %2d YNN %2d NNY %2d ",YYN_H,NYY_H,YNN_H,NNY_H);
fprintf(Out," FullE: YYN %2d NYY %2d YNN %2d NNY %2d ",YYN_E,NYY_E,YNN_E,NNY_E);
}
memset(Tmp[0],'C',c->NRes);
memset(Tmp[1],'C',c->NRes);
memset(Tmp[2],'C',c->NRes);
for( i=0; i<c->NRes; i++ ) {
if( Asn[i] == 'H' )
Tmp[0][i] = Asn[i];
if( PdbAsn[i] == 'H' )
Tmp[1][i] = PdbAsn[i];
if( DsspAsn[i] == 'H' )
Tmp[2][i] = DsspAsn[i];
}
ExcludeObvious(Tmp[0],Tmp[2],Tmp[1],c->NRes);
Difference(Tmp[0],Tmp[1],c->NRes,'H',&Qual_H);
fprintf(Out," | ResH: YYN %3d NNY %3d YNN %3d NYY %3d",
Qual_H.TP,Qual_H.TN,Qual_H.FP,Qual_H.FN);
memset(Tmp[0],'C',c->NRes);
memset(Tmp[1],'C',c->NRes);
memset(Tmp[2],'C',c->NRes);
for( i=0; i<c->NRes; i++ ) {
if( Asn[i] == 'E' )
Tmp[0][i] = Asn[i];
if( PdbAsn[i] == 'E' )
Tmp[1][i] = PdbAsn[i];
if( DsspAsn[i] == 'E' )
Tmp[2][i] = DsspAsn[i];
}
ExcludeObvious(Tmp[0],Tmp[2],Tmp[1],c->NRes);
Difference(Tmp[0],Tmp[1],c->NRes,'E',&Qual_E);
fprintf(Out," | ResE: YYN %3d NNY %3d YNN %3d NYY %3d",
Qual_E.TP,Qual_E.TN,Qual_E.FP,Qual_E.FN);
fprintf(Out," | ToH: %2d BtH: %2d WsH: %2d ",Total_H,Better_H,Worse_H);
fprintf(Out," | ToE: %2d BtE: %2d WsE: %2d ",Total_E,Better_E,Worse_E);
fprintf(Out,"PerCor %7.4f PerCorDssp %7.4f\n",PerCor,PerCorDssp);
fprintf(Out,"\n");
/* int Bound[MAX_ASSIGN][2], NElem; */
/* if( !El ) {
* NElem = Boundaries(Asn,c->NRes,'H',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"HELIXSTRIDE %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
*
* NElem = Boundaries(Asn,c->NRes,'E',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"STRANDSTRIDE %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
*
* NElem = Boundaries(PdbAsn,c->NRes,'H',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"HELIXPDB %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
*
* NElem = Boundaries(PdbAsn,c->NRes,'E',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"STRANDPDB %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
*
* NElem = Boundaries(DsspAsn,c->NRes,'H',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"HELIXSDSSP %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
*
* NElem = Boundaries(DsspAsn,c->NRes,'E',Bound);
* for( i=0; i<NElem; i++ )
* fprintf(Out,"STRANDDSSP %4d residues long in %s%c\n",
* Bound[i][1]-Bound[i][0]+1,c->File,c->Id);
* }
*/
free(Asn);
free(PdbAsn);
free(DsspAsn);
}
}
int Presnell(char *Asn1, int L1, char *Asn2, int L2, char SecStr, float Threshold,
float *Q2, float *O)
{
int Boundaries(char *Asn, int L, char SecondStr, int (*Bound)[2]);
int Bound1[MAX_ASSIGN][2], Bound2[MAX_ASSIGN][2], Length1[MAX_ASSIGN],
Length2[MAX_ASSIGN], NSeg1, NSeg2;
int Overlap, MaxOverlap, TP=0, FP=0, FN=0;
register int i, j;
NSeg1 = Boundaries(Asn1,L1,SecStr,Bound1);
NSeg2 = Boundaries(Asn2,L2,SecStr,Bound2);
for(i=0; i<NSeg1; i++)
Length1[i] = Bound1[i][1]-Bound1[i][0]+1;
for(j=0; j<NSeg2; j++)
Length2[j] = Bound2[j][1]-Bound2[j][0]+1;
for(i=0; i<NSeg1; i++) {
MaxOverlap = 0;
for(j=0; j<NSeg2; j++) {
Overlap = Minimum(Bound1[i][1],Bound2[j][1])-Maximum(Bound1[i][0],Bound2[j][0])+1;
if( Overlap > MaxOverlap ) MaxOverlap = Overlap;
}
if( (float)MaxOverlap/(float)Length1[i] >= Threshold )
TP++;
else
FN++;
}
for(i=0; i<NSeg2; i++) {
MaxOverlap = 0;
for(j=0; j<NSeg1; j++) {
Overlap = Minimum(Bound2[i][1],Bound1[j][1])-Maximum(Bound2[i][0],Bound1[j][0])+1;
if( Overlap > MaxOverlap ) MaxOverlap = Overlap;
}
if( (float)MaxOverlap/(float)Length2[i] < Threshold )
FP++;
}
if( TP+FN != 0 ) {
*Q2 = (float)TP/((float)TP+(float)FN);
*O = (float)FP/((float)TP+(float)FN);
}
else {
*Q2 = -1.0;
*O = -1.0;
}
return(1);
}
int Sov(char *Asn1, int L1, char *Asn2, int L2, char SecStr, float Threshold, float *Q2)
{
int Bound1[MAX_ASSIGN][2], Bound2[MAX_ASSIGN][2], Length1[MAX_ASSIGN],
Length2[MAX_ASSIGN], NSeg1, NSeg2;
int Overlap, MaxOverlap, TP=0, FN=0;
register int i, j;
NSeg1 = Boundaries(Asn1,L1,SecStr,Bound1);
NSeg2 = Boundaries(Asn2,L2,SecStr,Bound2);
for(i=0; i<NSeg1; i++)
Length1[i] = Bound1[i][1]-Bound1[i][0]+1;
for(j=0; j<NSeg2; j++)
Length2[j] = Bound2[j][1]-Bound2[j][0]+1;
for(i=0; i<NSeg1; i++) {
MaxOverlap = 0;
for(j=0; j<NSeg2; j++) {
if( Bound1[i][0] > Bound2[j][1] || Bound1[i][1] < Bound2[j][0] ) /*No overlap */
Overlap = 0;
else if ( Bound2[j][0] >= Bound1[i][0] && Bound2[j][1] <= Bound1[i][1] ) /* j inside i */
Overlap = Length2[j];
else if ( Bound1[i][0] <= Bound2[j][0] ) /* j shifted to the right with respect to i */
Overlap = Minimum(Bound2[j][1]-Bound2[j][0],Bound1[i][1]-Bound2[j][0])+1;
else if( Bound1[i][0] >= Bound2[j][0] ) /* i shifted to the right with respect to j */
Overlap = Minimum(Bound2[j][1]-Bound2[j][0],Bound2[j][1]-Bound1[i][0])+1;
else
Overlap = Length1[i]; /* i inside j */
if( Overlap > MaxOverlap ) MaxOverlap = Overlap;
}
if( (float)MaxOverlap/(float)Length1[i] >= Threshold )
TP++;
else
FN++;
}
if( TP+FN != 0 )
*Q2 = (float)TP/((float)TP+(float)FN);
else
*Q2 = -1.0;
/* O = (float)TP/((float)TP+(float)FN);*/
return(1);
}

@ -0,0 +1,204 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <ctype.h>
void *ckalloc(size_t bytes)
{
register void *ret;
void die(char *format, ... );
if( !(ret = malloc(bytes)) ) die("Out of memory\n");
return ret;
}
float **FloatMatrix(int M, int N)
{
int m;
float **Matrix;
Matrix = (float **)ckalloc(M*sizeof(float *));
for( m=0; m<M; m++ ) Matrix[m] = (float *)ckalloc(N*sizeof(float));
return(Matrix);
}
float ***FloatCube(int M, int N, int K)
{
int m, n, k;
float ***Cube;
Cube = (float ***)ckalloc(M*sizeof(float **));
for( m=0; m<M; m++ ) {
Cube[m] = (float **)ckalloc(N*sizeof(float *));
for( n=0; n<N; n++ )
Cube[m][n] = (float *)ckalloc(K*sizeof(float));
}
for( m=0; m<M; m++ )
for( n=0; n<N; n++ )
for( k=0; k<K; k++ )
Cube[m][n][k] = 0.0;
return(Cube);
}
float ****Float4Dim(int M, int N, int K, int L)
{
int m, n, k, l;
float ****FourDim;
FourDim = (float ****)ckalloc(M*sizeof(float ***));
for( m=0; m<M; m++ ) {
FourDim[m] = (float ***)ckalloc(N*sizeof(float **));
for( n=0; n<N; n++ ) {
FourDim[m][n] = (float **)ckalloc(K*sizeof(float*));
for( k=0; k<K; k++ )
FourDim[m][n][k] = (float *)ckalloc(L*sizeof(float));
}
}
for( m=0; m<M; m++ )
for( n=0; n<N; n++ )
for( k=0; k<K; k++ )
for( l=0; l<L; l++ )
FourDim[m][n][k][l] = 0.0;
return(FourDim);
}
void FreeFloatMatrix(float **Matrix, int M)
{
int m;
for( m=0; m<M; m++ ) free(Matrix[m]);
free(Matrix);
}
int ***IntCube(int M, int N, int K)
{
int m, n, k;
int ***Cube;
Cube = (int ***)ckalloc(M*sizeof(int **));
for( m=0; m<M; m++ ) {
Cube[m] = (int **)ckalloc(N*sizeof(int *));
for( n=0; n<N; n++ ) Cube[m][n] = (int *)ckalloc(K*sizeof(int));
}
for( m=0; m<M; m++ )
for( n=0; n<N; n++ )
for( k=0; k<K; k++ )
Cube[m][n][k] = 0;
return(Cube);
}
int **IntMatrix(int M, int N)
{
int m;
int **Matrix;
Matrix = (int **)ckalloc(M*sizeof(int *));
for( m=0; m<M; m++ ) Matrix[m] = (int *)ckalloc(N*sizeof(int));
return(Matrix);
}
int ****Int4Dim(int M, int N, int K, int L)
{
int m, n, k, l;
int ****FourDim;
FourDim = (int ****)ckalloc(M*sizeof(int ***));
for( m=0; m<M; m++ ) {
FourDim[m] = (int ***)ckalloc(N*sizeof(int **));
for( n=0; n<N; n++ ) {
FourDim[m][n] = (int **)ckalloc(K*sizeof(int*));
for( k=0; k<K; k++ )
FourDim[m][n][k] = (int *)ckalloc(L*sizeof(int));
}
}
for( m=0; m<M; m++ )
for( n=0; n<N; n++ )
for( k=0; k<K; k++ )
for( l=0; l<L; l++ )
FourDim[m][n][k][l] = 0;
return(FourDim);
}
void FreeIntMatrix(int **Matrix, int M)
{
int m;
for( m=0; m<M; m++ ) free(Matrix[m]);
free(Matrix);
}
char **CharMatrix(int M, int N)
{
int m;
char **Matrix;
Matrix = (char **)ckalloc(M*sizeof(char *));
for( m=0; m<M; m++ ) Matrix[m] = (char *)ckalloc(N*sizeof(char));
return(Matrix);
}
void FreeCharMatrix(char **Matrix, int M)
{
int m;
for( m=0; m<M; m++ ) free(Matrix[m]);
free(Matrix);
}
void FreeIntCube(int ***Cube, int M, int N)
{
int m, n;
for( m=0; m<M; m++ ) {
for( n=0; n<N; n++ )
free(Cube[m][n]);
free(Cube[m]);
}
free(Cube);
}
void FreeFloatCube(float ***Cube, int M, int N)
{
int m, n;
for( m=0; m<M; m++ ) {
for( n=0; n<N; n++ )
free(Cube[m][n]);
free(Cube[m]);
}
free(Cube);
}

@ -0,0 +1,453 @@
#include "stride.h"
void MergePatternsAntiPar(PATTERN **Pat, int NPat)
{
register int i, j;
int DB, DW, MinDB1, MinDB2, MinDW1, MinDW2, Min, Lnk1A, Lnk1D;
int I1A, I1D, I2A, I2D, J1A, J1D, J2A, J2D;
char I1ACn, I1DCn, I2ACn, I2DCn, J1ACn, J1DCn, J2ACn, J2DCn;
for( i=0; i<NPat; i++ ) {
if( !Pat[i]->ExistPattern ) continue;
MinDB1 = MinDB2 = MinDW1 = MinDW2 = 1000;
Min = ERR;
Lnk1D = Lnk1A = ERR;
Alias(&I1D,&I1A,&I2D,&I2A,&I1DCn,&I1ACn,&I2DCn,&I2ACn,Pat[i]);
for( j=0; j<NPat; j++ ) {
if( i == j || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( Near(I1D,J1D,J1A,I1A,J2A,J2D,I2A,I2D,I1DCn,J1DCn,J1ACn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2D,&Lnk1D,J2A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1D,J1A,J1D,I1A,J2D,J2A,I2A,I2D,I1DCn,J1ACn,J1DCn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2A,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1D,J2D,J2A,I1A,J1A,J1D,I2A,I2D,I1DCn,J2DCn,J2ACn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1D,&Lnk1D,J1A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1D,J2A,J2D,I1A,J1D,J1A,I2A,I2D,I1DCn,J2ACn,J2DCn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1A,&Lnk1D,J1D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1A,J1D,J1A,I1D,J2A,J2D,I2D,I2A,I1ACn,J1DCn,J1ACn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2A,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1A,J1A,J1D,I1D,J2D,J2A,I2D,I2A,I1ACn,J1ACn,J1DCn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2D,&Lnk1D,J2A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1A,J2D,J2A,I1D,J1A,J1D,I2D,I2A,I1ACn,J2DCn,J2ACn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1A,&Lnk1D,J1D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( Near(I1A,J2A,J2D,I1D,J1D,J1A,I2D,I2A,I1ACn,J2ACn,J2DCn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSide(J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1D,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
}
for( j=0; j<NPat; j++ ) {
if( j == Min || j == i || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( Near(I2D,J1D,J1A,I2A,J2A,J2D,I1A,I1D,I2DCn,J1DCn,J1ACn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2D,J1A,J1D,I2A,J2D,J2A,I1A,I1D,I2DCn,J1ACn,J1DCn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2D,J2D,J2A,I2A,J1A,J1D,I1A,I1D,I2DCn,J2DCn,J2ACn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2D,J2A,J2D,I2A,J1D,J1A,I1A,I1D,I2DCn,J2ACn,J2DCn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2A,J1D,J1A,I2D,J2A,J2D,I1D,I1A,I2ACn,J1DCn,J1ACn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2A,J1A,J1D,I2D,J2D,J2A,I1D,I1A,I2ACn,J1ACn,J1DCn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2A,J2D,J2A,I2D,J1A,J1D,I1D,I1A,I2ACn,J2DCn,J2ACn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( Near(I2A,J2A,J2D,I2D,J1D,J1A,I1D,I1A,I2ACn,J2ACn,J2DCn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
}
}
}
void MergePatternsPar(PATTERN **Pat, int NPat)
{
register int i, j;
int DB, DW, MinDB1, MinDB2, MinDW1, MinDW2, Min, Lnk1A, Lnk1D;
int I1A, I1D, I2A, I2D, J1A, J1D, J2A, J2D;
char I1ACn, I1DCn, I2ACn, I2DCn, J1ACn, J1DCn, J2ACn, J2DCn;
for( i=0; i<NPat; i++ ) {
if( !Pat[i]->ExistPattern ) continue;
MinDB1 = MinDB2 = MinDW1 = MinDW2 = 1000;
Min = ERR;
Lnk1D = Lnk1A = ERR;
Alias(&I1D,&I1A,&I2D,&I2A,&I1DCn,&I1ACn,&I2DCn,&I2ACn,Pat[i]);
for( j=0; j<NPat; j++ ) {
if( i == j || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( NearPar(I1D,J1D,J1A,I1A,J2A,J2D,I2A,I2D,I1DCn,J1DCn,J1ACn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2D,&Lnk1D,J2A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1D,J1A,J1D,I1A,J2D,J2A,I2A,I2D,I1DCn,J1ACn,J1DCn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2A,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1D,J2D,J2A,I1A,J1A,J1D,I2A,I2D,I1DCn,J2DCn,J2ACn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1D,&Lnk1D,J1A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1D,J2A,J2D,I1A,J1D,J1A,I2A,I2D,I1DCn,J2ACn,J2DCn,I1ACn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1A,&Lnk1D,J1D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1A,J1D,J1A,I1D,J2A,J2D,I2D,I2A,I1ACn,J1DCn,J1ACn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2A,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1A,J1A,J1D,I1D,J2D,J2A,I2D,I2A,I1ACn,J1ACn,J1DCn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J2D,&Lnk1D,J2A,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1A,J2D,J2A,I1D,J1A,J1D,I2D,I2A,I1ACn,J2DCn,J2ACn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1A,&Lnk1D,J1D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
if( NearPar(I1A,J2A,J2D,I1D,J1D,J1A,I2D,I2A,I1ACn,J2ACn,J2DCn,I1DCn,&DB,&DW) &&
((DB < MinDB1 && DW <= MinDW1) || (DB <= MinDB1 && DW < MinDW1) ) &&
RightSidePar(J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighbours(&Lnk1A,J1D,&Lnk1D,J2D,&Pat[i]->Nei1,Pat[j],&MinDB1,DB,&MinDW1,DW,&Min,j);
}
for( j=0; j<NPat; j++ ) {
if( j == Min || j == i || !Pat[j]->ExistPattern ) continue;
Alias(&J1D,&J1A,&J2D,&J2A,&J1DCn,&J1ACn,&J2DCn,&J2ACn,Pat[j]);
if( NearPar(I2D,J1D,J1A,I2A,J2A,J2D,I1A,I1D,I2DCn,J1DCn,J1ACn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2D,J1A,J1D,I2A,J2D,J2A,I1A,I1D,I2DCn,J1ACn,J1DCn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2D,J2D,J2A,I2A,J1A,J1D,I1A,I1D,I2DCn,J2DCn,J2ACn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2D,J2A,J2D,I2A,J1D,J1A,I1A,I1D,I2DCn,J2ACn,J2DCn,I2ACn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2A,J1D,J1A,I2D,J2A,J2D,I1D,I1A,I2ACn,J1DCn,J1ACn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2D,J2A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2A,J1A,J1D,I2D,J2D,J2A,I1D,I1A,I2ACn,J1ACn,J1DCn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J2A,J2D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2A,J2D,J2A,I2D,J1A,J1D,I1D,I1A,I2ACn,J2DCn,J2ACn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1D,J1A,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
if( NearPar(I2A,J2A,J2D,I2D,J1D,J1A,I1D,I1A,I2ACn,J2ACn,J2DCn,I2DCn,&DB,&DW) &&
(( DB < MinDB2 && DW <= MinDW2) || (DB <= MinDB2 && DW < MinDW2) ) &&
RightSide2(Lnk1A,Lnk1D,J1A,J1D,I1A,I1D,I2A,I2D) )
JoinNeighb(&Pat[i]->Nei2,Pat[j],&MinDB2,DB,&MinDW2,DW);
}
}
}
int RightSide2(int L_A1, int L_D1, int LnkD, int LnkA, int I1A, int I1D, int I2A, int I2D)
{
if( ( I2A < I1D && LnkA <= I1D && LnkA <= I2A ) ||
( I2A > I1D && LnkA >= I1D && LnkA >= I2A ) ||
( I2D < I1A && LnkD <= I1A && LnkA <= I2D ) ||
( I2D > I1A && LnkD >= I1A && LnkD >= I2D ) )
return(SUCCESS);
else
if( I2A == I1D && I2D == I1A ) {
if( L_A1 != ERR &&
( ( LnkD <= I2D && L_A1 <= I2D && LnkA >= I2A && L_D1 >= I2A ) ||
( LnkD >= I2D && L_A1 >= I2D && LnkA <= I2A && L_D1 <= I2A ) ) )
return(FAILURE);
else
return(SUCCESS);
}
return(FAILURE);
}
int RightSide(int LnkA, int LnkD, int I1A, int I1D, int I2A, int I2D )
{
if( ( I1A == I2D && I1D == I2A ) ||
( I1A < I2D && LnkA <= I2D && LnkA <= I1A ) ||
( I1A > I2D && LnkA >= I2D && LnkA >= I1A ) ||
( I1D < I2A && LnkD <= I2A && LnkD <= I1D ) ||
( I1D > I2A && LnkD >= I2A && LnkD >= I1D ) )
return(SUCCESS);
return(FAILURE);
}
int RightSidePar(int LnkA, int LnkD, int I1A, int I1D, int I2A, int I2D )
{
if( ( I1A == I2D && I1D == I2A ) ||
( I1A < I2D && LnkA < I2D && LnkA <= I1A && I1D <= I2A && LnkD <= I2A && LnkD <= I1D ) ||
( I1A > I2D && LnkA > I2D && LnkA >= I1A && I1D >= I2A && LnkD >= I2A && LnkD >= I1D ) ||
( I1D < I2A && LnkD < I2A && LnkD <= I1D && I1A <= I2D && LnkA <= I2D && LnkA <= I1A ) ||
( I1D > I2A && LnkD > I2A && LnkD >= I1D && I1A >= I2D && LnkA >= I2D && LnkA >= I1A) )
return(SUCCESS);
return(FAILURE);
}
void JoinNeighbours(int *Lnk1A, int Res1, int *Lnk1D, int Res2, PATTERN **Nei,
PATTERN *Pat, int *MinDB1, int DB, int *MinDW1, int DW, int *Min, int j)
{
*Lnk1A = Res1;
*Lnk1D = Res2;
(*Nei) = Pat;
*MinDB1 = DB;
*MinDW1 = DW;
*Min = j;
}
void JoinNeighb(PATTERN **Nei, PATTERN *Pat, int *MinDB2, int DB, int *MinDW2, int DW)
{
(*Nei) = Pat;
*MinDB2 = DB;
*MinDW2 = DW;
}
int NearPar(int Res1, int Res2, int Res3, int Res4, int Res5, int Res6, int Res7, int Res8,
char Cn1, char Cn2, char Cn3, char Cn4, int *DistBest, int *DistWorst)
{
/*
Res5 Res2 Res1
Res6 Res3 Res4
*/
int a, b, c1, d1, c, d, Nei1, Nei2;
if( Cn1 != Cn2 || Cn3 != Cn4 ) return(FAILURE);
if( Res1 >= Res2 && Res2 >= Res5 && Res7 >= Res1 &&
Res4 >= Res3 && Res4 >= Res6 && Res8 >= Res4 ) {
if( Res5 == Res2 )
Nei1 = Res2;
else
Nei1 = Res2-1;
if( Res1 == Res7 )
Nei2 = Res1;
else
Nei2 = Res1+1;
a = Nei2-Nei1;
c1 = Nei2-Res5;
if( Res3 == Res6 )
Nei1 = Res3;
else
Nei1 = Res3-1;
if( Res4 == Res8 )
Nei2 = Res4;
else
Nei2 = Res4+1;
b = Nei2-Nei1;
d1 = Nei2-Res6;
}
else
if( Res1 <= Res2 && Res2 <= Res5 && Res7 <= Res1 &&
Res4 <= Res3 && Res4 <= Res6 && Res8 <= Res4 ) {
if( Res5 == Res2 )
Nei1 = Res2;
else
Nei1 = Res2+1;
if( Res1 == Res7 )
Nei2 = Res1;
else
Nei2 = Res1-1;
a = Nei1-Nei2;
c1 = Res1-Res7;
if( Res3 == Res6 )
Nei1 = Res3;
else
Nei1 = Res3+1;
if( Res4 == Res8 )
Nei2 = Res4;
else
Nei2 = Res4-1;
b = Nei1-Nei2;
d1 = Nei1-Res8;
}
else
return(FAILURE);
c = Maximum(c1,a);
d = Maximum(d1,b);
if( a >= 0 && b >= 0 && c >= 0 && d >= 0 &&
( (a <= 2 && b <= 5) || (a <= 5 && b <= 2) ) ) {
*DistBest = Minimum(a,b);
*DistWorst = Maximum(c,d);
if( *DistBest <= *DistWorst )
return(SUCCESS);
else
return(FAILURE);
}
return(FAILURE);
}
int Near(int Res1, int Res2, int Res3, int Res4, int Res5, int Res6, int Res7, int Res8,
char Cn1, char Cn2, char Cn3, char Cn4, int *DistBest, int *DistWorst)
{
/*
Res5 Res2 Res1
Res6 Res3 Res4
*/
int a, b, c1, d1, c, d, Nei1, Nei2;
if( Cn1 != Cn2 || Cn3 != Cn4 ) return(FAILURE);
if( Res1 >= Res2 && Res2 >= Res5 && Res7 >= Res1 &&
Res4 <= Res3 && Res4 <= Res6 && Res8 <= Res4 ) {
if( Res5 == Res2 )
Nei1 = Res2;
else
Nei1 = Res2-1;
if( Res1 == Res7 )
Nei2 = Res1;
else
Nei2 = Res1+1;
a = Nei2-Nei1;
c1 = Nei2-Res5;
if( Res3 == Res6 )
Nei1 = Res3;
else
Nei1 = Res3+1;
if( Res4 == Res8 )
Nei2 = Res4;
else
Nei2 = Res4-1;
b = Nei1-Nei2;
d1 = Res6-Nei2;
}
else
return(FAILURE);
c = Maximum(c1,a);
d = Maximum(d1,b);
if( a >= 0 && b >= 0 && c >= 0 && d >= 0 &&
( (a <= 2 && b <= 5) || (a <= 5 && b <= 2) ) ) {
*DistBest = Minimum(a,b);
*DistWorst = Maximum(c,d);
if( *DistBest <= *DistWorst )
return(SUCCESS);
else
return(FAILURE);
}
return(FAILURE);
}

@ -0,0 +1,72 @@
#include "stride.h"
int MolScript(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
int HelixBound[MAX_ASSIGN][2], SheetBound[MAX_ASSIGN][2], CoilBound[MAX_ASSIGN][2];
int NHelix, NSheet, NCoil, i, Cn;
char *Asn;
FILE *fi;
if( !(fi = fopen(Cmd->MolScriptFile,"w")) )
return(escape(FAILURE,"\nCan not open molscript file %s\n\n",Cmd->MolScriptFile));
fprintf(fi,"plot\n");
fprintf(fi,"read mol \"%s\";\n",Chain[0]->File);
fprintf(fi,"transform atom * by centre position in amino-acids\n");
fprintf(fi,"by rotation z 0.0 \n");
fprintf(fi,"by rotation y -260.0 \n");
fprintf(fi,"by rotation x -40.0;\n");
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
Asn = (char *)ckalloc(Chain[Cn]->NRes*sizeof(char));
ExtractAsn(Chain,Cn,Asn);
for( i=0; i<Chain[Cn]->NRes; i++ )
if( Asn[i] != 'H' && Asn[i] != 'E' )
Asn[i] = 'C';
NHelix = Boundaries(Asn,Chain[Cn]->NRes,'H',HelixBound);
NSheet = Boundaries(Asn,Chain[Cn]->NRes,'E',SheetBound);
NCoil = Boundaries(Asn,Chain[Cn]->NRes,'C',CoilBound);
free(Asn);
for( i=0; i<NSheet; i++ )
if( SheetBound[i][1] != Chain[Cn]->NRes-1 )
SheetBound[i][1]++;
for( i=0; i<NHelix; i++ )
if( HelixBound[i][1] != Chain[Cn]->NRes-1 )
HelixBound[i][1]++;
for( i=0; i<NCoil; i++ )
if( CoilBound[i][1] != Chain[Cn]->NRes-1 )
CoilBound[i][1]++;
for( i=0; i<NHelix; i++ )
fprintf(fi,"helix from %c%s to %c%s;\n",
Chain[Cn]->Id,Chain[Cn]->Rsd[HelixBound[i][0]]->PDB_ResNumb,
Chain[Cn]->Id,Chain[Cn]->Rsd[HelixBound[i][1]]->PDB_ResNumb);
for( i=0; i<NSheet; i++ )
fprintf(fi,"strand from %c%s to %c%s;\n",
Chain[Cn]->Id,Chain[Cn]->Rsd[SheetBound[i][0]]->PDB_ResNumb,
Chain[Cn]->Id,Chain[Cn]->Rsd[SheetBound[i][1]]->PDB_ResNumb);
for( i=0; i<NCoil; i++ )
fprintf(fi,"coil from %c%s to %c%s;\n",
Chain[Cn]->Id,Chain[Cn]->Rsd[CoilBound[i][0]]->PDB_ResNumb,
Chain[Cn]->Id,Chain[Cn]->Rsd[CoilBound[i][1]]->PDB_ResNumb);
}
fprintf(fi,"end_plot\n");
fclose(fi);
return(SUCCESS);
}

879
nsc.c

@ -0,0 +1,879 @@
/*
*
* program NSC
* version 1.0 (April 1994)
*
* Author: Frank Eisenhaber
*
* For user notes see file nsc.h !!
*
* Copyright Notice:
* All rights reserved, whether the whole or part of the program is
* concerned. The software may not be used without specific, prior
* written permission of the author.
*
* An academic licence agreement for the package ASC/GM or its parts
* is granted if you make the following commitments:
* 1) In using this software, the user will respect the interests of
* the author.
* 2) The use of the software in commercial activities is not allowed
* without a prior written commercial licence agreement. The program
* will not be used in classified research.
* 3) Other interested research groups will be redirected
* to the author. The user will not redistribute the code outside
* his immediate research group.
* 4) The copyright messages will not be modified or suppressed.
* 5) The reference given below will be cited in any publication
* of scientific results based in part or completely on use of the
* program.
* 6) Bugs will be reported to the author.
*
* Permission to use, copy, and modify this software and
* its documentation is hereby granted without fee for
* academic use, provided
* that the above copyright notices and this permission notice appear in
* all copies of the software and related documentation.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
* ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
*
* contact address : European Molecular Biology Laboratory
* Biocomputing Unit
* Meyerhofstr. 1
* Postfach 10.2209
* D-69012 Heidelberg
* Federal Republic of Germany
*
*
*
* E-mail : IN%"EISENHABER@EMBL-Heidelberg.DE"
* Please send your contact address to get information on updates and
* new features. Questions will be answered as soon as possible.
*
*
* references :
* 1.F.Eisenhaber, P.Lijnzaad, P.Argos, M.Scharf
* "The Double Cubic Lattice Method: Efficient Approaches to
* Numerical Integration of Surface Area and Volume and to Dot
* Surface Contouring of Molecular Assemblies"
* Journal of Computational Chemistry (1994) submitted
* 2.F.Eisenhaber, P.Argos
* "Improved Strategy in Analytic Surface Calculation for Molecular
* Systems: Handling of Singularities and Computational Efficiency"
* Journal of Computational Chemistry (1993) v.14, N11, pp-1272-1280
*
*/
#include "stride.h"
#define TEST_NSC 0
#define TEST_ARC 0
#define TEST_DOD 0
#define TEST_CUBE 0
#define UNSP_ICO_DOD 9
#define UNSP_ICO_ARC 10
#define PI 3.14159265358979323846
#define HALFPI 1.57079632679489661923
typedef double * point_double;
typedef int * point_int;
point_double xpunsp=NULL;
double del_cube;
point_int ico_wk=NULL, ico_pt=NULL;
int n_dot, ico_cube, last_n_dot=0, last_densit=0, last_unsp=0;
int last_cubus=0;
#define FOURPI (4.*PI)
#define TORAD(A) ((A)*0.017453293)
#define DP_TOL 0.001
#define MAXIMUM(A, B) (((A) > (B) ? (A) : (B)))
#define MINIMUM(A, B) (((A) < (B) ? (A) : (B)))
#define UPDATE_FL __file__=__FILE__,__line__=__LINE__
char * __file__; /* declared versions of macros */
int __line__; /* __FILE__ and __LINE__ */
#define ERROR UPDATE_FL,error
void error(const char *fmt, ...) {
va_list args;
fprintf(stderr,
"\n---> ERROR when executing line %i in file %s !\n",
__line__,__file__);
va_start(args,fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, "\n---> Execution stopped !\n\n");
}
#define WARNING UPDATE_FL,warning
void warning(const char *fmt, ...) {
va_list args;
fprintf(stderr,
"\n---> WARNING : line %i in file %s\n",
__line__,__file__);
va_start(args,fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, " ...!\n\n");
fflush(stderr);
fflush(stdout);
}
#define ASIN safe_asin
double safe_asin(double f) {
if ( (fabs(f) < 1.00) ) return( asin(f) );
if ( (fabs(f) - 1.00) < DP_TOL ) return(HALFPI);
else ERROR("ASIN : invalid argument %f", f);
return(0.0);
}
#define CALLOC(n, size) mycalloc(__FILE__,__LINE__, n, size)
void * mycalloc(const char * filename, const int linenr,
size_t nelem, size_t elsize) {
int * ip;
ip = (int *) calloc(nelem, elsize);
if(ip) return(ip);
else ERROR("CALLOC : failed in file %s at line %d", filename, linenr);
return(void *)ip;
}
#define REALLOC(ptr, size) myrealloc(__FILE__,__LINE__, ptr, size)
void * myrealloc(const char * filename, const int linenr,
void * ptr, size_t size) {
int * ip;
ip = (int *) realloc(ptr, size);
if(ip) return(ip);
else ERROR("REALLOC : failed in file %s at line %d", filename, linenr);
return(void*)ip;
}
/* routines for dot distributions on the surface of the unit sphere */
double rg, rh;
void icosaeder_vertices(double *xus) {
rh = sqrt(1.-2.*cos(TORAD(72.)))/(1.-cos(TORAD(72.)));
rg = cos(TORAD(72.))/(1.-cos(TORAD(72.)));
/* icosaeder vertices */
xus[ 0] = 0.; xus[ 1] = 0.; xus[ 2] = 1.;
xus[ 3] = rh*cos(TORAD(72.)); xus[ 4] = rh*sin(TORAD(72.)); xus[ 5] = rg;
xus[ 6] = rh*cos(TORAD(144.)); xus[ 7] = rh*sin(TORAD(144.)); xus[ 8] = rg;
xus[ 9] = rh*cos(TORAD(216.)); xus[10] = rh*sin(TORAD(216.)); xus[11] = rg;
xus[12] = rh*cos(TORAD(288.)); xus[13] = rh*sin(TORAD(288.)); xus[14] = rg;
xus[15] = rh; xus[16] = 0; xus[17] = rg;
xus[18] = rh*cos(TORAD(36.)); xus[19] = rh*sin(TORAD(36.)); xus[20] = -rg;
xus[21] = rh*cos(TORAD(108.)); xus[22] = rh*sin(TORAD(108.)); xus[23] = -rg;
xus[24] = -rh; xus[25] = 0; xus[26] = -rg;
xus[27] = rh*cos(TORAD(252.)); xus[28] = rh*sin(TORAD(252.)); xus[29] = -rg;
xus[30] = rh*cos(TORAD(324.)); xus[31] = rh*sin(TORAD(324.)); xus[32] = -rg;
xus[33] = 0.; xus[34] = 0.; xus[35] = -1.;
}
void divarc(double x1, double y1, double z1,
double x2, double y2, double z2,
int div1, int div2, double *xr, double *yr, double *zr) {
double xd, yd, zd, dd, d1, d2, s, x, y, z;
double phi, sphi, cphi;
xd = y1*z2-y2*z1;
yd = z1*x2-z2*x1;
zd = x1*y2-x2*y1;
dd = sqrt(xd*xd+yd*yd+zd*zd);
if (dd < DP_TOL) ERROR("divarc: rotation axis of length %f", dd);
d1 = x1*x1+y1*y1+z1*z1;
if (d1 < 0.5) ERROR("divarc: vector 1 of sq.length %f", d1);
d2 = x2*x2+y2*y2+z2*z2;
if (d2 < 0.5) ERROR("divarc: vector 2 of sq.length %f", d2);
phi = ASIN(dd/sqrt(d1*d2));
phi = phi*((double)div1)/((double)div2);
sphi = sin(phi); cphi = cos(phi);
s = (x1*xd+y1*yd+z1*zd)/dd;
x = xd*s*(1.-cphi)/dd + x1 * cphi + (yd*z1-y1*zd)*sphi/dd;
y = yd*s*(1.-cphi)/dd + y1 * cphi + (zd*x1-z1*xd)*sphi/dd;
z = zd*s*(1.-cphi)/dd + z1 * cphi + (xd*y1-x1*yd)*sphi/dd;
dd = sqrt(x*x+y*y+z*z);
*xr = x/dd; *yr = y/dd; *zr = z/dd;
}
int ico_dot_arc(int densit) { /* densit...required dots per unit sphere */
/* dot distribution on a unit sphere based on an icosaeder *
* great circle average refining of icosahedral face */
int i, j, k, tl, tl2, tn, tess;
double a, d, x, y, z, x2, y2, z2, x3, y3, z3;
double xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
xjk, yjk, zjk, xkj, ykj, zkj;
point_double xus=NULL;
/* calculate tessalation level */
a = sqrt((((double) densit)-2.)/10.);
tess = (int) ceil(a);
n_dot = 10*tess*tess+2;
if (n_dot < densit) {
ERROR("ico_dot_arc: error in formula for tessalation level (%d->%d, %d)",
tess, n_dot, densit);
}
xus = (double *) CALLOC(3*n_dot, sizeof(double));
xpunsp = xus;
icosaeder_vertices(xus);
if (tess > 1) {
tn = 12;
a = rh*rh*2.*(1.-cos(TORAD(72.)));
/* calculate tessalation of icosaeder edges */
for (i=0; i<11; i++) {
for (j=i+1; j<12; j++) {
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
for (tl=1; tl<tess; tl++) {
if (tn >= n_dot) { ERROR("ico_dot: tn exceeds dimension of xus"); }
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
tn++;
}
}
}
/* calculate tessalation of icosaeder faces */
for (i=0; i<10; i++) {
for (j=i+1; j<11; j++) {
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
for (k=j+1; k<12; k++) {
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
for (tl=1; tl<tess-1; tl++) {
divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
xus[3*i], xus[1+3*i], xus[2+3*i],
tl, tess, &xji, &yji, &zji);
divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
xus[3*i], xus[1+3*i], xus[2+3*i],
tl, tess, &xki, &yki, &zki);
for (tl2=1; tl2<tess-tl; tl2++) {
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl2, tess, &xij, &yij, &zij);
divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl2, tess, &xkj, &ykj, &zkj);
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*k], xus[1+3*k], xus[2+3*k],
tess-tl-tl2, tess, &xik, &yik, &zik);
divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
xus[3*k], xus[1+3*k], xus[2+3*k],
tess-tl-tl2, tess, &xjk, &yjk, &zjk);
if (tn >= n_dot) ERROR("ico_dot: tn exceeds dimension of xus");
divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
&x, &y, &z);
divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
&x2, &y2, &z2);
divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
&x3, &y3, &z3);
x = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
d = sqrt(x*x+y*y+z*z);
xus[3*tn] = x/d;
xus[1+3*tn] = y/d;
xus[2+3*tn] = z/d;
tn++;
} /* cycle tl2 */
} /* cycle tl */
} /* cycle k */
} /* cycle j */
} /* cycle i */
if (n_dot != tn) {
ERROR("ico_dot: n_dot(%d) and tn(%d) differ", n_dot, tn);
}
} /* end of if (tess > 1) */
return n_dot;
} /* end of routine ico_dot_arc */
int ico_dot_dod(int densit) { /* densit...required dots per unit sphere */
/* dot distribution on a unit sphere based on an icosaeder *
* great circle average refining of icosahedral face */
int i, j, k, tl, tl2, tn, tess, j1, j2;
double a, d, x, y, z, x2, y2, z2, x3, y3, z3, ai_d, adod;
double xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
xjk, yjk, zjk, xkj, ykj, zkj;
point_double xus=NULL;
/* calculate tesselation level */
a = sqrt((((double) densit)-2.)/30.);
tess = MAXIMUM((int) ceil(a), 1);
n_dot = 30*tess*tess+2;
if (n_dot < densit) {
ERROR("ico_dot_dod: error in formula for tessalation level (%d->%d, %d)",
tess, n_dot, densit);
}
xus = (double *) CALLOC(3*n_dot, sizeof(double));
xpunsp = xus;
icosaeder_vertices(xus);
tn=12;
/* square of the edge of an icosaeder */
a = rh*rh*2.*(1.-cos(TORAD(72.)));
/* dodecaeder vertices */
for (i=0; i<10; i++) {
for (j=i+1; j<11; j++) {
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
for (k=j+1; k<12; k++) {
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
x = xus[ 3*i]+xus[ 3*j]+xus[ 3*k];
y = xus[1+3*i]+xus[1+3*j]+xus[1+3*k];
z = xus[2+3*i]+xus[2+3*j]+xus[2+3*k];
d = sqrt(x*x+y*y+z*z);
xus[3*tn]=x/d; xus[1+3*tn]=y/d; xus[2+3*tn]=z/d;
tn++;
}
}
}
if (tess > 1) {
tn = 32;
/* square of the edge of an dodecaeder */
adod = 4.*(cos(TORAD(108.))-cos(TORAD(120.)))/(1.-cos(TORAD(120.)));
/* square of the distance of two adjacent vertices of ico- and dodecaeder */
ai_d = 2.*(1.-sqrt(1.-a/3.));
/* calculate tessalation of mixed edges */
for (i=0; i<31; i++) {
j1 = 12; j2 = 32; a = ai_d;
if (i>=12) { j1=i+1; a = adod; }
for (j=j1; j<j2; j++) {
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
if (fabs(a-d) > DP_TOL) continue;
for (tl=1; tl<tess; tl++) {
if (tn >= n_dot) {
ERROR("ico_dot: tn exceeds dimension of xus");
}
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
tn++;
}
}
}
/* calculate tessalation of pentakisdodecahedron faces */
for (i=0; i<12; i++) {
for (j=12; j<31; j++) {
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
if (fabs(ai_d-d) > DP_TOL) continue;
for (k=j+1; k<32; k++) {
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(ai_d-d) > DP_TOL) continue;
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
if (fabs(adod-d) > DP_TOL) continue;
for (tl=1; tl<tess-1; tl++) {
divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
xus[3*i], xus[1+3*i], xus[2+3*i],
tl, tess, &xji, &yji, &zji);
divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
xus[3*i], xus[1+3*i], xus[2+3*i],
tl, tess, &xki, &yki, &zki);
for (tl2=1; tl2<tess-tl; tl2++) {
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl2, tess, &xij, &yij, &zij);
divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
xus[3*j], xus[1+3*j], xus[2+3*j],
tl2, tess, &xkj, &ykj, &zkj);
divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
xus[3*k], xus[1+3*k], xus[2+3*k],
tess-tl-tl2, tess, &xik, &yik, &zik);
divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
xus[3*k], xus[1+3*k], xus[2+3*k],
tess-tl-tl2, tess, &xjk, &yjk, &zjk);
if (tn >= n_dot) {
ERROR("ico_dot: tn exceeds dimension of xus");
}
divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
&x, &y, &z);
divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
&x2, &y2, &z2);
divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
&x3, &y3, &z3);
x = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
d = sqrt(x*x+y*y+z*z);
xus[3*tn] = x/d;
xus[1+3*tn] = y/d;
xus[2+3*tn] = z/d;
tn++;
} /* cycle tl2 */
} /* cycle tl */
} /* cycle k */
} /* cycle j */
} /* cycle i */
if (n_dot != tn) {
ERROR("ico_dot: n_dot(%d) and tn(%d) differ", n_dot, tn);
}
} /* end of if (tess > 1) */
return n_dot;
} /* end of routine ico_dot_dod */
int unsp_type(int densit) {
int i1, i2;
i1 = 1;
while (10*i1*i1+2 < densit) i1++;
i2 = 1;
while (30*i2*i2+2 < densit) i2++;
if (10*i1*i1-2 < 30*i2*i2-2) return UNSP_ICO_ARC;
else return UNSP_ICO_DOD;
}
int make_unsp(int densit, int mode, int * num_dot, int cubus) {
int ndot, ico_cube_cb, i, j, k, l, ijk, tn, tl, tl2;
point_double xus;
point_int work;
double x, y, z;
if (xpunsp) free(xpunsp); if (ico_wk) free(ico_wk);
k=1; if (mode < 0) { k=0; mode = -mode; }
if (mode == UNSP_ICO_ARC) { ndot = ico_dot_arc(densit); }
else if (mode == UNSP_ICO_DOD) { ndot = ico_dot_dod(densit); }
else {
WARNING("make_unsp: mode %c%d not allowed", (k) ? '+':'-',mode);
return 1;
}
last_n_dot = ndot; last_densit = densit; last_unsp = mode;
*num_dot=ndot; if (k) return 0;
/* in the following the dots of the unit sphere may be resorted */
last_unsp = -last_unsp;
/* determine distribution of points in elementary cubes */
if (cubus) {
ico_cube = cubus;
}
else {
last_cubus = 0;
i=1;
while (i*i*i*2 < ndot) i++;
ico_cube = MAXIMUM(i-1, 0);
}
ico_cube_cb = ico_cube*ico_cube*ico_cube;
del_cube=2./((double)ico_cube);
work = (int *) CALLOC(ndot, sizeof(int));
xus = xpunsp;
for (l=0; l<ndot; l++) {
i = MAXIMUM((int) floor((1.+xus[3*l])/del_cube), 0);
if (i>=ico_cube) i = ico_cube-1;
j = MAXIMUM((int) floor((1.+xus[1+3*l])/del_cube), 0);
if (j>=ico_cube) j = ico_cube-1;
k = MAXIMUM((int) floor((1.+xus[2+3*l])/del_cube), 0);
if (k>=ico_cube) k = ico_cube-1;
ijk = i+j*ico_cube+k*ico_cube*ico_cube;
work[l] = ijk;
}
ico_wk = (int *) CALLOC(2*ico_cube_cb+1, sizeof(int));
ico_pt = ico_wk+ico_cube_cb;
for (l=0; l<ndot; l++) {
ico_wk[work[l]]++; /* dots per elementary cube */
}
/* reordering of the coordinate array in accordance with box number */
tn=0;
for (i=0; i<ico_cube; i++) {
for (j=0; j<ico_cube; j++) {
for (k=0; k<ico_cube; k++) {
tl=0;
tl2 = tn;
ijk = i+ico_cube*j+ico_cube*ico_cube*k;
*(ico_pt+ijk) = tn;
for (l=tl2; l<ndot; l++) {
if (ijk == work[l]) {
x = xus[3*l]; y = xus[1+3*l]; z = xus[2+3*l];
xus[3*l] = xus[3*tn];
xus[1+3*l] = xus[1+3*tn]; xus[2+3*l] = xus[2+3*tn];
xus[3*tn] = x; xus[1+3*tn] = y; xus[2+3*tn] = z;
ijk = work[l]; work[l]=work[tn]; work[tn]=ijk;
tn++; tl++;
}
}
*(ico_wk+ijk) = tl;
} /* cycle k */
} /* cycle j */
} /* cycle i */
free(work); return 0;
}
typedef struct _stwknb {
double x;
double y;
double z;
double dot;
} Neighb;
int nsc_dclm(
double *co, double *radius, int nat,
int densit, int mode,
double *value_of_area, double **at_area,
double *value_of_vol,
double **lidots, int *nu_dots) {
int iat, i, ii, iii, ix, iy, iz, ixe, ixs, iye, iys, ize, izs, i_ac;
int jat, j, jj, jjj, jx, jy, jz;
int distribution;
int l;
int maxnei, nnei, last, maxdots;
point_int wkdot=NULL, wkbox=NULL, wkat1=NULL, wkatm=NULL;
Neighb *wknb, *ctnb;
int iii1, iii2, iiat, lfnr, i_at, j_at;
double dx, dy, dz, dd, ai, aisq, ajsq, aj, as, a;
double xi, yi, zi, xs=0., ys=0., zs=0.;
double dotarea, area, vol=0.;
point_double xus, dots=NULL, atom_area=NULL;
int nxbox, nybox, nzbox, nxy, nxyz;
double xmin, ymin, zmin, xmax, ymax, zmax, ra2max, d, *pco;
distribution = unsp_type(densit);
if (distribution != -last_unsp || last_cubus != 4 ||
(densit != last_densit && densit != last_n_dot)) {
if (make_unsp(densit, (-distribution), &n_dot, 4)) return 1;
}
xus = xpunsp;
dotarea = FOURPI/(double) n_dot;
area = 0.;
#if TEST_CUBE
printf("nsc_dclm: n_dot=%5d %9.3f\n", n_dot, dotarea);
#endif
/* start with neighbour list */
/* calculate neighbour list with the box algorithm */
if (nat==0) {
WARNING("nsc_dclm: no surface atoms selected");
return 1;
}
if (mode & FLAG_VOLUME) vol=0.;
if (mode & FLAG_DOTS) {
maxdots = 3*n_dot*nat/10;
dots = (double *) CALLOC(maxdots, sizeof(double));
lfnr=0;
}
if (mode & FLAG_ATOM_AREA) {
atom_area = (double *) CALLOC(nat, sizeof(double));
}
/* dimensions of atomic set, cell edge is 2*ra_max */
xmin = co[0]; xmax = xmin; xs=xmin;
ymin = co[1]; ymax = ymin; ys=ymin;
zmin = co[2]; zmax = zmin; zs=zmin;
ra2max = radius[0];
for (iat=1; iat<nat; iat++) {
pco = co+3*iat;
xmin = MINIMUM(xmin, *pco); xmax = MAXIMUM(xmax, *pco);
ymin = MINIMUM(ymin, *(pco+1)); ymax = MAXIMUM(ymax, *(pco+1));
zmin = MINIMUM(zmin, *(pco+2)); zmax = MAXIMUM(zmax, *(pco+2));
xs= xs+ *pco; ys = ys+ *(pco+1); zs= zs+ *(pco+2);
ra2max = MAXIMUM(ra2max, radius[iat]);
}
xs = xs/ (double) nat;
ys = ys/ (double) nat;
zs = zs/ (double) nat;
ra2max = 2.*ra2max;
#if TEST_CUBE
printf("nsc_dclm: n_dot=%5d ra2max=%9.3f %9.3f\n", n_dot, ra2max, dotarea);
#endif
d = xmax-xmin; nxbox = (int) MAXIMUM(ceil(d/ra2max), 1.);
d = (((double)nxbox)*ra2max-d)/2.;
xmin = xmin-d; xmax = xmax+d;
d = ymax-ymin; nybox = (int) MAXIMUM(ceil(d/ra2max), 1.);
d = (((double)nybox)*ra2max-d)/2.;
ymin = ymin-d; ymax = ymax+d;
d = zmax-zmin; nzbox = (int) MAXIMUM(ceil(d/ra2max), 1.);
d = (((double)nzbox)*ra2max-d)/2.;
zmin = zmin-d; zmax = zmax+d;
nxy = nxbox*nybox;
nxyz = nxy*nzbox;
/* box number of atoms */
wkatm = (int *) CALLOC(3*nat, sizeof(int));
wkat1 = wkatm+nat;
wkdot = (int *) CALLOC(n_dot+nxyz+1, sizeof(int));
wkbox = wkdot+n_dot;
for (iat=0; iat<nat; iat++) {
pco = co+3*iat;
i = (int) MAXIMUM(floor(( *pco -xmin)/ra2max), 0); i = MINIMUM(i,nxbox-1);
j = (int) MAXIMUM(floor((*(pco+1)-ymin)/ra2max), 0); j = MINIMUM(j,nybox-1);
l = (int) MAXIMUM(floor((*(pco+2)-zmin)/ra2max), 0); l = MINIMUM(l,nzbox-1);
i = i+j*nxbox+l*nxy;
wkat1[iat] = i; wkbox[i]++;
}
/* sorting of atoms in accordance with box numbers */
j = wkbox[0]; for (i=1; i<nxyz; i++) j= MAXIMUM(wkbox[i], j);
for (i=1; i<=nxyz; i++) wkbox[i] += wkbox[i-1];
/*
maxnei = (int) floor(ra2max*ra2max*ra2max*0.5);
*/
maxnei = MINIMUM(nat, 27*j);
wknb = (Neighb *) CALLOC(maxnei, sizeof(Neighb));
for (iat=0; iat<nat; iat++) {
wkatm[--wkbox[wkat1[iat]]] = iat;
#if TEST_CUBE
printf("atom %5d on place %5d\n", iat, wkbox[wkat1[iat]]);
#endif
}
#if TEST_CUBE
printf("nsc_dclm: n_dot=%5d ra2max=%9.3f %9.3f\n", n_dot, ra2max, dotarea);
printf("neighbour list calculated/box(xyz):%d %d %d\n", nxbox, nybox, nzbox);
for (i=0; i<nxyz; i++) printf("box %6d : atoms %4d-%4d %5d\n",
i, wkbox[i], wkbox[i+1]-1, wkbox[i+1]-wkbox[i]);
for (i=0; i<nat; i++) {
printf("list place %5d by atom %7d\n", i, wkatm[i]);
}
#endif
/* calculate surface for all atoms, step cube-wise */
for (iz=0; iz<nzbox; iz++) {
iii = iz*nxy;
izs = MAXIMUM(iz-1,0); ize = MINIMUM(iz+2, nzbox);
for (iy=0; iy<nybox; iy++) {
ii = iy*nxbox+iii;
iys = MAXIMUM(iy-1,0); iye = MINIMUM(iy+2, nybox);
for (ix=0; ix<nxbox; ix++) {
i = ii+ix;
iii1=wkbox[i]; iii2=wkbox[i+1];
if (iii1 >= iii2) continue;
ixs = MAXIMUM(ix-1,0); ixe = MINIMUM(ix+2, nxbox);
iiat = 0;
/* make intermediate atom list */
for (jz=izs; jz<ize; jz++) {
jjj = jz*nxy;
for (jy=iys; jy<iye; jy++) {
jj = jy*nxbox+jjj;
for (jx=ixs; jx<ixe; jx++) {
j = jj+jx;
for (jat=wkbox[j]; jat<wkbox[j+1]; jat++) {
wkat1[iiat] = wkatm[jat]; iiat++;
} /* end of cycle "jat" */
} /* end of cycle "jx" */
} /* end of cycle "jy" */
} /* end of cycle "jz" */
for (iat=iii1; iat<iii2; iat++) {
i_at = wkatm[iat];
ai = radius[i_at]; aisq = ai*ai;
pco = co+3*i_at;
xi = *pco; yi = *(pco+1); zi = *(pco+2);
for (i=0; i<n_dot; i++) *(wkdot+i)=0;
ctnb = wknb; nnei = 0;
for (j=0; j<iiat; j++) {
j_at = *(wkat1+j);
if (j_at == i_at) continue;
aj = radius[j_at]; ajsq = aj*aj;
pco = co+3*j_at;
dx = *pco-xi; dy = *(pco+1)-yi; dz = *(pco+2)-zi;
dd = dx*dx+dy*dy+dz*dz;
as = ai+aj; if (dd > as*as) continue;
nnei++;
ctnb->x = dx; ctnb->y = dy; ctnb->z = dz;
ctnb->dot = (dd+aisq-ajsq)/(2.*ai); /* reference dot product */
ctnb++;
}
/* check points on accessibility */
if (nnei) {
last = 0; i_ac = 0;
for (l=0; l<n_dot; l++) {
if (xus[3*l]*(wknb+last)->x+
xus[1+3*l]*(wknb+last)->y+
xus[2+3*l]*(wknb+last)->z <= (wknb+last)->dot) {
for (j=0; j<nnei; j++) {
if (xus[3*l]*(wknb+j)->x+xus[1+3*l]*(wknb+j)->y+
xus[2+3*l]*(wknb+j)->z > (wknb+j)->dot) {
last = j; break;
}
}
if (j >= nnei) { i_ac++; wkdot[l] = 1; }
} /* end of cycle j */
} /* end of cycle l */
}
else {
i_ac = n_dot;
for (l=0; l < n_dot; l++) wkdot[l] = 1;
}
#if TEST_CUBE
printf("i_ac=%d, dotarea=%8.3f, aisq=%8.3f\n", i_ac, dotarea, aisq);
#endif
a = aisq*dotarea* (double) i_ac;
area = area + a;
if (mode & FLAG_ATOM_AREA) {
atom_area[i_at] = a;
}
if (mode & FLAG_DOTS) {
for (l=0; l<n_dot; l++) {
if (wkdot[l]) {
lfnr++;
if (maxdots <= 3*lfnr+1) {
maxdots = maxdots+n_dot*3;
dots = (double *) REALLOC(dots, maxdots*sizeof(double));
}
dots[3*lfnr-3] = ai*xus[3*l]+xi;
dots[3*lfnr-2] = ai*xus[1+3*l]+yi;
dots[3*lfnr-1] = ai*xus[2+3*l]+zi;
}
}
}
if (mode & FLAG_VOLUME) {
dx=0.; dy=0.; dz=0.;
for (l=0; l<n_dot; l++) {
if (wkdot[l]) {
dx=dx+xus[3*l];
dy=dy+xus[1+3*l];
dz=dz+xus[2+3*l];
}
}
vol = vol+aisq*(dx*(xi-xs)+dy*(yi-ys)+dz*(zi-zs)+ai* (double) i_ac);
}
} /* end of cycle "iat" */
} /* end of cycle "ix" */
} /* end of cycle "iy" */
} /* end of cycle "iz" */
free(wkatm); free(wkdot); free(wknb);
if (mode & FLAG_VOLUME) {
vol = vol*FOURPI/(3.* (double) n_dot);
*value_of_vol = vol;
}
if (mode & FLAG_DOTS) {
*nu_dots = lfnr;
*lidots = dots;
}
if (mode & FLAG_ATOM_AREA) {
*at_area = atom_area;
}
*value_of_area = area;
#if TEST_CUBE
printf("area=%8.3f\n", area);
#endif
return 0;
}
#if TEST_NSC > 0
#define NAT 2
main () {
int i, j, ndots;
double co[3*NAT], ra[NAT], area, volume, a, b, c;
double * dots;
double * at_area;
FILE *fp;
a = 1.; c= 0.1;
fp = fopen("nsc.txt", "w+");
for (i=1; i<=NAT; i++) {
j = i-1;
co[3*i-3] = j*1*c;
co[3*i-2] = j*1*c;
co[3*i-1] = j*1*c;
/*
co[3*i-3] = i*1.4;
co[3*i-2] = 0.;
co[3*i-1] = 0.;
*/
/*
co[3*i-2] = a*0.3;
a = -a; b=0;
if (i%3 == 0) b=0.5;
co[3*i-1] = b;
ra[i-1] = 2.0;
*/
ra[i-1] = (1.+j*0.5)*c;
}
/*
if (NSC(co, ra, NAT, 42, NULL, &area,
*/
if (NSC(co, ra, NAT, 42,FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS, &area,
&at_area, &volume,
&dots, &ndots)) ERROR("error in NSC");
fprintf(fp, "\n");
fprintf(fp, "area : %8.3f\n", area);
printf("area : %8.3f\n", area);
fprintf(fp, "volume : %8.3f\n", volume);
printf("volume : %8.3f\n", volume);
fprintf(fp, "ndots : %8d\n", ndots);
printf("ndots : %8d\n", ndots);
fprintf(fp, "\n");
for (i=1; i<=NAT; i++) {
fprintf(fp, "%4d ATOM %7.2f %7.2f %7.2f ra=%4.1f area=%8.3f\n",
i, co[3*i-3], co[3*i-2], co[3*i-1], ra[i-1], at_area[i-1]);
}
fprintf(fp, "\n");
fprintf(fp, "DOTS : %8d\n", ndots);
for (i=1; i<=ndots; i++) {
fprintf(fp, "%4d DOTS %8.2f %8.2f %8.2f\n",
i, dots[3*i-3], dots[3*i-2], dots[3*i-1]);
}
}
#endif

140
nsc.h

@ -0,0 +1,140 @@
/*
*
* program NSC
* version 1.0 (April 1994)
*
* Author: Frank Eisenhaber
*
* Copyright Notice:
* All rights reserved, whether the whole or part of the program is
* concerned. The software may not be used without specific, prior
* written permission of the author.
*
* An academic licence agreement for the package ASC/GM or its parts
* is granted if you make the following commitments:
* 1) In using this software, the user will respect the interests of
* the author.
* 2) The use of the software in commercial activities is not allowed
* without a prior written commercial licence agreement. The program
* will not be used in classified research.
* 3) Other interested research groups will be redirected
* to the author. The user will not redistribute the code outside
* his immediate research group.
* 4) The copyright messages will not be modified or suppressed.
* 5) The reference given below will be cited in any publication
* of scientific results based in part or completely on use of the
* program.
* 6) Bugs will be reported to the author.
*
* Permission to use, copy, and modify this software and
* its documentation is hereby granted without fee for
* academic use, provided
* that the above copyright notices and this permission notice appear in
* all copies of the software and related documentation.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
* ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
*
* contact address : European Molecular Biology Laboratory
* Biocomputing Unit
* Meyerhofstr. 1
* Postfach 10.2209
* D-69012 Heidelberg
* Federal Republic of Germany
*
*
*
* E-mail : IN%"EISENHABER@EMBL-Heidelberg.DE"
* Please send your contact address to get information on updates and
* new features. Questions will be answered as soon as possible.
*
*
* references :
* 1.F.Eisenhaber, P.Lijnzaad, P.Argos, M.Scharf
* "The Double Cubic Lattice Method: Efficient Approaches to
* Numerical Integration of Surface Area and Volume and to Dot
* Surface Contouring of Molecular Assemblies"
* Journal of Computational Chemistry (1994) submitted
* 2.F.Eisenhaber, P.Argos
* "Improved Strategy in Analytic Surface Calculation for Molecular
* Systems: Handling of Singularities and Computational Efficiency"
* Journal of Computational Chemistry (1993) v.14, N11, pp-1272-1280
*
*/
#define FLAG_DOTS 01
#define FLAG_VOLUME 02
#define FLAG_ATOM_AREA 04
#define NSC nsc_dclm
extern int NSC(
double * , /* atom coordinates xyz0, xyz1, ... */
double * , /* atom radii r0, r1, r2, ... */
int , /* number of atoms */
int , /* number of dots per fully accessible sphere */
int , /* flag : dots, volume and/or area per atom */
double * , /* 1 output: overall area */
double ** , /* 2 output: pointer to list of areas per atom */
double * , /* 3 output: overall volume */
double ** , /* 4 output: pointer to list of surface dots x0, y0, z0, ... */
int * /* 5 output: number of surface dots */
);
/*
User notes :
The input requirements :
The arrays with atom coordinates and radii are thought to start
with index 0, i.e., places 0, 1, and 2 are the x-, y-, and z-
coordinates of the zero-th atom and place 0 in the other array
is its radius.
The user can define any number of dots. The program selects a
dot density that is the lowest possible with at least the required
number of dots. The points are distributed in accordance with the
icosahedron-based or the dodecahedron-based method as described in
ref. 1.
The output requirements are :
1 and 3 : pointer to an existing double
2 and 4 : pointer to an existing pointer to double
NSC allocates memory for an array
5 : pointer to an existing integer
The subroutine NSC makes use of variant 2 described in reference 1.
By selecting the necessary output via flags, the requirements for
cpu-time and computer memory can be adapted to the actual needs.
Example : flag = FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS
The routine calculates the area, volume and the dot surface.
This variant is not recommended because normally the dot surface
is needed for low point density (e.g.42) at which area and volume
are inaccurate. The sign "|" is used as binary AND !
flag = FLAG_VOLUME | FLAG_ATOM_AREA
In this case the large arrays for storing the surface dots
are not allocated. A large point number of the fully accessible
sphere can be selected. Good accuracy is already achieved with
600-700 points per sphere (accuracy of about 1.5 square Angstrem
per atomic sphere).
Output pointers 4 and 5 may be NULL.
flag = FLAG_DOTS
Only the dot surface is produced.
Output pointers 2 and 3 may be NULL.
The output pointer 1 cannot be set to NULL in any circumstances. The
overall area value is returned in every mode.
All files calling NSC should include nsc.h !!
*/

@ -0,0 +1,31 @@
#include <string.h>
#include <stdio.h>
char *OneToThree(char One)
{
if( One == 'A' ) return("ALA");
else if( One == 'R' ) return("ARG");
else if( One == 'N' ) return("ASN");
else if( One == 'D' ) return("ASP");
else if( One == 'B' ) return("ASX");
else if( One == 'C' ) return("CYS");
else if( One == 'Q' ) return("GLN");
else if( One == 'E' ) return("GLU");
else if( One == 'Z' ) return("GLX");
else if( One == 'G' ) return("GLY");
else if( One == 'H' ) return("HIS");
else if( One == 'I' ) return("ILE");
else if( One == 'L' ) return("LEU");
else if( One == 'K' ) return("LYS");
else if( One == 'M' ) return("MET");
else if( One == 'P' ) return("PRO");
else if( One == 'F' ) return("PHE");
else if( One == 'S' ) return("SER");
else if( One == 'T' ) return("THR");
else if( One == 'W' ) return("TRP");
else if( One == 'Y' ) return("TYR");
else if( One == 'V' ) return("VAL");
else if( One == 'X' ) return("UNK");
else return("***");
}

@ -0,0 +1,36 @@
#include "stride.h"
int OutSeq(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
int Cn, Res;
FILE *Seq;
if( (int)strlen(Cmd->SeqFile) == 0 )
Seq = stdout;
else
if( (Seq = fopen(Cmd->SeqFile,"a")) == NULL )
die("Error writing sequence file %s\n",Cmd->SeqFile);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
fprintf(Seq,">%s %c %d %7.3f\n",
Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id),Chain[Cn]->NRes,
Chain[Cn]->Resolution);
for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
if( Res%60 == 0 && Res != 0 ) fprintf(Seq,"\n");
fprintf(Seq,"%c",ThreeToOne(Chain[Cn]->Rsd[Res]->ResType));
}
fprintf(Seq,"\n");
}
fclose(Seq);
exit(0);
return(SUCCESS);
}

@ -0,0 +1,110 @@
#include "stride.h"
int Process_ATOM(BUFFER Buffer, CHAIN **Chain, int *ChainNumber,
BOOLEAN *First_ATOM, COMMAND *Cmd)
{
char *Field[MAX_FIELD];
BUFFER Tmp;
int CC, NR, NA;
static char LastRes[MAX_CHAIN][RES_FIELD];
RESIDUE *r;
if( Cmd->NActive && !ChInStr(Cmd->Active,SpaceToDash(Buffer[21])) )
return(SUCCESS);
if( Buffer[16] != 'A' && Buffer[16] != ' ' && Buffer[16] != '1' )
return(SUCCESS);
if( *First_ATOM ) {
for( CC=0; CC<MAX_CHAIN; CC++ )
strcpy(LastRes[CC],"XXXX");
*First_ATOM = NO;
}
for( CC=0; CC < *ChainNumber && Chain[CC]->Id != Buffer[21] ; CC++ );
if( CC == *ChainNumber ) {
InitChain(&Chain[CC]);
Chain[CC]->Id = Buffer[21];
(*ChainNumber)++;
}
else
if( Chain[CC]->Ter == 1 )
return(SUCCESS);
if( Buffer[34] != '.' || Buffer[42] != '.' || Buffer[50] != '.' )
return(escape(FAILURE,"File %s has no coordinates\n",Cmd->InputFile));
if( Cmd->Stringent && Buffer[63] != '.')
return(escape(FAILURE,"File %s has no temperature factor\n",Cmd->InputFile));
SplitString(Buffer+22,Field,1);
if( strcmp(Field[0],LastRes[CC]) ) {
if( strcmp(LastRes[CC],"XXXX") && !FindAtom(Chain[CC],Chain[CC]->NRes,"CA",&NA) ) {
free(Chain[CC]->Rsd[Chain[CC]->NRes]);
Chain[CC]->NRes--;
}
if( strcmp(LastRes[CC],"XXXX") ) Chain[CC]->NRes++;
NR = Chain[CC]->NRes;
strcpy(LastRes[CC],Field[0]);
Chain[CC]->Rsd[NR] = (RESIDUE *)ckalloc(sizeof(RESIDUE));
strcpy(Chain[CC]->Rsd[NR]->PDB_ResNumb,LastRes[CC]);
Chain[CC]->Rsd[NR]->NAtom = 0;
SplitString(Buffer+17,Field,1);
strcpy(Chain[CC]->Rsd[NR]->ResType,Field[0]);
}
else
NR = Chain[CC]->NRes;
NA = Chain[CC]->Rsd[NR]->NAtom;
if( Buffer[16] != ' ' ) {
strcpy(Tmp,Buffer);
Tmp[16] = ' ';
SplitString(Tmp+12,Field,1);
}
else
SplitString(Buffer+12,Field,1);
r = Chain[CC]->Rsd[NR];
strcpy(r->AtomType[NA],Field[0]);
strcpy(Tmp,Buffer);
Buffer[38] = ' ';
SplitString(Tmp+30,Field,1);
r->Coord[NA][0] = atof(Field[0]);
strcpy(Tmp,Buffer);
Buffer[46] = ' ';
SplitString(Tmp+38,Field,1);
r->Coord[NA][1] = atof(Field[0]);
strcpy(Tmp,Buffer);
Buffer[54] = ' ';
SplitString(Tmp+46,Field,1);
r->Coord[NA][2] = atof(Field[0]);
if( Buffer[57] == '.' ) {
strcpy(Tmp,Buffer);
Tmp[60] = ' ';
SplitString(Tmp+54,Field,1);
r->Occupancy[NA] = atof(Field[0]);
}
else
r->Occupancy[NA] = -1.00;
SplitString(Buffer+63,Field,1);
r->TempFactor[NA] = atof(Field[0]);
r->NAtom++;
if( r->NAtom > MAX_AT_IN_RES-1 )
return(escape(FAILURE,"File %s has too many atoms in residue %s %s %c\n",
Cmd->InputFile,r->ResType,r->PDB_ResNumb,Chain[CC]->Id));
return(SUCCESS);
}

@ -0,0 +1,15 @@
#include "stride.h"
int Process_COMPND(BUFFER Buffer, enum METHOD *Method)
{
if( strstr(Buffer,"NMR") )
*Method = NMR;
if( strstr(Buffer,"MODEL") )
if( *Method == XRay )
*Method = Model;
return(SUCCESS);
}

@ -0,0 +1,12 @@
#include "stride.h"
int Process_ENDMDL(BUFFER Buffer, CHAIN **Chain, int *ChainNumber)
{
int CC;
for( CC=0; CC < *ChainNumber; CC++ )
Chain[CC]->Ter = 1;
return(SUCCESS);
}

@ -0,0 +1,19 @@
#include "stride.h"
int Process_EXPDTA(BUFFER Buffer, enum METHOD *Method)
{
char *Field[MAX_FIELD];
int i, NFields;
NFields = SplitString(Buffer,Field,10);
for( i=0; i<NFields; i++ ) {
if( !strcmp(Field[i],"MODEL") )
*Method = Model;
else
if( !strcmp(Field[i],"NMR") || !strcmp(Field[i],"/NMR$") )
*Method = NMR;
}
return(SUCCESS);
}

@ -0,0 +1,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);
}

@ -0,0 +1,15 @@
#include "stride.h"
int Process_JRNL(BUFFER Buffer, BOOLEAN *Published)
{
char *Field[MAX_FIELD];
SplitString(Buffer,Field,10);
if( !strncmp(Field[1],"REF",3) && !strncmp(Field[2],"TO",2) &&
!strncmp(Field[3],"BE",2) && !strncmp(Field[4],"PUBLISHED",9) )
*Published = NO;
return(SUCCESS);
}

@ -0,0 +1,12 @@
#include "stride.h"
int Process_MODEL(enum METHOD *Method)
{
if( *Method == XRay )
*Method = Model;
return(SUCCESS);
}

@ -0,0 +1,26 @@
#include "stride.h"
int Process_REMARK(BUFFER Buffer, enum METHOD *Method, float *Resolution, BOOLEAN *DsspAssigned)
{
char *Field[MAX_FIELD];
int NFields;
NFields = SplitString(Buffer,Field,10);
if( NFields >= 5 && !strncmp(Field[2],"RESOLUTION",10) &&
!strncmp(Field[4],"ANGSTROMS",9) && isdigit(*Field[3]) )
*Resolution = atof(Field[3]);
if( NFields >= 9 && !strcmp(Field[2],"THESE") && !strcmp(Field[3],"COORDINATES") &&
!strcmp(Field[4],"WERE") && !strcmp(Field[5],"GENERATED") &&
!strcmp(Field[6],"FROM") && !strcmp(Field[7],"SOLUTION") &&
( !strcmp(Field[8],"NMR") || !strcmp(Field[8],"/NMR$") ) ) *Method = NMR;
if( strstr(Buffer,"SANDER ") || strstr(Buffer,"SANDER,") || strstr(Buffer,"SANDER:") ||
strstr(Buffer,"SANDER;") || strstr(Buffer,"SANDER.") || strstr(Buffer,"SANDER(") ||
strstr(Buffer,"SANDER)") || strstr(Buffer,"DSSP") )
*DsspAssigned = YES;
return(SUCCESS);
}

@ -0,0 +1,100 @@
#include "stride.h"
int Process_SHEET(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd)
{
int CC, SC, STC;
char *Field[MAX_FIELD];
BUFFER Tmp;
static char PreviousChain, PreviousSheetId[RES_FIELD];
if( Cmd->NActive && !ChInStr(Cmd->Active,SpaceToDash(Buffer[21])) )
return(SUCCESS);
for( CC=0; CC < *ChainNumber && Chain[CC]->Id != Buffer[21]; CC++ );
if( CC == *ChainNumber ) {
InitChain(&Chain[CC]);
Chain[CC]->Id = Buffer[21];
(*ChainNumber)++;
}
if( Chain[CC]->NSheet == -1 ) {
PreviousChain = '*';
strcpy(PreviousSheetId,"*");
}
SplitString(Buffer+7,Field,2);
if( atoi(Field[0]) == 1 || Buffer[21] != PreviousChain ) {
if( Buffer[21] == PreviousChain && !strcmp(PreviousSheetId,Field[1]) )
return(FAILURE);
/* die("Here it is! -> %s%c\n", Chain[CC]->File,Chain[CC]->Id);*/
Chain[CC]->NSheet++;
SC = Chain[CC]->NSheet;
Chain[CC]->Sheet[SC] = (SHEET *)ckalloc(sizeof(SHEET));
Chain[CC]->Sheet[SC]->NStrand = 0;
STC = Chain[CC]->Sheet[SC]->NStrand;
strcpy(Chain[CC]->Sheet[SC]->SheetId,Field[1]);
}
else
{
SC = Chain[CC]->NSheet;
STC = Chain[CC]->Sheet[SC]->NStrand;
}
SplitString(Buffer+17,Field,1);
strcpy(Chain[CC]->Sheet[SC]->ResType1[STC],Field[0]);
SplitString(Buffer+28,Field,1);
strcpy(Chain[CC]->Sheet[SC]->ResType2[STC],Field[0]);
strcpy(Tmp,Buffer);
Tmp[27] = ' ';
Tmp[38] = ' ';
SplitString(Tmp+22,Field,1);
strcpy(Chain[CC]->Sheet[SC]->PDB_ResNumb1[STC],Field[0]);
SplitString(Tmp+33,Field,1);
strcpy(Chain[CC]->Sheet[SC]->PDB_ResNumb2[STC],Field[0]);
Chain[CC]->Sheet[SC]->InsCode1[STC] = Buffer[26];
Chain[CC]->Sheet[SC]->InsCode2[STC] = Buffer[37];
SplitString(Buffer+38,Field,1);
Chain[CC]->Sheet[SC]->Sence[STC] = atoi(Field[0]);
if( Buffer[45] != ' ' ) {
Chain[CC]->Sheet[SC]->RegYN[STC] = 1;
SplitString(Buffer+45,Field,1);
strcpy(Chain[CC]->Sheet[SC]->ResTypeReg1[STC],Field[0]);
SplitString(Buffer+60,Field,1);
strcpy(Chain[CC]->Sheet[SC]->ResTypeReg2[STC],Field[0]);
Tmp[55] = ' ';
Tmp[70] = ' ';
SplitString(Tmp+50,Field,1);
strcpy(Chain[CC]->Sheet[SC]->PDB_ResNumbReg1[STC],Field[0]);
SplitString(Tmp+66,Field,1);
strcpy(Chain[CC]->Sheet[SC]->PDB_ResNumbReg2[STC],Field[0]);
Chain[CC]->Sheet[SC]->InsCodeReg1[STC] = Buffer[54];
Chain[CC]->Sheet[SC]->InsCodeReg2[STC] = Buffer[69];
Tmp[45] = ' ';
Tmp[60] = ' ';
SplitString(Tmp+41,Field,1);
strcpy(Chain[CC]->Sheet[SC]->AtomNameReg1[STC],Field[0]);
SplitString(Tmp+56,Field,1);
strcpy(Chain[CC]->Sheet[SC]->AtomNameReg2[STC],Field[0]);
}
else Chain[CC]->Sheet[SC]->RegYN[STC] = 0;
strcpy(PreviousSheetId,Chain[CC]->Sheet[SC]->SheetId);
PreviousChain = Buffer[21];
Chain[CC]->Sheet[SC]->NStrand++;
return(SUCCESS);
}

@ -0,0 +1,43 @@
#include "stride.h"
int Process_SSBOND(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd)
{
int CC, BC;
char *Field[MAX_FIELD];
BUFFER Tmp;
if( Cmd->NActive && !ChInStr(Cmd->Active,SpaceToDash(Buffer[15])) )
return(SUCCESS);
CC = 0;
if( *ChainNumber == 0 ) {
InitChain(&Chain[CC]);
Chain[CC]->Id = Buffer[15];
(*ChainNumber)++;
}
BC = Chain[CC]->NBond;
Chain[CC]->SSbond[BC] = (SSBOND *)ckalloc(sizeof(SSBOND));
strcpy(Tmp,Buffer);
Tmp[21] = ' ';
Tmp[35] = ' ';
SplitString(Tmp+17,Field,1);
strcpy(Chain[CC]->SSbond[BC]->PDB_ResNumb1,Field[0]);
SplitString(Tmp+31,Field,1);
strcpy(Chain[CC]->SSbond[BC]->PDB_ResNumb2,Field[0]);
Chain[CC]->SSbond[BC]->ChainId1 = Buffer[15];
Chain[CC]->SSbond[BC]->ChainId2 = Buffer[29];
Chain[CC]->SSbond[BC]->InsCode1 = Buffer[21];
Chain[CC]->SSbond[BC]->InsCode2 = Buffer[35];
Chain[CC]->SSbond[BC]->AsnSource = Pdb;
Chain[CC]->NBond++;
return(SUCCESS);
}

@ -0,0 +1,45 @@
#include "stride.h"
int Process_TURN(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd)
{
int CC, TC;
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)++;
}
TC = Chain[CC]->NTurn;
Chain[CC]->Turn[TC] = (TURN *)ckalloc(sizeof(TURN));
SplitString(Buffer+15,Field,1);
strcpy(Chain[CC]->Turn[TC]->Res1,Field[0]);
SplitString(Buffer+26,Field,1);
strcpy(Chain[CC]->Turn[TC]->Res2,Field[0]);
strcpy(Tmp,Buffer);
Tmp[24] = ' ';
Tmp[35] = ' ';
SplitString(Tmp+20,Field,1);
strcpy(Chain[CC]->Turn[TC]->PDB_ResNumb1,Field[0]);
SplitString(Tmp+31,Field,1);
strcpy(Chain[CC]->Turn[TC]->PDB_ResNumb2,Field[0]);
Chain[CC]->Turn[TC]->InsCode1 = Buffer[24];
Chain[CC]->Turn[TC]->InsCode2 = Buffer[35];
Chain[CC]->NTurn++;
return(SUCCESS);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,777 @@
HEADER SITE-SPECIFIC RECOMBINASE 29-JUN-94 1RES 1RES 2
COMPND GAMMA DELTA RESOLVASE (DNA BINDING DOMAIN) 1RES 3
COMPND 2 (NMR, MINIMIZED MEAN STRUCTURE) 1RES 4
SOURCE (ESCHERICHIA COLI) 1RES 5
EXPDTA NMR 1RES 6
AUTHOR G.P.MULLEN 1RES 7
REVDAT 1 30-NOV-94 1RES 0 1RES 8
JRNL AUTH T.LIU,E.F.DEROSE,G.P.MULLEN 1RES 9
JRNL TITL DETERMINATION OF THE STRUCTURE OF THE DNA BINDING 1RES 10
JRNL TITL 2 DOMAIN OF GAMMA DELTA RESOLVASE IN SOLUTION 1RES 11
JRNL REF PROTEIN SCI. V. 3 1286 1994 1RES 12
JRNL REFN ASTM PRCIEI US ISSN 0961-8368 0795 1RES 13
REMARK 1 1RES 14
REMARK 2 1RES 15
REMARK 2 RESOLUTION. NOT APPLICABLE. SEE REMARK 4. 1RES 16
REMARK 3 1RES 17
REMARK 3 REFINEMENT. 1RES 18
REMARK 3 PROGRAM X-PLOR 1RES 19
REMARK 3 AUTHORS BRUNGER 1RES 20
REMARK 3 RMSD BOND DISTANCES 0.005 ANGSTROMS 1RES 21
REMARK 3 RMSD BOND ANGLES 0.592 DEGREES 1RES 22
REMARK 3 RMSD IMPROPERS 0.582 1RES 23
REMARK 3 1RES 24
REMARK 3 RMSD FOR MODELS 1 TO 17 OF PDB ENTRY 1RET WITH RESPECT TO 1RES 25
REMARK 3 THE AVERAGE MODEL FOR RESIDUES 149 - 180 (ANGSTROMS). 1RES 26
REMARK 3 HEAVY BACKBONE ATOMS 0.67 + OR - 0.15 1RES 27
REMARK 3 ALL HEAVY ATOMS 1.49 + OR - 0.20 1RES 28
REMARK 3 1RES 29
REMARK 3 RMS DEVIATIONS FOR THE 17 CONFORMERS AND THE AVERAGE 1RES 30
REMARK 3 STRUCTURE 1RES 31
REMARK 3 1RES 32
REMARK 3 RMSD FROM EXPERIMENTAL DISTANCE RESTRAINTS (ANGSTROMS) 1RES 33
REMARK 3 1RES 34
REMARK 3 ALL DISTANCE 1RES 35
REMARK 3 RESTRAINTS (458) 0.061 1RES 36
REMARK 3 1RES 37
REMARK 3 INTERPROTON DISTANCES 1RES 38
REMARK 3 1RES 39
REMARK 3 INTRARESIDUE (218) 0.046 1RES 40
REMARK 3 1RES 41
REMARK 3 INTERRESIDUE 1RES 42
REMARK 3 SEQUENTIAL AND 1RES 43
REMARK 3 MEDIUM RANGE 1RES 44
REMARK 3 (|I - J| L.T.OR.EQ.TO 5) 1RES 45
REMARK 3 (193) 0.051 1RES 46
REMARK 3 1RES 47
REMARK 3 INTERRESIDUE LONG 1RES 48
REMARK 3 RANGE 1RES 49
REMARK 3 (|I - J|) G.T. 5 (30) 0.154 1RES 50
REMARK 3 1RES 51
REMARK 3 H-BONDS (17) 0.040 1RES 52
REMARK 3 1RES 53
REMARK 3 RMSD FROM EXPERIMENTAL 1RES 54
REMARK 3 DIHEDRAL RESTRAINTS (DEG) 1RES 55
REMARK 3 (17) 0 1RES 56
REMARK 4 1RES 57
REMARK 4 THE COORDINATES IN THIS ENTRY WERE GENERATED FROM SOLUTION 1RES 58
REMARK 4 NMR DATA. PROTEIN DATA BANK CONVENTIONS REQUIRE THAT 1RES 59
REMARK 4 *CRYST1* AND *SCALE* RECORDS BE INCLUDED, BUT THE VALUES ON 1RES 60
REMARK 4 THESE RECORDS ARE MEANINGLESS. 1RES 61
REMARK 5 1RES 62
REMARK 5 STATISTICS FOR EACH STRUCTURE CAN BE FOUND IN REMARK 5 OF 1RES 63
REMARK 5 PDB ENTRY 1RET. 1RES 64
SEQRES 1 43 GLY ARG LYS ARG LYS ILE ASP ARG ASP ALA VAL LEU ASN 1RES 65
SEQRES 2 43 MET TRP GLN GLN GLY LEU GLY ALA SER HIS ILE SER LYS 1RES 66
SEQRES 3 43 THR MET ASN ILE ALA ARG SER THR VAL TYR LYS VAL ILE 1RES 67
SEQRES 4 43 ASN GLU SER ASN 1RES 68
HELIX 1 H1 ASP 9 GLN 17 1 RESIDUES 149 - 157 1RES 69
HELIX 2 H2 SER 22 THR 27 1 RESIDUES 162 - 167 1RES 70
HELIX 3 H3 ARG 32 ASN 43 1 RESIDUES 172 - 183 1RES 71
CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1 1RES 72
ORIGX1 1.000000 0.000000 0.000000 0.00000 1RES 73
ORIGX2 0.000000 1.000000 0.000000 0.00000 1RES 74
ORIGX3 0.000000 0.000000 1.000000 0.00000 1RES 75
SCALE1 1.000000 0.000000 0.000000 0.00000 1RES 76
SCALE2 0.000000 1.000000 0.000000 0.00000 1RES 77
SCALE3 0.000000 0.000000 1.000000 0.00000 1RES 78
ATOM 1 N GLY 1 -28.805 57.622 39.415 0.00 0.00 1RES 79
ATOM 2 CA GLY 1 -29.353 56.930 38.214 0.00 0.00 1RES 80
ATOM 3 C GLY 1 -28.354 57.041 37.061 0.00 0.00 1RES 81
ATOM 4 O GLY 1 -27.333 57.693 37.174 0.00 0.00 1RES 82
ATOM 5 1H GLY 1 -27.776 57.479 39.458 1.00 0.00 1RES 83
ATOM 6 2H GLY 1 -29.013 58.640 39.352 1.00 0.00 1RES 84
ATOM 7 3H GLY 1 -29.244 57.230 40.272 1.00 0.00 1RES 85
ATOM 8 1HA GLY 1 -29.521 55.889 38.444 1.00 0.00 1RES 86
ATOM 9 2HA GLY 1 -30.287 57.392 37.928 1.00 0.00 1RES 87
ATOM 10 N ARG 2 -28.643 56.407 35.952 0.00 0.00 1RES 88
ATOM 11 CA ARG 2 -27.715 56.468 34.785 0.00 0.00 1RES 89
ATOM 12 C ARG 2 -28.262 57.452 33.749 0.00 0.00 1RES 90
ATOM 13 O ARG 2 -27.748 58.542 33.586 0.00 0.00 1RES 91
ATOM 14 CB ARG 2 -27.594 55.078 34.156 0.00 0.00 1RES 92
ATOM 15 CG ARG 2 -26.367 54.363 34.726 0.00 0.00 1RES 93
ATOM 16 CD ARG 2 -25.742 53.479 33.645 0.00 0.00 1RES 94
ATOM 17 NE ARG 2 -25.148 52.261 34.278 0.00 0.00 1RES 95
ATOM 18 CZ ARG 2 -24.803 51.211 33.559 0.00 0.00 1RES 96
ATOM 19 NH1 ARG 2 -24.966 51.186 32.256 0.00 0.00 1RES 97
ATOM 20 NH2 ARG 2 -24.288 50.171 34.157 0.00 0.00 1RES 98
ATOM 21 H ARG 2 -29.472 55.888 35.889 1.00 0.00 1RES 99
ATOM 22 HA ARG 2 -26.742 56.800 35.117 1.00 0.00 1RES 100
ATOM 23 1HB ARG 2 -28.482 54.504 34.379 1.00 0.00 1RES 101
ATOM 24 2HB ARG 2 -27.487 55.174 33.086 1.00 0.00 1RES 102
ATOM 25 1HG ARG 2 -25.644 55.096 35.055 1.00 0.00 1RES 103
ATOM 26 2HG ARG 2 -26.664 53.749 35.562 1.00 0.00 1RES 104
ATOM 27 1HD ARG 2 -26.502 53.183 32.937 1.00 0.00 1RES 105
ATOM 28 2HD ARG 2 -24.968 54.031 33.131 1.00 0.00 1RES 106
ATOM 29 HE ARG 2 -25.013 52.243 35.249 1.00 0.00 1RES 107
ATOM 30 1HH1 ARG 2 -25.358 51.971 31.779 1.00 0.00 1RES 108
ATOM 31 2HH1 ARG 2 -24.694 50.375 31.737 1.00 0.00 1RES 109
ATOM 32 1HH2 ARG 2 -24.160 50.177 35.148 1.00 0.00 1RES 110
ATOM 33 2HH2 ARG 2 -24.023 49.368 33.623 1.00 0.00 1RES 111
ATOM 34 N LYS 3 -29.300 57.072 33.047 0.00 0.00 1RES 112
ATOM 35 CA LYS 3 -29.886 57.977 32.016 0.00 0.00 1RES 113
ATOM 36 C LYS 3 -31.283 58.423 32.461 0.00 0.00 1RES 114
ATOM 37 O LYS 3 -32.209 58.470 31.673 0.00 0.00 1RES 115
ATOM 38 CB LYS 3 -29.984 57.226 30.685 0.00 0.00 1RES 116
ATOM 39 CG LYS 3 -29.658 58.178 29.531 0.00 0.00 1RES 117
ATOM 40 CD LYS 3 -28.182 58.037 29.153 0.00 0.00 1RES 118
ATOM 41 CE LYS 3 -27.986 56.768 28.322 0.00 0.00 1RES 119
ATOM 42 NZ LYS 3 -28.836 56.838 27.100 0.00 0.00 1RES 120
ATOM 43 H LYS 3 -29.692 56.187 33.197 1.00 0.00 1RES 121
ATOM 44 HA LYS 3 -29.253 58.844 31.897 1.00 0.00 1RES 122
ATOM 45 1HB LYS 3 -29.281 56.405 30.685 1.00 0.00 1RES 123
ATOM 46 2HB LYS 3 -30.985 56.842 30.560 1.00 0.00 1RES 124
ATOM 47 1HG LYS 3 -30.274 57.933 28.678 1.00 0.00 1RES 125
ATOM 48 2HG LYS 3 -29.853 59.195 29.837 1.00 0.00 1RES 126
ATOM 49 1HD LYS 3 -27.874 58.898 28.577 1.00 0.00 1RES 127
ATOM 50 2HD LYS 3 -27.585 57.973 30.051 1.00 0.00 1RES 128
ATOM 51 1HE LYS 3 -26.949 56.683 28.035 1.00 0.00 1RES 129
ATOM 52 2HE LYS 3 -28.269 55.907 28.909 1.00 0.00 1RES 130
ATOM 53 1HZ LYS 3 -28.862 57.816 26.751 1.00 0.00 1RES 131
ATOM 54 2HZ LYS 3 -28.438 56.220 26.365 1.00 0.00 1RES 132
ATOM 55 3HZ LYS 3 -29.801 56.526 27.332 1.00 0.00 1RES 133
ATOM 56 N ARG 4 -31.438 58.750 33.719 0.00 0.00 1RES 134
ATOM 57 CA ARG 4 -32.771 59.192 34.223 0.00 0.00 1RES 135
ATOM 58 C ARG 4 -32.834 60.724 34.235 0.00 0.00 1RES 136
ATOM 59 O ARG 4 -33.406 61.333 33.351 0.00 0.00 1RES 137
ATOM 60 CB ARG 4 -32.985 58.652 35.641 0.00 0.00 1RES 138
ATOM 61 CG ARG 4 -33.557 57.236 35.569 0.00 0.00 1RES 139
ATOM 62 CD ARG 4 -33.055 56.421 36.762 0.00 0.00 1RES 140
ATOM 63 NE ARG 4 -33.377 57.145 38.031 0.00 0.00 1RES 141
ATOM 64 CZ ARG 4 -33.310 56.544 39.203 0.00 0.00 1RES 142
ATOM 65 NH1 ARG 4 -32.954 55.284 39.310 0.00 0.00 1RES 143
ATOM 66 NH2 ARG 4 -33.603 57.216 40.282 0.00 0.00 1RES 144
ATOM 67 H ARG 4 -30.675 58.703 34.333 1.00 0.00 1RES 145
ATOM 68 HA ARG 4 -33.544 58.808 33.574 1.00 0.00 1RES 146
ATOM 69 1HB ARG 4 -32.040 58.633 36.165 1.00 0.00 1RES 147
ATOM 70 2HB ARG 4 -33.676 59.291 36.169 1.00 0.00 1RES 148
ATOM 71 1HG ARG 4 -34.637 57.282 35.591 1.00 0.00 1RES 149
ATOM 72 2HG ARG 4 -33.236 56.764 34.652 1.00 0.00 1RES 150
ATOM 73 1HD ARG 4 -33.538 55.455 36.767 1.00 0.00 1RES 151
ATOM 74 2HD ARG 4 -31.986 56.289 36.684 1.00 0.00 1RES 152
ATOM 75 HE ARG 4 -33.645 58.087 37.990 1.00 0.00 1RES 153
ATOM 76 1HH1 ARG 4 -32.724 54.751 38.497 1.00 0.00 1RES 154
ATOM 77 2HH1 ARG 4 -32.912 54.855 40.212 1.00 0.00 1RES 155
ATOM 78 1HH2 ARG 4 -33.875 58.176 40.214 1.00 0.00 1RES 156
ATOM 79 2HH2 ARG 4 -33.556 56.772 41.176 1.00 0.00 1RES 157
ATOM 80 N LYS 5 -32.255 61.349 35.231 0.00 0.00 1RES 158
ATOM 81 CA LYS 5 -32.282 62.837 35.307 0.00 0.00 1RES 159
ATOM 82 C LYS 5 -30.857 63.382 35.168 0.00 0.00 1RES 160
ATOM 83 O LYS 5 -30.217 63.727 36.144 0.00 0.00 1RES 161
ATOM 84 CB LYS 5 -32.864 63.258 36.658 0.00 0.00 1RES 162
ATOM 85 CG LYS 5 -33.019 64.779 36.700 0.00 0.00 1RES 163
ATOM 86 CD LYS 5 -34.299 65.182 35.965 0.00 0.00 1RES 164
ATOM 87 CE LYS 5 -34.102 66.551 35.311 0.00 0.00 1RES 165
ATOM 88 NZ LYS 5 -34.959 66.648 34.095 0.00 0.00 1RES 166
ATOM 89 H LYS 5 -31.805 60.836 35.934 1.00 0.00 1RES 167
ATOM 90 HA LYS 5 -32.898 63.229 34.511 1.00 0.00 1RES 168
ATOM 91 1HB LYS 5 -33.829 62.791 36.792 1.00 0.00 1RES 169
ATOM 92 2HB LYS 5 -32.199 62.942 37.447 1.00 0.00 1RES 170
ATOM 93 1HG LYS 5 -33.076 65.106 37.729 1.00 0.00 1RES 171
ATOM 94 2HG LYS 5 -32.170 65.242 36.221 1.00 0.00 1RES 172
ATOM 95 1HD LYS 5 -34.523 64.448 35.204 1.00 0.00 1RES 173
ATOM 96 2HD LYS 5 -35.117 65.235 36.667 1.00 0.00 1RES 174
ATOM 97 1HE LYS 5 -34.379 67.327 36.009 1.00 0.00 1RES 175
ATOM 98 2HE LYS 5 -33.066 66.671 35.032 1.00 0.00 1RES 176
ATOM 99 1HZ LYS 5 -35.910 66.286 34.311 1.00 0.00 1RES 177
ATOM 100 2HZ LYS 5 -35.025 67.642 33.796 1.00 0.00 1RES 178
ATOM 101 3HZ LYS 5 -34.539 66.086 33.329 1.00 0.00 1RES 179
ATOM 102 N ILE 6 -30.360 63.460 33.960 0.00 0.00 1RES 180
ATOM 103 CA ILE 6 -28.977 63.980 33.746 0.00 0.00 1RES 181
ATOM 104 C ILE 6 -28.865 64.572 32.338 0.00 0.00 1RES 182
ATOM 105 O ILE 6 -29.497 64.107 31.409 0.00 0.00 1RES 183
ATOM 106 CB ILE 6 -27.969 62.838 33.903 0.00 0.00 1RES 184
ATOM 107 CG1 ILE 6 -28.334 61.693 32.951 0.00 0.00 1RES 185
ATOM 108 CG2 ILE 6 -27.997 62.328 35.345 0.00 0.00 1RES 186
ATOM 109 CD1 ILE 6 -27.547 61.842 31.647 0.00 0.00 1RES 187
ATOM 110 H ILE 6 -30.898 63.175 33.192 1.00 0.00 1RES 188
ATOM 111 HA ILE 6 -28.766 64.748 34.475 1.00 0.00 1RES 189
ATOM 112 HB ILE 6 -26.978 63.200 33.670 1.00 0.00 1RES 190
ATOM 113 1HG1 ILE 6 -28.087 60.749 33.414 1.00 0.00 1RES 191
ATOM 114 2HG1 ILE 6 -29.391 61.724 32.736 1.00 0.00 1RES 192
ATOM 115 1HG2 ILE 6 -28.046 63.167 36.023 1.00 0.00 1RES 193
ATOM 116 2HG2 ILE 6 -28.863 61.698 35.487 1.00 0.00 1RES 194
ATOM 117 3HG2 ILE 6 -27.101 61.757 35.542 1.00 0.00 1RES 195
ATOM 118 1HD1 ILE 6 -26.641 62.400 31.834 1.00 0.00 1RES 196
ATOM 119 2HD1 ILE 6 -27.295 60.864 31.266 1.00 0.00 1RES 197
ATOM 120 3HD1 ILE 6 -28.150 62.367 30.921 1.00 0.00 1RES 198
ATOM 121 N ASP 7 -28.062 65.593 32.179 0.00 0.00 1RES 199
ATOM 122 CA ASP 7 -27.899 66.223 30.835 0.00 0.00 1RES 200
ATOM 123 C ASP 7 -26.643 65.666 30.163 0.00 0.00 1RES 201
ATOM 124 O ASP 7 -25.741 65.183 30.820 0.00 0.00 1RES 202
ATOM 125 CB ASP 7 -27.763 67.738 30.995 0.00 0.00 1RES 203
ATOM 126 CG ASP 7 -28.266 68.432 29.728 0.00 0.00 1RES 204
ATOM 127 OD1 ASP 7 -27.553 68.407 28.739 0.00 0.00 1RES 205
ATOM 128 OD2 ASP 7 -29.357 68.977 29.769 0.00 0.00 1RES 206
ATOM 129 H ASP 7 -27.565 65.946 32.945 1.00 0.00 1RES 207
ATOM 130 HA ASP 7 -28.762 66.000 30.226 1.00 0.00 1RES 208
ATOM 131 1HB ASP 7 -28.348 68.065 31.843 1.00 0.00 1RES 209
ATOM 132 2HB ASP 7 -26.726 67.992 31.154 1.00 0.00 1RES 210
ATOM 133 N ARG 8 -26.577 65.736 28.855 0.00 0.00 1RES 211
ATOM 134 CA ARG 8 -25.383 65.220 28.124 0.00 0.00 1RES 212
ATOM 135 C ARG 8 -25.591 65.387 26.616 0.00 0.00 1RES 213
ATOM 136 O ARG 8 -24.662 65.665 25.884 0.00 0.00 1RES 214
ATOM 137 CB ARG 8 -25.169 63.736 28.444 0.00 0.00 1RES 215
ATOM 138 CG ARG 8 -26.472 62.964 28.214 0.00 0.00 1RES 216
ATOM 139 CD ARG 8 -26.236 61.467 28.439 0.00 0.00 1RES 217
ATOM 140 NE ARG 8 -26.886 60.676 27.338 0.00 0.00 1RES 218
ATOM 141 CZ ARG 8 -28.155 60.826 27.017 0.00 0.00 1RES 219
ATOM 142 NH1 ARG 8 -28.974 61.524 27.767 0.00 0.00 1RES 220
ATOM 143 NH2 ARG 8 -28.622 60.215 25.963 0.00 0.00 1RES 221
ATOM 144 H ARG 8 -27.312 66.136 28.355 1.00 0.00 1RES 222
ATOM 145 HA ARG 8 -24.518 65.782 28.428 1.00 0.00 1RES 223
ATOM 146 1HB ARG 8 -24.397 63.338 27.801 1.00 0.00 1RES 224
ATOM 147 2HB ARG 8 -24.867 63.628 29.475 1.00 0.00 1RES 225
ATOM 148 1HG ARG 8 -27.225 63.318 28.903 1.00 0.00 1RES 226
ATOM 149 2HG ARG 8 -26.810 63.123 27.201 1.00 0.00 1RES 227
ATOM 150 1HD ARG 8 -25.181 61.262 28.412 1.00 0.00 1RES 228
ATOM 151 2HD ARG 8 -26.626 61.185 29.414 1.00 0.00 1RES 229
ATOM 152 HE ARG 8 -26.333 60.065 26.806 1.00 0.00 1RES 230
ATOM 153 1HH1 ARG 8 -28.651 61.953 28.607 1.00 0.00 1RES 231
ATOM 154 2HH1 ARG 8 -29.931 61.625 27.494 1.00 0.00 1RES 232
ATOM 155 1HH2 ARG 8 -28.018 59.641 25.409 1.00 0.00 1RES 233
ATOM 156 2HH2 ARG 8 -29.583 60.321 25.708 1.00 0.00 1RES 234
ATOM 157 N ASP 9 -26.801 65.214 26.150 0.00 0.98 1RES 235
ATOM 158 CA ASP 9 -27.077 65.356 24.689 0.00 0.99 1RES 236
ATOM 159 C ASP 9 -26.976 66.829 24.273 0.00 0.81 1RES 237
ATOM 160 O ASP 9 -26.805 67.136 23.109 0.00 0.82 1RES 238
ATOM 161 CB ASP 9 -28.486 64.841 24.388 0.00 1.17 1RES 239
ATOM 162 CG ASP 9 -28.426 63.346 24.070 0.00 1.85 1RES 240
ATOM 163 OD1 ASP 9 -27.865 62.613 24.868 0.00 2.62 1RES 241
ATOM 164 OD2 ASP 9 -28.943 62.959 23.035 0.00 2.25 1RES 242
ATOM 165 H ASP 9 -27.530 64.988 26.762 1.00 1.03 1RES 243
ATOM 166 HA ASP 9 -26.358 64.776 24.131 1.00 1.08 1RES 244
ATOM 167 1HB ASP 9 -29.120 65.002 25.248 1.00 1.41 1RES 245
ATOM 168 2HB ASP 9 -28.890 65.371 23.538 1.00 1.47 1RES 246
ATOM 169 N ALA 10 -27.087 67.740 25.209 0.00 0.72 1RES 247
ATOM 170 CA ALA 10 -27.005 69.189 24.862 0.00 0.70 1RES 248
ATOM 171 C ALA 10 -25.577 69.541 24.431 0.00 0.54 1RES 249
ATOM 172 O ALA 10 -25.325 69.858 23.281 0.00 0.54 1RES 250
ATOM 173 CB ALA 10 -27.392 70.022 26.087 0.00 0.83 1RES 251
ATOM 174 H ALA 10 -27.232 67.473 26.139 1.00 0.76 1RES 252
ATOM 175 HA ALA 10 -27.687 69.403 24.053 1.00 0.83 1RES 253
ATOM 176 1HB ALA 10 -27.977 69.416 26.763 1.00 1.29 1RES 254
ATOM 177 2HB ALA 10 -26.499 70.363 26.591 1.00 1.44 1RES 255
ATOM 178 3HB ALA 10 -27.975 70.874 25.773 1.00 1.22 1RES 256
ATOM 179 N VAL 11 -24.641 69.493 25.347 0.00 0.52 1RES 257
ATOM 180 CA VAL 11 -23.225 69.831 25.002 0.00 0.53 1RES 258
ATOM 181 C VAL 11 -22.717 68.859 23.936 0.00 0.49 1RES 259
ATOM 182 O VAL 11 -22.036 69.246 23.003 0.00 0.51 1RES 260
ATOM 183 CB VAL 11 -22.349 69.722 26.254 0.00 0.67 1RES 261
ATOM 184 CG1 VAL 11 -20.920 70.168 25.923 0.00 0.80 1RES 262
ATOM 185 CG2 VAL 11 -22.917 70.619 27.358 0.00 0.77 1RES 263
ATOM 186 H VAL 11 -24.871 69.236 26.265 1.00 0.61 1RES 264
ATOM 187 HA VAL 11 -23.181 70.840 24.618 1.00 0.59 1RES 265
ATOM 188 HB VAL 11 -22.334 68.696 26.593 1.00 0.69 1RES 266
ATOM 189 1HG1 VAL 11 -20.939 70.839 25.077 1.00 1.16 1RES 267
ATOM 190 2HG1 VAL 11 -20.494 70.675 26.776 1.00 1.41 1RES 268
ATOM 191 3HG1 VAL 11 -20.319 69.302 25.682 1.00 1.36 1RES 269
ATOM 192 1HG2 VAL 11 -23.978 70.750 27.207 1.00 1.18 1RES 270
ATOM 193 2HG2 VAL 11 -22.745 70.159 28.319 1.00 1.23 1RES 271
ATOM 194 3HG2 VAL 11 -22.428 71.581 27.327 1.00 1.29 1RES 272
ATOM 195 N LEU 12 -23.047 67.603 24.071 0.00 0.58 1RES 273
ATOM 196 CA LEU 12 -22.593 66.593 23.073 0.00 0.70 1RES 274
ATOM 197 C LEU 12 -23.186 66.926 21.702 0.00 0.57 1RES 275
ATOM 198 O LEU 12 -22.618 66.602 20.683 0.00 0.65 1RES 276
ATOM 199 CB LEU 12 -23.056 65.201 23.507 0.00 0.96 1RES 277
ATOM 200 CG LEU 12 -22.208 64.139 22.805 0.00 1.41 1RES 278
ATOM 201 CD1 LEU 12 -21.040 63.739 23.708 0.00 2.00 1RES 279
ATOM 202 CD2 LEU 12 -23.071 62.908 22.516 0.00 1.95 1RES 280
ATOM 203 H LEU 12 -23.598 67.323 24.831 1.00 0.65 1RES 281
ATOM 204 HA LEU 12 -21.515 66.610 23.011 1.00 0.80 1RES 282
ATOM 205 1HB LEU 12 -22.943 65.103 24.577 1.00 1.19 1RES 283
ATOM 206 2HB LEU 12 -24.094 65.067 23.240 1.00 1.18 1RES 284
ATOM 207 HG LEU 12 -21.825 64.539 21.878 1.00 1.80 1RES 285
ATOM 208 1HD1 LEU 12 -20.764 64.577 24.331 1.00 2.34 1RES 286
ATOM 209 2HD1 LEU 12 -21.335 62.908 24.331 1.00 2.68 1RES 287
ATOM 210 3HD1 LEU 12 -20.197 63.450 23.098 1.00 2.19 1RES 288
ATOM 211 1HD2 LEU 12 -23.662 62.669 23.387 1.00 2.45 1RES 289
ATOM 212 2HD2 LEU 12 -23.726 63.115 21.682 1.00 2.38 1RES 290
ATOM 213 3HD2 LEU 12 -22.433 62.071 22.273 1.00 2.28 1RES 291
ATOM 214 N ASN 13 -24.323 67.573 21.669 0.00 0.53 1RES 292
ATOM 215 CA ASN 13 -24.948 67.923 20.359 0.00 0.61 1RES 293
ATOM 216 C ASN 13 -24.153 69.048 19.689 0.00 0.53 1RES 294
ATOM 217 O ASN 13 -24.128 69.161 18.480 0.00 0.67 1RES 295
ATOM 218 CB ASN 13 -26.388 68.381 20.588 0.00 0.76 1RES 296
ATOM 219 CG ASN 13 -27.346 67.202 20.390 0.00 1.31 1RES 297
ATOM 220 OD1 ASN 13 -28.431 67.368 19.868 0.00 2.20 1RES 298
ATOM 221 ND2 ASN 13 -26.992 66.009 20.786 0.00 1.62 1RES 299
ATOM 222 H ASN 13 -24.766 67.827 22.504 1.00 0.57 1RES 300
ATOM 223 HA ASN 13 -24.950 67.058 19.719 1.00 0.74 1RES 301
ATOM 224 1HB ASN 13 -26.488 68.762 21.592 1.00 1.15 1RES 302
ATOM 225 2HB ASN 13 -26.631 69.158 19.882 1.00 1.01 1RES 303
ATOM 226 1HD2 ASN 13 -27.600 65.251 20.663 1.00 2.15 1RES 304
ATOM 227 2HD2 ASN 13 -26.117 65.873 21.208 1.00 1.83 1RES 305
ATOM 228 N MET 14 -23.515 69.886 20.466 0.00 0.48 1RES 306
ATOM 229 CA MET 14 -22.737 71.009 19.889 0.00 0.62 1RES 307
ATOM 230 C MET 14 -21.486 70.492 19.160 0.00 0.59 1RES 308
ATOM 231 O MET 14 -21.228 70.843 18.027 0.00 0.98 1RES 309
ATOM 232 CB MET 14 -22.302 71.929 21.020 0.00 0.86 1RES 310
ATOM 233 CG MET 14 -23.534 72.431 21.771 0.00 1.23 1RES 311
ATOM 234 SD MET 14 -24.509 73.505 20.687 0.00 2.37 1RES 312
ATOM 235 CE MET 14 -26.096 72.661 20.896 0.00 2.86 1RES 313
ATOM 236 H MET 14 -23.558 69.786 21.434 1.00 0.49 1RES 314
ATOM 237 HA MET 14 -23.365 71.564 19.214 1.00 0.75 1RES 315
ATOM 238 1HB MET 14 -21.664 71.383 21.699 1.00 1.15 1RES 316
ATOM 239 2HB MET 14 -21.764 72.768 20.610 1.00 1.34 1RES 317
ATOM 240 1HG MET 14 -24.136 71.589 22.081 1.00 1.71 1RES 318
ATOM 241 2HG MET 14 -23.218 72.986 22.640 1.00 1.58 1RES 319
ATOM 242 1HE MET 14 -26.105 72.144 21.846 1.00 3.26 1RES 320
ATOM 243 2HE MET 14 -26.896 73.383 20.875 1.00 3.43 1RES 321
ATOM 244 3HE MET 14 -26.233 71.951 20.092 1.00 2.83 1RES 322
ATOM 245 N TRP 15 -20.693 69.691 19.825 0.00 0.44 1RES 323
ATOM 246 CA TRP 15 -19.424 69.170 19.212 0.00 0.44 1RES 324
ATOM 247 C TRP 15 -19.693 68.130 18.128 0.00 0.43 1RES 325
ATOM 248 O TRP 15 -19.001 68.071 17.129 0.00 0.57 1RES 326
ATOM 249 CB TRP 15 -18.596 68.489 20.298 0.00 0.53 1RES 327
ATOM 250 CG TRP 15 -18.162 69.489 21.284 0.00 0.44 1RES 328
ATOM 251 CD1 TRP 15 -18.716 69.655 22.492 0.00 0.49 1RES 329
ATOM 252 CD2 TRP 15 -17.095 70.457 21.173 0.00 0.38 1RES 330
ATOM 253 NE1 TRP 15 -18.063 70.693 23.133 0.00 0.50 1RES 331
ATOM 254 CE2 TRP 15 -17.057 71.227 22.345 0.00 0.45 1RES 332
ATOM 255 CE3 TRP 15 -16.174 70.749 20.168 0.00 0.41 1RES 333
ATOM 256 CZ2 TRP 15 -16.127 72.260 22.500 0.00 0.54 1RES 334
ATOM 257 CZ3 TRP 15 -15.245 71.773 20.331 0.00 0.49 1RES 335
ATOM 258 CH2 TRP 15 -15.226 72.528 21.493 0.00 0.54 1RES 336
ATOM 259 H TRP 15 -20.918 69.449 20.749 1.00 0.66 1RES 337
ATOM 260 HA TRP 15 -18.858 69.989 18.796 1.00 0.51 1RES 338
ATOM 261 1HB TRP 15 -19.199 67.751 20.793 1.00 0.68 1RES 339
ATOM 262 2HB TRP 15 -17.734 68.023 19.856 1.00 0.62 1RES 340
ATOM 263 HD1 TRP 15 -19.538 69.067 22.886 1.00 0.57 1RES 341
ATOM 264 HE1 TRP 15 -18.267 71.015 24.026 1.00 0.59 1RES 342
ATOM 265 HE3 TRP 15 -16.164 70.167 19.277 1.00 0.47 1RES 343
ATOM 266 HZ2 TRP 15 -16.113 72.853 23.399 1.00 0.65 1RES 344
ATOM 267 HZ3 TRP 15 -14.560 71.993 19.548 1.00 0.57 1RES 345
ATOM 268 HH2 TRP 15 -14.501 73.302 21.620 1.00 0.66 1RES 346
ATOM 269 N GLN 16 -20.648 67.280 18.348 0.00 0.43 1RES 347
ATOM 270 CA GLN 16 -20.937 66.196 17.372 0.00 0.53 1RES 348
ATOM 271 C GLN 16 -21.518 66.755 16.066 0.00 0.54 1RES 349
ATOM 272 O GLN 16 -21.627 66.043 15.085 0.00 0.65 1RES 350
ATOM 273 CB GLN 16 -21.913 65.222 18.026 0.00 0.65 1RES 351
ATOM 274 CG GLN 16 -21.287 64.689 19.323 0.00 0.67 1RES 352
ATOM 275 CD GLN 16 -20.212 63.654 18.984 0.00 1.07 1RES 353
ATOM 276 OE1 GLN 16 -20.326 62.941 18.007 0.00 1.64 1RES 354
ATOM 277 NE2 GLN 16 -19.166 63.541 19.756 0.00 1.72 1RES 355
ATOM 278 H GLN 16 -21.160 67.332 19.178 1.00 0.49 1RES 356
ATOM 279 HA GLN 16 -20.019 65.672 17.151 1.00 0.59 1RES 357
ATOM 280 1HB GLN 16 -22.835 65.737 18.254 1.00 0.65 1RES 358
ATOM 281 2HB GLN 16 -22.110 64.399 17.356 1.00 0.80 1RES 359
ATOM 282 1HG GLN 16 -20.837 65.512 19.878 1.00 0.67 1RES 360
ATOM 283 2HG GLN 16 -22.052 64.227 19.927 1.00 0.85 1RES 361
ATOM 284 1HE2 GLN 16 -18.472 62.881 19.548 1.00 2.00 1RES 362
ATOM 285 2HE2 GLN 16 -19.074 64.116 20.544 1.00 2.27 1RES 363
ATOM 286 N GLN 17 -21.886 68.014 16.034 0.00 0.54 1RES 364
ATOM 287 CA GLN 17 -22.451 68.597 14.780 0.00 0.60 1RES 365
ATOM 288 C GLN 17 -21.380 69.398 14.013 0.00 0.64 1RES 366
ATOM 289 O GLN 17 -21.663 69.971 12.977 0.00 0.96 1RES 367
ATOM 290 CB GLN 17 -23.613 69.515 15.146 0.00 0.62 1RES 368
ATOM 291 CG GLN 17 -24.692 68.697 15.853 0.00 0.64 1RES 369
ATOM 292 CD GLN 17 -25.501 67.911 14.819 0.00 1.45 1RES 370
ATOM 293 OE1 GLN 17 -25.012 67.607 13.750 0.00 2.36 1RES 371
ATOM 294 NE2 GLN 17 -26.730 67.568 15.095 0.00 1.78 1RES 372
ATOM 295 H GLN 17 -21.796 68.575 16.831 1.00 0.58 1RES 373
ATOM 296 HA GLN 17 -22.815 67.799 14.151 1.00 0.67 1RES 374
ATOM 297 1HB GLN 17 -23.259 70.290 15.808 1.00 0.61 1RES 375
ATOM 298 2HB GLN 17 -24.023 69.958 14.252 1.00 0.68 1RES 376
ATOM 299 1HG GLN 17 -24.221 68.010 16.543 1.00 0.91 1RES 377
ATOM 300 2HG GLN 17 -25.349 69.360 16.395 1.00 1.12 1RES 378
ATOM 301 1HE2 GLN 17 -27.257 67.065 14.440 1.00 2.43 1RES 379
ATOM 302 2HE2 GLN 17 -27.126 67.815 15.958 1.00 1.81 1RES 380
ATOM 303 N GLY 18 -20.159 69.443 14.500 0.00 0.55 1RES 381
ATOM 304 CA GLY 18 -19.087 70.204 13.784 0.00 0.58 1RES 382
ATOM 305 C GLY 18 -19.132 71.676 14.202 0.00 0.54 1RES 383
ATOM 306 O GLY 18 -19.428 72.547 13.406 0.00 0.81 1RES 384
ATOM 307 H GLY 18 -19.944 68.976 15.330 1.00 0.70 1RES 385
ATOM 308 1HA GLY 18 -18.122 69.787 14.035 1.00 0.63 1RES 386
ATOM 309 2HA GLY 18 -19.244 70.131 12.719 1.00 0.66 1RES 387
ATOM 310 N LEU 19 -18.853 71.954 15.449 0.00 0.63 1RES 388
ATOM 311 CA LEU 19 -18.887 73.364 15.941 0.00 0.60 1RES 389
ATOM 312 C LEU 19 -17.533 73.747 16.531 0.00 0.56 1RES 390
ATOM 313 O LEU 19 -16.560 73.030 16.394 0.00 0.70 1RES 391
ATOM 314 CB LEU 19 -19.952 73.486 17.019 0.00 0.72 1RES 392
ATOM 315 CG LEU 19 -21.345 73.616 16.412 0.00 0.73 1RES 393
ATOM 316 CD1 LEU 19 -21.681 72.387 15.570 0.00 1.18 1RES 394
ATOM 317 CD2 LEU 19 -22.339 73.737 17.561 0.00 1.33 1RES 395
ATOM 318 H LEU 19 -18.628 71.230 16.070 1.00 0.92 1RES 396
ATOM 319 HA LEU 19 -19.116 74.033 15.137 1.00 0.63 1RES 397
ATOM 320 1HB LEU 19 -19.919 72.616 17.654 1.00 0.87 1RES 398
ATOM 321 2HB LEU 19 -19.756 74.361 17.605 1.00 1.03 1RES 399
ATOM 322 HG LEU 19 -21.393 74.502 15.797 1.00 1.44 1RES 400
ATOM 323 1HD1 LEU 19 -21.111 71.542 15.924 1.00 1.79 1RES 401
ATOM 324 2HD1 LEU 19 -22.735 72.174 15.653 1.00 1.76 1RES 402
ATOM 325 3HD1 LEU 19 -21.433 72.582 14.538 1.00 1.70 1RES 403
ATOM 326 1HD2 LEU 19 -21.886 74.314 18.356 1.00 1.92 1RES 404
ATOM 327 2HD2 LEU 19 -23.234 74.232 17.217 1.00 1.86 1RES 405
ATOM 328 3HD2 LEU 19 -22.586 72.752 17.928 1.00 1.80 1RES 406
ATOM 329 N GLY 20 -17.466 74.883 17.181 0.00 0.49 1RES 407
ATOM 330 CA GLY 20 -16.170 75.329 17.776 0.00 0.53 1RES 408
ATOM 331 C GLY 20 -16.406 76.354 18.893 0.00 0.49 1RES 409
ATOM 332 O GLY 20 -16.887 77.428 18.633 0.00 0.50 1RES 410
ATOM 333 H GLY 20 -18.269 75.444 17.268 1.00 0.51 1RES 411
ATOM 334 1HA GLY 20 -15.646 74.475 18.178 1.00 0.65 1RES 412
ATOM 335 2HA GLY 20 -15.566 75.783 17.005 1.00 0.58 1RES 413
ATOM 336 N ALA 21 -16.047 75.998 20.123 0.00 0.55 1RES 414
ATOM 337 CA ALA 21 -16.173 76.890 21.350 0.00 0.59 1RES 415
ATOM 338 C ALA 21 -17.131 78.076 21.178 0.00 0.49 1RES 416
ATOM 339 O ALA 21 -18.200 78.081 21.735 0.00 0.48 1RES 417
ATOM 340 CB ALA 21 -14.791 77.434 21.714 0.00 0.71 1RES 418
ATOM 341 H ALA 21 -15.671 75.103 20.250 1.00 0.62 1RES 419
ATOM 342 HA ALA 21 -16.523 76.287 22.174 1.00 0.71 1RES 420
ATOM 343 1HB ALA 21 -14.340 77.884 20.842 1.00 1.27 1RES 421
ATOM 344 2HB ALA 21 -14.892 78.178 22.492 1.00 1.13 1RES 422
ATOM 345 3HB ALA 21 -14.167 76.627 22.067 1.00 1.26 1RES 423
ATOM 346 N SER 22 -16.741 79.089 20.432 0.00 0.53 1RES 424
ATOM 347 CA SER 22 -17.621 80.291 20.227 0.00 0.56 1RES 425
ATOM 348 C SER 22 -19.053 79.858 19.868 0.00 0.44 1RES 426
ATOM 349 O SER 22 -19.990 80.161 20.579 0.00 0.51 1RES 427
ATOM 350 CB SER 22 -17.052 81.142 19.091 0.00 0.82 1RES 428
ATOM 351 OG SER 22 -16.011 81.967 19.599 0.00 1.56 1RES 429
ATOM 352 H SER 22 -15.857 79.062 20.008 1.00 0.60 1RES 430
ATOM 353 HA SER 22 -17.642 80.876 21.134 1.00 0.64 1RES 431
ATOM 354 1HB SER 22 -16.653 80.501 18.323 1.00 1.25 1RES 432
ATOM 355 2HB SER 22 -17.839 81.755 18.672 1.00 1.13 1RES 433
ATOM 356 HG SER 22 -16.379 82.836 19.774 1.00 1.93 1RES 434
ATOM 357 N HIS 23 -19.220 79.147 18.780 0.00 0.51 1RES 435
ATOM 358 CA HIS 23 -20.583 78.680 18.383 0.00 0.64 1RES 436
ATOM 359 C HIS 23 -21.068 77.641 19.403 0.00 0.56 1RES 437
ATOM 360 O HIS 23 -22.237 77.582 19.735 0.00 0.74 1RES 438
ATOM 361 CB HIS 23 -20.517 78.048 16.985 0.00 0.88 1RES 439
ATOM 362 CG HIS 23 -21.885 77.571 16.568 0.00 1.07 1RES 440
ATOM 363 ND1 HIS 23 -22.507 78.018 15.413 0.00 1.31 1RES 441
ATOM 364 CD2 HIS 23 -22.759 76.681 17.145 0.00 1.33 1RES 442
ATOM 365 CE1 HIS 23 -23.701 77.403 15.332 0.00 1.64 1RES 443
ATOM 366 NE2 HIS 23 -23.905 76.576 16.362 0.00 1.68 1RES 444
ATOM 367 H HIS 23 -18.448 78.915 18.228 1.00 0.62 1RES 445
ATOM 368 HA HIS 23 -21.263 79.519 18.371 1.00 0.78 1RES 446
ATOM 369 1HB HIS 23 -20.164 78.783 16.277 1.00 1.12 1RES 447
ATOM 370 2HB HIS 23 -19.835 77.211 17.002 1.00 1.03 1RES 448
ATOM 371 HD1 HIS 23 -22.144 78.666 14.774 1.00 1.38 1RES 449
ATOM 372 HD2 HIS 23 -22.582 76.146 18.070 1.00 1.41 1RES 450
ATOM 373 HE1 HIS 23 -24.409 77.557 14.530 1.00 1.94 1RES 451
ATOM 374 N ILE 24 -20.171 76.833 19.912 0.00 0.43 1RES 452
ATOM 375 CA ILE 24 -20.567 75.796 20.930 0.00 0.52 1RES 453
ATOM 376 C ILE 24 -20.978 76.483 22.242 0.00 0.75 1RES 454
ATOM 377 O ILE 24 -21.527 75.865 23.131 0.00 1.20 1RES 455
ATOM 378 CB ILE 24 -19.376 74.864 21.179 0.00 0.52 1RES 456
ATOM 379 CG1 ILE 24 -18.892 74.327 19.846 0.00 0.91 1RES 457
ATOM 380 CG2 ILE 24 -19.767 73.667 22.065 0.00 0.80 1RES 458
ATOM 381 CD1 ILE 24 -17.617 73.564 20.080 0.00 1.39 1RES 459
ATOM 382 H ILE 24 -19.230 76.918 19.636 1.00 0.41 1RES 460
ATOM 383 HA ILE 24 -21.399 75.221 20.551 1.00 0.64 1RES 461
ATOM 384 HB ILE 24 -18.579 75.417 21.652 1.00 0.84 1RES 462
ATOM 385 1HG1 ILE 24 -19.639 73.664 19.442 1.00 1.06 1RES 463
ATOM 386 2HG1 ILE 24 -18.710 75.137 19.161 1.00 1.43 1RES 464
ATOM 387 1HG2 ILE 24 -20.840 73.597 22.119 1.00 1.33 1RES 465
ATOM 388 2HG2 ILE 24 -19.356 72.742 21.639 1.00 1.24 1RES 466
ATOM 389 3HG2 ILE 24 -19.361 73.808 23.053 1.00 1.29 1RES 467
ATOM 390 1HD1 ILE 24 -17.072 74.040 20.878 1.00 1.85 1RES 468
ATOM 391 2HD1 ILE 24 -17.867 72.564 20.364 1.00 1.88 1RES 469
ATOM 392 3HD1 ILE 24 -17.027 73.549 19.188 1.00 1.84 1RES 470
ATOM 393 N SER 25 -20.716 77.759 22.361 0.00 0.57 1RES 471
ATOM 394 CA SER 25 -21.083 78.513 23.592 0.00 0.85 1RES 472
ATOM 395 C SER 25 -22.356 79.332 23.327 0.00 0.96 1RES 473
ATOM 396 O SER 25 -23.127 79.602 24.228 0.00 1.16 1RES 474
ATOM 397 CB SER 25 -19.928 79.455 23.959 0.00 1.15 1RES 475
ATOM 398 OG SER 25 -20.408 80.516 24.778 0.00 1.71 1RES 476
ATOM 399 H SER 25 -20.274 78.223 21.635 1.00 0.46 1RES 477
ATOM 400 HA SER 25 -21.258 77.822 24.403 1.00 0.91 1RES 478
ATOM 401 1HB SER 25 -19.174 78.908 24.499 1.00 1.47 1RES 479
ATOM 402 2HB SER 25 -19.494 79.856 23.052 1.00 1.73 1RES 480
ATOM 403 HG SER 25 -20.202 81.346 24.340 1.00 2.02 1RES 481
ATOM 404 N LYS 26 -22.576 79.729 22.096 0.00 1.07 1RES 482
ATOM 405 CA LYS 26 -23.791 80.532 21.764 0.00 1.40 1RES 483
ATOM 406 C LYS 26 -25.012 79.616 21.726 0.00 1.27 1RES 484
ATOM 407 O LYS 26 -25.958 79.801 22.468 0.00 1.42 1RES 485
ATOM 408 CB LYS 26 -23.611 81.198 20.400 0.00 1.74 1RES 486
ATOM 409 CG LYS 26 -22.997 82.597 20.578 0.00 2.12 1RES 487
ATOM 410 CD LYS 26 -21.657 82.682 19.833 0.00 2.31 1RES 488
ATOM 411 CE LYS 26 -20.622 83.389 20.712 0.00 2.62 1RES 489
ATOM 412 NZ LYS 26 -19.298 83.387 20.027 0.00 2.76 1RES 490
ATOM 413 H LYS 26 -21.941 79.500 21.389 1.00 1.07 1RES 491
ATOM 414 HA LYS 26 -23.936 81.292 22.514 1.00 1.58 1RES 492
ATOM 415 1HB LYS 26 -22.963 80.589 19.788 1.00 1.95 1RES 493
ATOM 416 2HB LYS 26 -24.572 81.291 19.923 1.00 2.05 1RES 494
ATOM 417 1HG LYS 26 -23.675 83.336 20.177 1.00 2.50 1RES 495
ATOM 418 2HG LYS 26 -22.837 82.793 21.629 1.00 2.47 1RES 496
ATOM 419 1HD LYS 26 -21.309 81.686 19.598 1.00 2.74 1RES 497
ATOM 420 2HD LYS 26 -21.790 83.241 18.919 1.00 2.57 1RES 498
ATOM 421 1HE LYS 26 -20.934 84.407 20.889 1.00 2.91 1RES 499
ATOM 422 2HE LYS 26 -20.539 82.869 21.656 1.00 3.14 1RES 500
ATOM 423 1HZ LYS 26 -19.439 83.455 18.998 1.00 2.74 1RES 501
ATOM 424 2HZ LYS 26 -18.737 84.198 20.354 1.00 3.19 1RES 502
ATOM 425 3HZ LYS 26 -18.793 82.507 20.251 1.00 3.06 1RES 503
ATOM 426 N THR 27 -24.994 78.622 20.871 0.00 1.09 1RES 504
ATOM 427 CA THR 27 -26.149 77.678 20.786 0.00 1.16 1RES 505
ATOM 428 C THR 27 -26.337 77.005 22.149 0.00 0.87 1RES 506
ATOM 429 O THR 27 -27.431 76.938 22.676 0.00 0.93 1RES 507
ATOM 430 CB THR 27 -25.862 76.622 19.716 0.00 1.38 1RES 508
ATOM 431 OG1 THR 27 -25.586 77.267 18.481 0.00 1.95 1RES 509
ATOM 432 CG2 THR 27 -27.077 75.709 19.556 0.00 1.87 1RES 510
ATOM 433 H THR 27 -24.215 78.492 20.291 1.00 1.02 1RES 511
ATOM 434 HA THR 27 -27.044 78.225 20.527 1.00 1.43 1RES 512
ATOM 435 HB THR 27 -25.010 76.033 20.012 1.00 1.28 1RES 513
ATOM 436 HG1 THR 27 -26.300 77.883 18.301 1.00 2.15 1RES 514
ATOM 437 1HG2 THR 27 -27.437 75.413 20.530 1.00 2.26 1RES 515
ATOM 438 2HG2 THR 27 -27.858 76.238 19.029 1.00 2.20 1RES 516
ATOM 439 3HG2 THR 27 -26.796 74.830 18.994 1.00 2.33 1RES 517
ATOM 440 N MET 28 -25.263 76.535 22.729 0.00 0.77 1RES 518
ATOM 441 CA MET 28 -25.327 75.902 24.048 0.00 0.77 1RES 519
ATOM 442 C MET 28 -24.819 76.938 25.063 0.00 0.98 1RES 520
ATOM 443 O MET 28 -23.635 77.169 25.194 0.00 1.84 1RES 521
ATOM 444 CB MET 28 -24.431 74.656 24.013 0.00 1.10 1RES 522
ATOM 445 CG MET 28 -24.372 74.020 25.398 0.00 2.23 1RES 523
ATOM 446 SD MET 28 -25.417 72.538 25.459 0.00 3.11 1RES 524
ATOM 447 CE MET 28 -26.936 73.278 24.803 0.00 3.70 1RES 525
ATOM 448 H MET 28 -24.399 76.617 22.302 1.00 0.87 1RES 526
ATOM 449 HA MET 28 -26.344 75.627 24.278 1.00 0.97 1RES 527
ATOM 450 1HB MET 28 -24.828 73.942 23.297 1.00 1.31 1RES 528
ATOM 451 2HB MET 28 -23.438 74.938 23.709 1.00 1.41 1RES 529
ATOM 452 1HG MET 28 -23.352 73.752 25.612 1.00 2.78 1RES 530
ATOM 453 2HG MET 28 -24.714 74.733 26.127 1.00 2.70 1RES 531
ATOM 454 1HE MET 28 -26.733 73.728 23.843 1.00 3.85 1RES 532
ATOM 455 2HE MET 28 -27.689 72.512 24.687 1.00 4.13 1RES 533
ATOM 456 3HE MET 28 -27.288 74.038 25.487 1.00 4.04 1RES 534
ATOM 457 N ASN 29 -25.724 77.592 25.741 0.00 1.24 1RES 535
ATOM 458 CA ASN 29 -25.347 78.662 26.723 0.00 1.66 1RES 536
ATOM 459 C ASN 29 -24.253 78.199 27.698 0.00 1.19 1RES 537
ATOM 460 O ASN 29 -24.538 77.670 28.752 0.00 1.60 1RES 538
ATOM 461 CB ASN 29 -26.588 79.062 27.522 0.00 2.67 1RES 539
ATOM 462 CG ASN 29 -26.309 80.357 28.287 0.00 3.49 1RES 540
ATOM 463 OD1 ASN 29 -25.314 80.467 28.977 0.00 4.02 1RES 541
ATOM 464 ND2 ASN 29 -27.151 81.349 28.195 0.00 4.12 1RES 542
ATOM 465 H ASN 29 -26.670 77.402 25.578 1.00 1.79 1RES 543
ATOM 466 HA ASN 29 -24.991 79.525 26.181 1.00 2.02 1RES 544
ATOM 467 1HB ASN 29 -27.417 79.214 26.846 1.00 3.04 1RES 545
ATOM 468 2HB ASN 29 -26.833 78.278 28.223 1.00 3.00 1RES 546
ATOM 469 1HD2 ASN 29 -26.981 82.183 28.681 1.00 4.84 1RES 547
ATOM 470 2HD2 ASN 29 -27.953 81.261 27.639 1.00 4.14 1RES 548
ATOM 471 N ILE 30 -23.008 78.436 27.361 0.00 0.79 1RES 549
ATOM 472 CA ILE 30 -21.873 78.053 28.269 0.00 0.85 1RES 550
ATOM 473 C ILE 30 -20.587 78.720 27.767 0.00 0.62 1RES 551
ATOM 474 O ILE 30 -20.360 78.820 26.579 0.00 1.11 1RES 552
ATOM 475 CB ILE 30 -21.665 76.527 28.307 0.00 1.63 1RES 553
ATOM 476 CG1 ILE 30 -21.962 75.905 26.939 0.00 2.05 1RES 554
ATOM 477 CG2 ILE 30 -22.582 75.901 29.358 0.00 2.22 1RES 555
ATOM 478 CD1 ILE 30 -21.239 74.566 26.826 0.00 2.71 1RES 556
ATOM 479 H ILE 30 -22.816 78.890 26.513 1.00 1.02 1RES 557
ATOM 480 HA ILE 30 -22.087 78.409 29.268 1.00 1.29 1RES 558
ATOM 481 HB ILE 30 -20.637 76.322 28.574 1.00 1.93 1RES 559
ATOM 482 1HG1 ILE 30 -23.027 75.751 26.838 1.00 2.51 1RES 560
ATOM 483 2HG1 ILE 30 -21.617 76.566 26.159 1.00 2.29 1RES 561
ATOM 484 1HG2 ILE 30 -22.817 76.635 30.114 1.00 2.74 1RES 562
ATOM 485 2HG2 ILE 30 -23.495 75.567 28.886 1.00 2.62 1RES 563
ATOM 486 3HG2 ILE 30 -22.084 75.059 29.815 1.00 2.37 1RES 564
ATOM 487 1HD1 ILE 30 -20.364 74.576 27.461 1.00 3.35 1RES 565
ATOM 488 2HD1 ILE 30 -21.901 73.771 27.138 1.00 3.05 1RES 566
ATOM 489 3HD1 ILE 30 -20.940 74.405 25.803 1.00 2.88 1RES 567
ATOM 490 N ALA 31 -19.741 79.172 28.664 0.00 0.82 1RES 568
ATOM 491 CA ALA 31 -18.462 79.833 28.240 0.00 0.71 1RES 569
ATOM 492 C ALA 31 -17.621 78.834 27.444 0.00 0.60 1RES 570
ATOM 493 O ALA 31 -17.856 77.651 27.514 0.00 0.61 1RES 571
ATOM 494 CB ALA 31 -17.684 80.283 29.478 0.00 0.86 1RES 572
ATOM 495 H ALA 31 -19.946 79.072 29.616 1.00 1.39 1RES 573
ATOM 496 HA ALA 31 -18.686 80.690 27.621 1.00 0.89 1RES 574
ATOM 497 1HB ALA 31 -18.375 80.645 30.225 1.00 1.32 1RES 575
ATOM 498 2HB ALA 31 -17.127 79.448 29.877 1.00 1.25 1RES 576
ATOM 499 3HB ALA 31 -17.001 81.074 29.206 1.00 1.48 1RES 577
ATOM 500 N ARG 32 -16.658 79.295 26.677 0.00 0.58 1RES 578
ATOM 501 CA ARG 32 -15.827 78.359 25.869 0.00 0.55 1RES 579
ATOM 502 C ARG 32 -15.002 77.439 26.779 0.00 0.44 1RES 580
ATOM 503 O ARG 32 -14.890 76.251 26.526 0.00 0.44 1RES 581
ATOM 504 CB ARG 32 -14.909 79.168 24.951 0.00 0.67 1RES 582
ATOM 505 CG ARG 32 -14.002 80.086 25.775 0.00 0.73 1RES 583
ATOM 506 CD ARG 32 -12.663 79.392 26.048 0.00 1.23 1RES 584
ATOM 507 NE ARG 32 -11.549 80.228 25.501 0.00 1.54 1RES 585
ATOM 508 CZ ARG 32 -10.296 80.021 25.856 0.00 2.09 1RES 586
ATOM 509 NH1 ARG 32 -9.970 79.083 26.716 0.00 2.69 1RES 587
ATOM 510 NH2 ARG 32 -9.358 80.769 25.343 0.00 2.64 1RES 588
ATOM 511 H ARG 32 -16.490 80.256 26.620 1.00 0.66 1RES 589
ATOM 512 HA ARG 32 -16.480 77.753 25.263 1.00 0.58 1RES 590
ATOM 513 1HB ARG 32 -14.301 78.494 24.365 1.00 0.89 1RES 591
ATOM 514 2HB ARG 32 -15.517 79.771 24.294 1.00 0.91 1RES 592
ATOM 515 1HG ARG 32 -13.825 80.998 25.222 1.00 1.06 1RES 593
ATOM 516 2HG ARG 32 -14.482 80.325 26.710 1.00 1.10 1RES 594
ATOM 517 1HD ARG 32 -12.532 79.272 27.112 1.00 1.61 1RES 595
ATOM 518 2HD ARG 32 -12.648 78.423 25.572 1.00 1.83 1RES 596
ATOM 519 HE ARG 32 -11.755 80.941 24.861 1.00 1.94 1RES 597
ATOM 520 1HH1 ARG 32 -10.673 78.502 27.123 1.00 2.72 1RES 598
ATOM 521 2HH1 ARG 32 -9.012 78.951 26.965 1.00 3.41 1RES 599
ATOM 522 1HH2 ARG 32 -9.593 81.489 24.689 1.00 2.80 1RES 600
ATOM 523 2HH2 ARG 32 -8.403 80.623 25.603 1.00 3.19 1RES 601
ATOM 524 N SER 33 -14.440 77.964 27.839 0.00 0.43 1RES 602
ATOM 525 CA SER 33 -13.639 77.097 28.758 0.00 0.39 1RES 603
ATOM 526 C SER 33 -14.605 76.191 29.521 0.00 0.37 1RES 604
ATOM 527 O SER 33 -14.317 75.041 29.801 0.00 0.35 1RES 605
ATOM 528 CB SER 33 -12.841 77.953 29.755 0.00 0.47 1RES 606
ATOM 529 OG SER 33 -12.801 79.304 29.314 0.00 1.13 1RES 607
ATOM 530 H SER 33 -14.556 78.915 28.034 1.00 0.50 1RES 608
ATOM 531 HA SER 33 -12.959 76.488 28.171 1.00 0.38 1RES 609
ATOM 532 1HB SER 33 -13.310 77.916 30.724 1.00 1.28 1RES 610
ATOM 533 2HB SER 33 -11.835 77.562 29.834 1.00 1.21 1RES 611
ATOM 534 HG SER 33 -13.000 79.867 30.066 1.00 1.56 1RES 612
ATOM 535 N THR 34 -15.763 76.709 29.843 0.00 0.44 1RES 613
ATOM 536 CA THR 34 -16.783 75.907 30.575 0.00 0.49 1RES 614
ATOM 537 C THR 34 -17.174 74.706 29.718 0.00 0.49 1RES 615
ATOM 538 O THR 34 -17.451 73.623 30.218 0.00 0.53 1RES 616
ATOM 539 CB THR 34 -18.016 76.779 30.822 0.00 0.59 1RES 617
ATOM 540 OG1 THR 34 -17.627 77.960 31.511 0.00 0.62 1RES 618
ATOM 541 CG2 THR 34 -19.035 76.008 31.663 0.00 0.67 1RES 619
ATOM 542 H THR 34 -15.965 77.632 29.590 1.00 0.48 1RES 620
ATOM 543 HA THR 34 -16.379 75.570 31.517 1.00 0.48 1RES 621
ATOM 544 HB THR 34 -18.462 77.045 29.874 1.00 0.61 1RES 622
ATOM 545 HG1 THR 34 -18.305 78.624 31.367 1.00 1.06 1RES 623
ATOM 546 1HG2 THR 34 -18.524 75.484 32.457 1.00 0.97 1RES 624
ATOM 547 2HG2 THR 34 -19.748 76.699 32.088 1.00 1.39 1RES 625
ATOM 548 3HG2 THR 34 -19.553 75.296 31.038 1.00 1.29 1RES 626
ATOM 549 N VAL 35 -17.178 74.884 28.420 0.00 0.49 1RES 627
ATOM 550 CA VAL 35 -17.530 73.759 27.525 0.00 0.51 1RES 628
ATOM 551 C VAL 35 -16.445 72.703 27.652 0.00 0.40 1RES 629
ATOM 552 O VAL 35 -16.723 71.536 27.573 0.00 0.44 1RES 630
ATOM 553 CB VAL 35 -17.616 74.217 26.063 0.00 0.61 1RES 631
ATOM 554 CG1 VAL 35 -18.332 73.141 25.245 0.00 0.58 1RES 632
ATOM 555 CG2 VAL 35 -18.394 75.530 25.949 0.00 0.94 1RES 633
ATOM 556 H VAL 35 -16.933 75.749 28.041 1.00 0.53 1RES 634
ATOM 557 HA VAL 35 -18.477 73.340 27.830 1.00 0.58 1RES 635
ATOM 558 HB VAL 35 -16.617 74.356 25.678 1.00 0.82 1RES 636
ATOM 559 1HG1 VAL 35 -18.236 72.178 25.747 1.00 1.10 1RES 637
ATOM 560 2HG1 VAL 35 -19.376 73.393 25.150 1.00 1.21 1RES 638
ATOM 561 3HG1 VAL 35 -17.881 73.084 24.258 1.00 1.21 1RES 639
ATOM 562 1HG2 VAL 35 -18.871 75.751 26.891 1.00 1.29 1RES 640
ATOM 563 2HG2 VAL 35 -17.711 76.323 25.696 1.00 1.56 1RES 641
ATOM 564 3HG2 VAL 35 -19.144 75.445 25.175 1.00 1.46 1RES 642
ATOM 565 N TYR 36 -15.207 73.110 27.850 0.00 0.35 1RES 643
ATOM 566 CA TYR 36 -14.105 72.101 27.980 0.00 0.32 1RES 644
ATOM 567 C TYR 36 -14.144 71.415 29.334 0.00 0.37 1RES 645
ATOM 568 O TYR 36 -13.558 70.362 29.504 0.00 0.47 1RES 646
ATOM 569 CB TYR 36 -12.744 72.738 27.687 0.00 0.32 1RES 647
ATOM 570 CG TYR 36 -12.621 72.920 26.186 0.00 0.31 1RES 648
ATOM 571 CD1 TYR 36 -12.937 71.863 25.309 0.00 1.26 1RES 649
ATOM 572 CD2 TYR 36 -12.219 74.151 25.671 0.00 1.15 1RES 650
ATOM 573 CE1 TYR 36 -12.854 72.038 23.931 0.00 1.27 1RES 651
ATOM 574 CE2 TYR 36 -12.129 74.334 24.287 0.00 1.16 1RES 652
ATOM 575 CZ TYR 36 -12.450 73.279 23.413 0.00 0.39 1RES 653
ATOM 576 OH TYR 36 -12.351 73.462 22.049 0.00 0.45 1RES 654
ATOM 577 H TYR 36 -15.009 74.073 27.908 1.00 0.40 1RES 655
ATOM 578 HA TYR 36 -14.275 71.333 27.260 1.00 0.37 1RES 656
ATOM 579 1HB TYR 36 -12.676 73.700 28.176 1.00 0.34 1RES 657
ATOM 580 2HB TYR 36 -11.954 72.092 28.038 1.00 0.37 1RES 658
ATOM 581 HD1 TYR 36 -13.243 70.908 25.706 1.00 2.13 1RES 659
ATOM 582 HD2 TYR 36 -11.977 74.961 26.343 1.00 2.02 1RES 660
ATOM 583 HE1 TYR 36 -13.125 71.217 23.269 1.00 2.16 1RES 661
ATOM 584 HE2 TYR 36 -11.821 75.290 23.894 1.00 2.05 1RES 662
ATOM 585 HH TYR 36 -12.700 74.331 21.840 1.00 0.92 1RES 663
ATOM 586 N LYS 37 -14.892 71.933 30.272 0.00 0.39 1RES 664
ATOM 587 CA LYS 37 -15.035 71.219 31.562 0.00 0.49 1RES 665
ATOM 588 C LYS 37 -15.846 69.957 31.253 0.00 0.56 1RES 666
ATOM 589 O LYS 37 -15.586 68.878 31.747 0.00 0.64 1RES 667
ATOM 590 CB LYS 37 -15.805 72.080 32.553 0.00 0.54 1RES 668
ATOM 591 CG LYS 37 -14.828 72.876 33.426 0.00 0.92 1RES 669
ATOM 592 CD LYS 37 -14.736 74.315 32.918 0.00 1.65 1RES 670
ATOM 593 CE LYS 37 -13.373 74.901 33.289 0.00 2.40 1RES 671
ATOM 594 NZ LYS 37 -12.326 74.327 32.397 0.00 3.11 1RES 672
ATOM 595 H LYS 37 -15.403 72.743 30.108 1.00 0.41 1RES 673
ATOM 596 HA LYS 37 -14.072 70.964 31.949 1.00 0.52 1RES 674
ATOM 597 1HB LYS 37 -16.447 72.754 32.007 1.00 0.79 1RES 675
ATOM 598 2HB LYS 37 -16.406 71.442 33.179 1.00 0.83 1RES 676
ATOM 599 1HG LYS 37 -15.180 72.877 34.447 1.00 1.63 1RES 677
ATOM 600 2HG LYS 37 -13.850 72.419 33.385 1.00 1.40 1RES 678
ATOM 601 1HD LYS 37 -14.854 74.325 31.845 1.00 2.25 1RES 679
ATOM 602 2HD LYS 37 -15.516 74.908 33.372 1.00 2.07 1RES 680
ATOM 603 1HE LYS 37 -13.398 75.974 33.170 1.00 2.84 1RES 681
ATOM 604 2HE LYS 37 -13.144 74.658 34.316 1.00 2.71 1RES 682
ATOM 605 1HZ LYS 37 -12.720 74.182 31.447 1.00 3.17 1RES 683
ATOM 606 2HZ LYS 37 -11.519 74.983 32.343 1.00 3.59 1RES 684
ATOM 607 3HZ LYS 37 -12.006 73.415 32.780 1.00 3.57 1RES 685
ATOM 608 N VAL 38 -16.836 70.123 30.411 0.00 0.56 1RES 686
ATOM 609 CA VAL 38 -17.717 68.998 29.999 0.00 0.66 1RES 687
ATOM 610 C VAL 38 -16.984 68.049 29.011 0.00 0.65 1RES 688
ATOM 611 O VAL 38 -16.913 66.853 29.212 0.00 0.76 1RES 689
ATOM 612 CB VAL 38 -18.961 69.651 29.343 0.00 0.73 1RES 690
ATOM 613 CG1 VAL 38 -19.576 68.790 28.229 0.00 0.81 1RES 691
ATOM 614 CG2 VAL 38 -20.004 69.901 30.426 0.00 0.88 1RES 692
ATOM 615 H VAL 38 -17.011 71.021 30.045 1.00 0.52 1RES 693
ATOM 616 HA VAL 38 -18.020 68.453 30.870 1.00 0.75 1RES 694
ATOM 617 HB VAL 38 -18.668 70.601 28.921 1.00 0.87 1RES 695
ATOM 618 1HG1 VAL 38 -19.364 67.748 28.417 1.00 1.43 1RES 696
ATOM 619 2HG1 VAL 38 -20.643 68.944 28.201 1.00 1.19 1RES 697
ATOM 620 3HG1 VAL 38 -19.143 69.085 27.279 1.00 1.28 1RES 698
ATOM 621 1HG2 VAL 38 -20.233 68.972 30.926 1.00 1.22 1RES 699
ATOM 622 2HG2 VAL 38 -19.607 70.608 31.140 1.00 1.32 1RES 700
ATOM 623 3HG2 VAL 38 -20.900 70.304 29.978 1.00 1.52 1RES 701
ATOM 624 N ILE 39 -16.484 68.591 27.935 0.00 0.56 1RES 702
ATOM 625 CA ILE 39 -15.791 67.783 26.877 0.00 0.59 1RES 703
ATOM 626 C ILE 39 -14.658 66.979 27.506 0.00 0.68 1RES 704
ATOM 627 O ILE 39 -14.362 65.870 27.101 0.00 0.82 1RES 705
ATOM 628 CB ILE 39 -15.246 68.735 25.807 0.00 0.53 1RES 706
ATOM 629 CG1 ILE 39 -16.362 69.637 25.308 0.00 0.52 1RES 707
ATOM 630 CG2 ILE 39 -14.692 67.989 24.596 0.00 0.59 1RES 708
ATOM 631 CD1 ILE 39 -15.784 71.000 25.044 0.00 1.01 1RES 709
ATOM 632 H ILE 39 -16.584 69.537 27.809 1.00 0.50 1RES 710
ATOM 633 HA ILE 39 -16.494 67.122 26.424 1.00 0.65 1RES 711
ATOM 634 HB ILE 39 -14.472 69.333 26.233 1.00 0.58 1RES 712
ATOM 635 1HG1 ILE 39 -16.765 69.238 24.391 1.00 1.17 1RES 713
ATOM 636 2HG1 ILE 39 -17.142 69.712 26.039 1.00 1.19 1RES 714
ATOM 637 1HG2 ILE 39 -15.308 67.128 24.391 1.00 1.06 1RES 715
ATOM 638 2HG2 ILE 39 -14.710 68.664 23.735 1.00 1.16 1RES 716
ATOM 639 3HG2 ILE 39 -13.679 67.679 24.791 1.00 1.24 1RES 717
ATOM 640 1HD1 ILE 39 -15.291 71.360 25.915 1.00 1.62 1RES 718
ATOM 641 2HD1 ILE 39 -15.078 70.936 24.230 1.00 1.66 1RES 719
ATOM 642 3HD1 ILE 39 -16.569 71.663 24.785 1.00 1.61 1RES 720
ATOM 643 N ASN 40 -14.046 67.533 28.511 0.00 0.64 1RES 721
ATOM 644 CA ASN 40 -12.945 66.823 29.215 0.00 0.76 1RES 722
ATOM 645 C ASN 40 -13.539 65.647 29.985 0.00 0.87 1RES 723
ATOM 646 O ASN 40 -12.973 64.571 30.031 0.00 0.99 1RES 724
ATOM 647 CB ASN 40 -12.283 67.780 30.203 0.00 0.75 1RES 725
ATOM 648 CG ASN 40 -10.998 67.152 30.744 0.00 1.27 1RES 726
ATOM 649 OD1 ASN 40 -10.385 66.334 30.087 0.00 1.71 1RES 727
ATOM 650 ND2 ASN 40 -10.560 67.503 31.922 0.00 2.06 1RES 728
ATOM 651 H ASN 40 -14.325 68.418 28.815 1.00 0.55 1RES 729
ATOM 652 HA ASN 40 -12.217 66.469 28.500 1.00 0.81 1RES 730
ATOM 653 1HB ASN 40 -12.051 68.710 29.704 1.00 1.03 1RES 731
ATOM 654 2HB ASN 40 -12.964 67.967 31.021 1.00 1.01 1RES 732
ATOM 655 1HD2 ASN 40 -9.738 67.106 32.277 1.00 2.59 1RES 733
ATOM 656 2HD2 ASN 40 -11.054 68.163 32.452 1.00 2.39 1RES 734
ATOM 657 N GLU 41 -14.681 65.852 30.592 0.00 0.00 1RES 735
ATOM 658 CA GLU 41 -15.330 64.755 31.369 0.00 0.00 1RES 736
ATOM 659 C GLU 41 -15.675 63.597 30.430 0.00 0.00 1RES 737
ATOM 660 O GLU 41 -15.666 62.446 30.822 0.00 0.00 1RES 738
ATOM 661 CB GLU 41 -16.608 65.280 32.024 0.00 0.00 1RES 739
ATOM 662 CG GLU 41 -16.244 66.216 33.178 0.00 0.00 1RES 740
ATOM 663 CD GLU 41 -17.493 66.973 33.634 0.00 0.00 1RES 741
ATOM 664 OE1 GLU 41 -18.302 67.307 32.785 0.00 0.00 1RES 742
ATOM 665 OE2 GLU 41 -17.617 67.207 34.825 0.00 0.00 1RES 743
ATOM 666 H GLU 41 -15.114 66.736 30.536 1.00 0.00 1RES 744
ATOM 667 HA GLU 41 -14.652 64.407 32.134 1.00 0.00 1RES 745
ATOM 668 1HB GLU 41 -17.193 65.818 31.292 1.00 0.00 1RES 746
ATOM 669 2HB GLU 41 -17.183 64.449 32.405 1.00 0.00 1RES 747
ATOM 670 1HG GLU 41 -15.853 65.636 34.001 1.00 0.00 1RES 748
ATOM 671 2HG GLU 41 -15.498 66.922 32.847 1.00 0.00 1RES 749
ATOM 672 N SER 42 -15.979 63.897 29.191 0.00 0.00 1RES 750
ATOM 673 CA SER 42 -16.327 62.821 28.211 0.00 0.00 1RES 751
ATOM 674 C SER 42 -17.548 62.041 28.708 0.00 0.00 1RES 752
ATOM 675 O SER 42 -17.708 60.872 28.413 0.00 0.00 1RES 753
ATOM 676 CB SER 42 -15.141 61.867 28.054 0.00 0.00 1RES 754
ATOM 677 OG SER 42 -13.930 62.606 28.131 0.00 0.00 1RES 755
ATOM 678 H SER 42 -15.977 64.834 28.903 1.00 0.00 1RES 756
ATOM 679 HA SER 42 -16.554 63.269 27.255 1.00 0.00 1RES 757
ATOM 680 1HB SER 42 -15.160 61.134 28.843 1.00 0.00 1RES 758
ATOM 681 2HB SER 42 -15.209 61.364 27.098 1.00 0.00 1RES 759
ATOM 682 HG SER 42 -13.362 62.321 27.412 1.00 0.00 1RES 760
ATOM 683 N ASN 43 -18.407 62.682 29.460 0.00 0.00 1RES 761
ATOM 684 CA ASN 43 -19.620 61.986 29.981 0.00 0.00 1RES 762
ATOM 685 C ASN 43 -20.675 61.902 28.877 0.00 0.00 1RES 763
ATOM 686 O ASN 43 -21.185 60.816 28.653 0.00 0.00 1RES 764
ATOM 687 CB ASN 43 -20.186 62.767 31.170 0.00 0.00 1RES 765
ATOM 688 CG ASN 43 -20.423 64.222 30.760 0.00 0.00 1RES 766
ATOM 689 OD1 ASN 43 -19.562 65.061 30.931 0.00 0.00 1RES 767
ATOM 690 ND2 ASN 43 -21.563 64.557 30.221 0.00 0.00 1RES 768
ATOM 691 OXT ASN 43 -20.957 62.925 28.274 0.00 0.00 1RES 769
ATOM 692 H ASN 43 -18.253 63.624 29.682 1.00 0.00 1RES 770
ATOM 693 HA ASN 43 -19.353 60.989 30.300 1.00 0.00 1RES 771
ATOM 694 1HB ASN 43 -21.120 62.322 31.480 1.00 0.00 1RES 772
ATOM 695 2HB ASN 43 -19.483 62.736 31.988 1.00 0.00 1RES 773
ATOM 696 1HD2 ASN 43 -21.724 65.486 29.954 1.00 0.00 1RES 774
ATOM 697 2HD2 ASN 43 -22.257 63.880 30.082 1.00 0.00 1RES 775
TER 698 ASN 43 1RES 776
MASTER 51 0 0 3 0 0 0 6 697 1 0 4 1RES 777
END 1RES 778

File diff suppressed because it is too large Load Diff

@ -0,0 +1,58 @@
#include "stride.h"
/*************************************************************************
** **
** Get PDB secondary structure assignment for every residue **
** **
*************************************************************************/
void GetPdbAsn(CHAIN **Chain, int NChain)
{
register int i, j, k;
int Cn, Beg, End;
char SecondStr;
CHAIN *c;
for( Cn=0; Cn<NChain; Cn++ ) {
c = Chain[Cn];
for( i=0; i<c->NHelix; i++ ) {
switch( c->Helix[i]->Class ) {
case 1: SecondStr = 'H';
break;
case 3: SecondStr = 'I';
break;
case 5: SecondStr = 'G';
break;
}
if( PdbN2SeqN(c,c->Helix[i]->PDB_ResNumb1,&Beg) &&
PdbN2SeqN(c,c->Helix[i]->PDB_ResNumb2,&End) )
for( j=Beg; j<=End; j++ )
if( c->Rsd[j]->Prop->PdbAsn != 'H' )
c->Rsd[j]->Prop->PdbAsn = SecondStr;
}
for( i=0; i<c->NSheet; i++ )
for( j=0; j<c->Sheet[i]->NStrand; j++ ) {
if( PdbN2SeqN(c,c->Sheet[i]->PDB_ResNumb1[j],&Beg) &&
PdbN2SeqN(c,c->Sheet[i]->PDB_ResNumb2[j],&End) )
for( k=Beg; k<=End; k++ )
if( c->Rsd[k]->Prop->PdbAsn != 'H' )
c->Rsd[k]->Prop->PdbAsn = 'E';
}
for( i=0; i<c->NTurn; i++ ) {
if( PdbN2SeqN(c,c->Turn[i]->PDB_ResNumb1,&Beg) &&
PdbN2SeqN(c,c->Turn[i]->PDB_ResNumb2,&End) )
for( j=Beg; j<=End; j++ )
if( c->Rsd[j]->Prop->PdbAsn != 'H' && c->Rsd[j]->Prop->PdbAsn != 'E' )
c->Rsd[j]->Prop->PdbAsn = 'T';
}
}
}

@ -0,0 +1,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;
}
}
}

@ -0,0 +1,49 @@
#include "stride.h"
int PlaceHydrogens(CHAIN *Chain)
{
int Res, i, N, C, CA, H, PlacedCnt=0;
float Length_N_C, Length_N_CA, Length_N_H;
RESIDUE *r, *rr;
for( Res=1; Res<Chain->NRes; Res++ ) {
r = Chain->Rsd[Res];
rr = Chain->Rsd[Res-1];
if( !strcmp(r->ResType,"PRO") ) continue;
/* Replace deiterium atoms by hydrogens */
if( FindAtom(Chain,Res,"D",&H) )
strcmp(r->AtomType[H],"H");
if( !FindAtom(Chain,Res,"H",&H) && FindAtom(Chain,Res,"N",&N) &&
FindAtom(Chain,Res-1,"C",&C) && FindAtom(Chain,Res,"CA",&CA) ) {
H = r->NAtom;
Length_N_C = Dist(r->Coord[N],rr->Coord[C]);
Length_N_CA = Dist(r->Coord[N],r->Coord[CA]);
for( i=0; i<3; i++ )
r->Coord[H][i] = r->Coord[N][i] -
( (rr->Coord[C][i] - r->Coord[N][i])/Length_N_C +
(r->Coord[CA][i] - r->Coord[N][i])/Length_N_CA );
Length_N_H = Dist(r->Coord[N],r->Coord[H]);
for( i=0; i<3; i++ )
r->Coord[H][i] = r->Coord[N][i] +
DIST_N_H*(r->Coord[H][i]-r->Coord[N][i])/Length_N_H;
strcpy(r->AtomType[H],"H");
r->NAtom++;
PlacedCnt++;
}
}
return(PlacedCnt);
}

@ -0,0 +1,190 @@
BOOLEAN ChInStr(char *String, char Char);
BOOLEAN ExistsSecStr(CHAIN **Chain, int NChain);
BOOLEAN ExistSSBond(CHAIN **Chain,int NChain,int Cn1,int Cn2,char *Res1,char *Res2);
BOOLEAN IsHydrogen(char *AtomName) ;
BOOLEAN Specified(char **List, int ListLength, char Option);
FILE *efopen(char *file, char *mode, char *progname);
char **AllocAsn(CHAIN **Chain, int NChain);
char **CharMatrix(int M, int N);
char *OneToThree(char One);
char SpaceToDash(char Id);
char *Tim(void);
char ThreeToOne(char *Three);
char *tolostr(char *InputString);
char *Translate(char Code);
double GetAtomRadius(char *AtomType);
float Ang(float *Coord1, float *Coord2, float *Coord3);
float **DefaultHelixMap(COMMAND *Cmd);
float **DefaultSheetMap(COMMAND *Cmd);
float Dist(float *Coord1, float *Coord2);
float ***FloatCube(int M, int N, int K);
float **FloatMatrix(int M, int N);
float PercentCorrect(char *TestAsn, char *KnownAsn, int Length);
float SecStrContent(CHAIN *Chain, int *HelAlp, int *HelPI, int *Hel310, int *Sheet, int *Turn);
float Torsion(float *Coord1, float *Coord2, float *Coord3, float *Coord4);
float VectorProduct(float *Vector1, float *Vector2, float *Product);
float factrl(int n);
int AssessCorr(QUALITY *Qual);
int AssessPerc(QUALITY *Qual);
int Boundaries(char *Asn, int L, char SecondStr, int (*Bound)[2]);
int CheckAtom(char *At);
int CheckChain(CHAIN *Chain, COMMAND *Cmd);
int CheckRes(char *Res);
int CompareElements(char *Asn1, char *Asn2, char *Asn3, int Length,
char SecStrType, int *Better, int *Worse);
int CompPdbDssp(CHAIN *Chain, DSSP *Dssp);
int CollectOptions(char **List, int ListLength, int Stream, int *Options);
int DefineAcceptor(CHAIN *Chain, ACCEPTOR **Acc, int *ac, int Res, enum HYBRID Hybrid,
enum GROUP Group, float HB_Radius, int N);
int DefineDnr(CHAIN *Chain, DONOR **Dnr, int *dc, int Res, enum HYBRID Hybrid,
enum GROUP Group, float HB_Radius, int N);
int Delete(char *String, char From);
int Difference(char *TestAsn, char *KnownAsn, int Length, char SecStrType, QUALITY *Qual);
int escape(int RetVal, char *format, ... );
int FindAcc(CHAIN *Chain, ACCEPTOR **Acc, int *NAcc, COMMAND *Cmd);
int FindAtom(CHAIN *Chain, int ResNumb, char *Atom, int *AtNumb);
int FindBnd(HBOND **HBond, RESIDUE *Res1, RESIDUE *Res2);
int FindChain(CHAIN **Chain, int NChain, char ChainId);
int FindDnr(CHAIN *Chain, DONOR **Dnr, int *NDnr, COMMAND *Cmd);
int FindHydrogenBonds(CHAIN **Chain, int NChain, HBOND **HBond, COMMAND *Cmd);
int FindPolInt(HBOND **HBond, RESIDUE *Res1, RESIDUE *Res2);
int FullElement(char *Asn1, char *Asn2, char *Asn3, int Length, char SecStrType,
int ElemLength, char EditChar, int *YYN, int *NYY, int *YNN, int *NNY);
int GetPdbChain(CHAIN **Chain, FILE *Db, long int Start);
int ***IntCube(int M, int N, int K);
int **IntMatrix(int M, int N);
int Link(HBOND **HBond, CHAIN **Chain, int Cn1, int Cn2, RESIDUE *Res1_1,
RESIDUE *Res1_2, RESIDUE *Res2_2, RESIDUE *Res2_1, RESIDUE *CRes1, RESIDUE *CRes2,
float **PhiPsiMap, PATTERN **Pattern, int *NumPat, char *Text, float Treshold,
COMMAND *Cmd, int Test);
int MakeEnds(int *Beg1, int ResBeg1, int NeiBeg1, char *Beg1Cn, char ResBeg1Cn,
int *End1, int ResEnd1, int NeiEnd1, char ResEnd1Cn, int *Beg2,
int ResBeg2, int NeiBeg2, char *Beg2Cn, char ResBeg2Cn, int *End2,
int ResEnd2, int NeiEnd2, char ResEnd2Cn, PATTERN **Pat, int NPat);
int MolScript(CHAIN **Chain, int NChain, COMMAND *Cmd);
int Near(int Res1, int Res2, int Res3, int Res4, int Res5, int Res6, int Res7, int Res8,
char Cn1, char Cn2, char Cn3, char Cn4, int *DistBest, int *DistWorst);
int NearPar(int Res1, int Res2, int Res3, int Res4, int Res5, int Res6, int Res7, int Res8,
char Cn1, char Cn2, char Cn3, char Cn4, int *DistBest, int *DistWorst);
int NoDoubleHBond(HBOND **HBond, int NHBond);
int OutSeq(CHAIN **Chain, int NChain, COMMAND *Cmd);
int Parse(char **List, int ListLength, char *Option);
int PdbN2SeqN(CHAIN *Chain, char *PdbN, int *SeqN);
int PlaceHydrogens(CHAIN *Chain);
int Presnell(char *Asn1, int L1, char *Asn2, int L2, char SecStr, float Threshold,
float *Q2, float *O);
int Process_ATOM(BUFFER Buffer, CHAIN **Chain, int *ChainNumber,
BOOLEAN *First_ATOM, COMMAND *Cmd);
int Process_COMPND(BUFFER Buffer, enum METHOD *Method);
int Process_ENDMDL(BUFFER Buffer, CHAIN **Chain, int *ChainNumber);
int Process_EXPDTA(BUFFER Buffer, enum METHOD *Method);
int Process_HELIX(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd);
int Process_JRNL(BUFFER Buffer, BOOLEAN *Published);
int Process_MODEL(enum METHOD *Method);
int Process_REMARK(BUFFER Buffer, enum METHOD *Method, float *Resolution, BOOLEAN *DsspAssigned);
int Process_SHEET(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd);
int Process_SSBOND(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd);
int Process_TER(BUFFER Buffer, CHAIN **Chain, int *ChainNumber);
int Process_TURN(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd);
int ReadDSSP(CHAIN **Chain, DSSP **Dssp, COMMAND *Cmd);
int ReadPDBFile(CHAIN **Chain, int *NChain, COMMAND *Cmd);
int ReadPhiPsiMap(char *MapFile, float ***PhiPsiMap, COMMAND *Cmd);
int Replace(char *String, char From, char To);
int ResInSecondStr(int ResNumb, int (*Bound)[2], int N, int *StrNumb);
int RightSide(int LnkA, int LnkD, int I1A, int I1D, int I2A, int I2D );
int RightSide2(int L_A1, int L_D1, int LnkD, int LnkA, int I1A, int I1D, int I2A, int I2D);
int RightSidePar(int LnkA, int LnkD, int I1A, int I1D, int I2A, int I2D );
int SplitString(char *Buffer, char **Fields, int MaxField);
int SSBond(CHAIN **Chain, int NChain);
int TorsBracket(float Torsion, float Min, float Max);
int TurnCondition(float Phi2,float Phi2S,float Psi2,float Psi2S,
float Phi3,float Phi3S,float Psi3,float Psi3S,
float Range1,float Range2);
int Uniq(char **List, int ListLength);
void Alias(int *D1,int *A1,int *D2,int *A2,char *D1Cn,char *A1Cn,char *D2Cn,char *A2Cn,
PATTERN *Pat);
void AllocChain(CHAIN **Chain);
void Area(CHAIN **Chain, int NChain, COMMAND *Cmd);
void BackboneAngles(CHAIN **Chain, int NChain);
void BetaTurn(CHAIN **Chain, int Cn);
void Bridge(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2, PATTERN **Pat, int NPat);
void *ckalloc(size_t bytes);
void ContactOrder(CHAIN **Chain, int NChain, COMMAND *Cmd);
void ContactMap(CHAIN **Chain, int NChain, COMMAND *Cmd);
void CorrectAsn(char *Asn, int Length, char SecStrType, char EditChar, int MaxLength);
void CorrectAsnDouble(char *Asn1, char *Asn2, char *KnownAsn, int Length,
char SecStrType, char EditChar);
void DeallocAcc(DONOR **Acc, int AccNumber);
void DeallocDnr(DONOR **Dnr, int DonNumber);
void DefaultCmd(COMMAND *Cmd);
void die(char *format, ... );
void DiscrPhiPsi(CHAIN **Chain, int NChain, COMMAND *Cmd);
void DistMatrix(CHAIN *Chain);
void DSSP_Energy(float *Dummy, float *C, float *O, float *H, float *N, COMMAND *Cmd,
HBOND *HBond);
void ExcludeObvious(char *Asn1, char *Asn2, char *KnownAsn, int Length);
void ExtractAsn(CHAIN **Chain, int Cn, char *Asn);
void ExtractPdbAsn(CHAIN **Chain, int Cn, char *Asn);
void ExtractDsspAsn(CHAIN **Chain, int Cn, char *Asn);
void FillAsnAntiPar(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2,
PATTERN **Pat, int NPat, COMMAND *Cmd);
void FillAsnPar(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2,
PATTERN **Pat, int NPat, COMMAND *Cmd);
void FilterAntiPar(PATTERN **Pat, int NPat);
void FilterPar(PATTERN **Pat, int NPat);
void FreeCharMatrix(char **Matrix, int M);
void FreeFloatMatrix(float **Matrix, int M);
void FreeIntMatrix(int **Matrix, int M);
void GammaTurn(CHAIN **Chain, int Cn, HBOND **HBond);
void GetFileNameFromPath(char *Path, char *FileName);
void GetDsspAsn(CHAIN **Chain, int NChain, COMMAND *Cmd);
void GetPdbAsn(CHAIN **Chain, int NChain);
void Glue(char *String1, char *String2, FILE *Out);
void GRID_Energy(float *CA2, float *C, float *O, float *H, float *N, COMMAND *Cmd, HBOND *HBond);
void Helix(CHAIN **Chain, int Cn, HBOND **HBond, COMMAND *Cmd, float **PhiPsiMap);
void HBondToBins(HBOND **HBond, int NHBond, COMMAND *Cmd);
void InitAsn(CHAIN **Chain, int NChain);
void InitChain(CHAIN **Chain);
void InsertFirst(DSSP *Dssp, CHAIN *Chain);
void InsertLast(DSSP *Dssp, CHAIN *Chain);
void JoinNeighb(PATTERN **Nei, PATTERN *Pat, int *MinDB2, int DB, int *MinDW2, int DW);
void JoinNeighbours(int *Lnk1A, int Res1, int *Lnk1D, int Res2, PATTERN **Nei,
PATTERN *Pat, int *MinDB1, int DB, int *MinDW1, int DW, int *Min, int j);
void Measure(CHAIN **Chain, int NChain, int El, COMMAND *Cmd, FILE *Out);
void MergePatternsPar(PATTERN **Pat, int NPat);
void MergePatternsAntiPar(PATTERN **Pat, int NPat);
int NotValid(CHAIN *Chain, char *Message);
void OMEGA(CHAIN *Chain, int Res);
void PHI(CHAIN *Chain, int Res);
void Place123_X(float *Coord1, float *Coord2, float *Coord3, float Dist3X, float Ang23X,
float *CoordX);
void PrepareBuffer(BUFFER Bf, CHAIN **Chain);
void PrintHydrBond(char *Text, HBOND *HBond);
void PrintPatterns(PATTERN **Pat, int NPat, CHAIN **Chain, int Cn1, int Cn2);
void PrintStrideHelp(COMMAND *Cmd);
void ProcessStrideOptions(char **List, int ListLength, COMMAND *Cmd);
void Project4_123(float *Coord1, float *Coord2, float *Coord3, float *Coord4,
float *Coord_Proj4_123);
void PSI(CHAIN *Chain, int Res);
void Report(CHAIN **Chain, int NChain, HBOND **HBond, COMMAND *Cmd);
void ReportDetailed(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd);
void ReportGeneral(CHAIN **Chain, FILE *Out);
void ReportHydrBonds(CHAIN **Chain, int NChain, HBOND **HBond,
FILE *Out, COMMAND *Cmd);
void ReportShort(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd);
void ReportSSBonds(CHAIN **Chain, FILE *Out);
void ReportSummary(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd);
void ReportTurnTypes(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd);
void Sheet(CHAIN **Chain, int Cn1, int Cn2, HBOND **HBond, COMMAND *Cmd, float **PhiPsiMap);
void StringSort(char **Strings, int left, int right, int StrLen);
void StripPathFromLastExtention(char *Path, char *StrippedPath);

@ -0,0 +1,196 @@
#include "stride.h"
int ReadPhiPsiMap(char *MapFile, float ***PhiPsiMap, COMMAND *Cmd)
{
int i, j, NFields, Cnt=0;
FILE *fi;
BUFFER Buffer;
char *Fields[MAX_FIELD];
Cmd->NPixel = 0;
if( (fi = fopen(MapFile,"r")) != 0 ) {
while( fgets(Buffer,BUFSZ,fi) != NULL ) {
if( !(NFields = SplitString(Buffer,Fields,MAX_FIELD)) ) continue;
if( Cmd->NPixel == 0 ) {
if( !strcmp(tolostr(Fields[0]),"npixel") ) {
Cmd->NPixel = atoi(Fields[1]);
if( Cmd->NPixel < 1 || Cmd->NPixel > 1000 )
die("Wrong number of pixels in the PhiPsi Map file %s\n",MapFile);
*PhiPsiMap = FloatMatrix(Cmd->NPixel,Cmd->NPixel);
}
}
else {
if( !strcmp(tolostr(Fields[0]),"pixel") ) {
if( (i = atoi(Fields[1])) >= 0 && i < Cmd->NPixel &&
(j = atoi(Fields[2])) >= 0 && j < Cmd->NPixel &&
Cnt == i*Cmd->NPixel+j && NFields >= 4 ) {
(*PhiPsiMap)[i][j] = atof(Fields[5]);
Cnt++;
}
else die("Error in the PhiPsi Map file %s\n",MapFile);
}
}
}
fclose(fi);
Cmd->PhiPsiStep = (MAXPHIPSI - MINPHIPSI)/(float)Cmd->NPixel;
}
if( !Cmd->NPixel ) die("Error reading PhiPsiMap file %s\n",MapFile);
return(Cmd->NPixel);
}
float **DefaultHelixMap(COMMAND *Cmd)
{
register int i;
float **Map;
static float Data[DEFNUMPIXEL][DEFNUMPIXEL] = {
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0009014423, 0.0041898815,
0.0085105160, 0.0133839026, 0.0245425366, 0.0407802090, 0.0464176536, 0.0330946408,
0.0134803243, 0.0024038462, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0007370283, 0.0077203326, 0.0269849468,
0.0492307022, 0.0621860325, 0.0747849122, 0.0919913873, 0.0918549150, 0.0617070347,
0.0241584498, 0.0041428790, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0041416897, 0.0287234355, 0.0835687742,
0.1384727061, 0.1562444866, 0.1470608264, 0.1360232681, 0.1159155145, 0.0742164999,
0.0290896539, 0.0050673936, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0009375000, 0.0156580955, 0.0757770315, 0.1856354773,
0.2785892785, 0.2880102694, 0.2332847565, 0.1741978228, 0.1281246394, 0.0793832615,
0.0320557840, 0.0058840578, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0048893229, 0.0437000208, 0.1617751122, 0.3399706185,
0.4626395404, 0.4418565035, 0.3235570788, 0.2100441158, 0.1358627081, 0.0776144490,
0.0297011137, 0.0052390974, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0136979166, 0.0917820632, 0.2773087323, 0.5047551394,
0.6214492917, 0.5485223532, 0.3655386865, 0.2054343373, 0.1121114418, 0.0548815951,
0.0178668182, 0.0025975490, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0246484373, 0.1396044195, 0.3594934344, 0.5710113049,
0.6337110400, 0.5133636594, 0.3054708838, 0.1402616948, 0.0584463216, 0.0228670351,
0.0058531328, 0.0005151099, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0265885405, 0.1365883052, 0.3163702190, 0.4545661211,
0.4628692269, 0.3425511420, 0.1761947423, 0.0607788190, 0.0158569515, 0.0042061093,
0.0008107311, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0152018229, 0.0738445148, 0.1630392224, 0.2269553691,
0.2237145752, 0.1528334022, 0.0652616471, 0.0150429625, 0.0014589608, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0035156249, 0.0165251363, 0.0379281938, 0.0584417619,
0.0619409233, 0.0404052660, 0.0136552500, 0.0016678370, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0011718750, 0.0046875002,
0.0070312503, 0.0046875002, 0.0011718750, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0006944445, 0.0036063762, 0.0080820229, 0.0101532144, 0.0076146079,
0.0032324446, 0.0006009616, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000
};
Map = (float **)ckalloc(DEFNUMPIXEL*sizeof(float *));
for( i=0; i<DEFNUMPIXEL; i++ )
Map[i] = &(Data[i][0]);
Cmd->NPixel = DEFNUMPIXEL;
Cmd->PhiPsiStep = (MAXPHIPSI - MINPHIPSI)/(float)Cmd->NPixel;
return(Map);
}
float **DefaultSheetMap(COMMAND *Cmd)
{
register int i;
float **Map;
static float Data[DEFNUMPIXEL][DEFNUMPIXEL] = {
0.2769023776, 0.1408346891, 0.0464910716, 0.0073784725, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0047086575, 0.0218229108, 0.0569166169,
0.1254088134, 0.2340224832, 0.3511219919, 0.4355685711, 0.4584180117, 0.4007356465,
0.4067636132, 0.2329865396, 0.0927943364, 0.0237838365, 0.0055147060, 0.0013786765,
0.0000000000, 0.0000000000, 0.0000000000, 0.0088186050, 0.0420726910, 0.1043856740,
0.2086037844, 0.3677131534, 0.5367187858, 0.6412357688, 0.6458424330, 0.5580080152,
0.4286311865, 0.2678007782, 0.1282834113, 0.0529448465, 0.0220588241, 0.0055147060,
0.0000000000, 0.0000000000, 0.0000000000, 0.0086062262, 0.0445192643, 0.1197573245,
0.2487278134, 0.4369854629, 0.6241853237, 0.7160459757, 0.6829043031, 0.5716546178,
0.3639202416, 0.2397334576, 0.1305907220, 0.0683420748, 0.0330882370, 0.0082720593,
0.0000000000, 0.0000000000, 0.0000000000, 0.0053559211, 0.0328565054, 0.1048930883,
0.2402425259, 0.4295993447, 0.6026929021, 0.6669865251, 0.6039550304, 0.4841639400,
0.2637948096, 0.1723874062, 0.0920098722, 0.0464194641, 0.0220588241, 0.0055147060,
0.0000000000, 0.0000000000, 0.0000000000, 0.0030202419, 0.0224239044, 0.0804052502,
0.1923188865, 0.3456886411, 0.4811576009, 0.5223571062, 0.4586051404, 0.3565762639,
0.1628032923, 0.0930610597, 0.0400134660, 0.0143100554, 0.0055147060, 0.0013786765,
0.0000000000, 0.0000000000, 0.0000000000, 0.0015453297, 0.0132468110, 0.0489843786,
0.1174781919, 0.2150468081, 0.3082944453, 0.3439011276, 0.3080393970, 0.2371628135,
0.0825822726, 0.0338854715, 0.0092895878, 0.0012122844, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0003863324, 0.0046614520, 0.0186656341,
0.0477515720, 0.0961741805, 0.1546680480, 0.1961039603, 0.1944279373, 0.1469529718,
0.0326442868, 0.0073916214, 0.0008854167, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0006347656, 0.0031504754,
0.0104655549, 0.0272454955, 0.0570511036, 0.0941907763, 0.1088592261, 0.0785619915,
0.0090501504, 0.0007651417, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0007207961, 0.0035958111, 0.0131648667, 0.0318824202, 0.0425693691, 0.0292618107,
0.0013020834, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0013020834, 0.0052083335, 0.0078125000, 0.0052083335,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000,
0.0210939310, 0.0078523019, 0.0013020834, 0.0000000000, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0014204546,
0.0071634995, 0.0169352461, 0.0272206441, 0.0357281528, 0.0395361669, 0.0343801714,
0.1146211401, 0.0503530800, 0.0130920913, 0.0015190972, 0.0000000000, 0.0000000000,
0.0000000000, 0.0000000000, 0.0000000000, 0.0010016026, 0.0046167620, 0.0157516468,
0.0453012958, 0.0937970504, 0.1454590708, 0.1861637682, 0.2019522935, 0.1764564067
};
Map = (float **)ckalloc(DEFNUMPIXEL*sizeof(float *));
for( i=0; i<DEFNUMPIXEL; i++ )
Map[i] = &(Data[i][0]);
Cmd->NPixel = DEFNUMPIXEL;
Cmd->PhiPsiStep = (MAXPHIPSI - MINPHIPSI)/(float)Cmd->NPixel;
return(Map);
}

@ -0,0 +1,122 @@
#include "stride.h"
int ReadPDBFile(CHAIN **Chain, int *Cn, COMMAND *Cmd)
{
int ChainCnt, InfoCnt, i;
enum METHOD Method = XRay;
BOOLEAN First_ATOM, Published=YES, DsspAssigned=NO;
float Resolution = 0.0;
FILE *pdb;
BUFFER Buffer;
char *Info[MAX_INFO], PdbIdent[5];
RESIDUE *r;
CHAIN *c;
*Cn= 0;
InfoCnt = 0;
strcpy(PdbIdent,"~~~~");
if( !(pdb = fopen(Cmd->InputFile,"r")) )
return(FAILURE);
First_ATOM = YES;
while( fgets(Buffer,BUFSZ,pdb) ) {
if(!strncmp(Buffer,"HEADER",6)) {
Info[InfoCnt] = (char *)ckalloc(BUFSZ*sizeof(char));
strcpy(Info[InfoCnt],"HDR ");
strcat(Info[InfoCnt++],Buffer+10);
strncpy(PdbIdent,Buffer+62,4);
PdbIdent[4] = '\0';
}
else
if(!strncmp(Buffer,"AUTHOR",6)) {
Info[InfoCnt] = (char *)ckalloc(BUFSZ*sizeof(char));
strcpy(Info[InfoCnt],"AUT ");
strcat(Info[InfoCnt++],Buffer+10);
}
else
if(!strncmp(Buffer,"SOURCE",6)) {
Info[InfoCnt] = (char *)ckalloc(BUFSZ*sizeof(char));
strcpy(Info[InfoCnt],"SRC ");
strcat(Info[InfoCnt++],Buffer+10);
}
else
if(!strncmp(Buffer,"COMPND",6)) {
if( !Process_COMPND(Buffer,&Method) )
return(FAILURE);
else {
Info[InfoCnt] = (char *)ckalloc(BUFSZ*sizeof(char));
strcpy(Info[InfoCnt],"CMP ");
strcat(Info[InfoCnt++],Buffer+10);
}
}
else if(!strncmp(Buffer,"JRNL",4) && !Process_JRNL(Buffer,&Published))
return(FAILURE);
else if(!strncmp(Buffer,"REMARK",6) && !Process_REMARK(Buffer,&Method,&Resolution,
&DsspAssigned))
return(FAILURE);
else if(!strncmp(Buffer,"EXPDTA",6) && !Process_EXPDTA(Buffer,&Method))
return(FAILURE);
else if(!strncmp(Buffer,"MODEL",5) && !Process_MODEL(&Method))
return(FAILURE);
else if(!strncmp(Buffer,"ENDMDL",6)) {
Process_ENDMDL(Buffer,Chain,Cn);
break;
}
else if(!strncmp(Buffer,"HELIX",5) && !Process_HELIX(Buffer,Chain,Cn,Cmd))
return(FAILURE);
else if(!strncmp(Buffer,"SHEET",5) && !Process_SHEET(Buffer,Chain,Cn,Cmd))
return(FAILURE);
else if(!strncmp(Buffer,"TURN",4) && !Process_TURN(Buffer,Chain,Cn,Cmd))
return(FAILURE);
else if(!strncmp(Buffer,"SSBOND",6) && !Process_SSBOND(Buffer,Chain,Cn,Cmd))
return(FAILURE);
else if(!strncmp(Buffer,"ATOM",4) && !Process_ATOM(Buffer,Chain,Cn,&First_ATOM,Cmd))
return(FAILURE);
}
fclose(pdb);
for( ChainCnt=0; ChainCnt< *Cn; ChainCnt++ ) {
c = Chain[ChainCnt];
if( c->NRes != 0 && !FindAtom(c,c->NRes,"CA",&i) )
c->NRes--;
strcpy(c->File,Cmd->InputFile);
strcpy(c->PdbIdent,PdbIdent);
if( c->NRes != 0 ) c->NRes++;
if( c->NSheet != -1 ) c->NSheet++;
c->Resolution = Resolution;
c->Method = Method;
c->Published = Published;
c->DsspAssigned = DsspAssigned;
c->NInfo = InfoCnt;
for(i=0; i<InfoCnt; i++) {
c->Info[i] = (char *)ckalloc(BUFSZ*sizeof(char));
strcpy(c->Info[i],Info[i]);
c->Info[i][71] = '\0';
}
for( i=0; i<c->NRes; i++ ) {
r = c->Rsd[i];
r->Inv = (INVOLVED *)ckalloc(sizeof(INVOLVED));
r->Prop = (PROPERTY *)ckalloc(sizeof(PROPERTY));
r->Inv->NBondDnr = 0;
r->Inv->NBondAcc = 0;
r->Inv->InterchainHBonds = NO;
r->Prop->Asn = 'C';
r->Prop->PdbAsn = 'C';
r->Prop->DsspAsn = 'C';
r->Prop->Solv = 0.0;
r->Prop->Phi = 360.0;
r->Prop->Psi = 360.0;
}
}
for(i=0; i<InfoCnt; i++)
free(Info[i]);
return(SUCCESS);
}

@ -0,0 +1,419 @@
#include "stride.h"
void Report(CHAIN **Chain, int NChain, HBOND **HBond, COMMAND *Cmd)
{
FILE *Out;
if( !strlen(Cmd->OutFile) )
Out = stdout;
else
if( !(Out = fopen(Cmd->OutFile,"w")) )
die("Can not open output file %s\n",Cmd->OutFile);
if( !Cmd->ReportSummaryOnly )
ReportGeneral(Chain,Out);
ReportSummary(Chain,NChain,Out,Cmd);
ReportShort(Chain,NChain,Out,Cmd);
ReportTurnTypes(Chain,NChain,Out,Cmd);
ReportSSBonds(Chain,Out);
if( !Cmd->ReportSummaryOnly )
ReportDetailed(Chain,NChain,Out,Cmd);
if( Cmd->ReportBonds )
ReportHydrBonds(Chain,NChain,HBond,Out,Cmd);
if( Cmd->Measure ) {
Measure(Chain,NChain,0,Cmd,Out);
Measure(Chain,NChain,1,Cmd,Out);
}
if( Out != stdout )
fclose(Out);
}
void ReportGeneral(CHAIN **Chain, FILE *Out)
{
register int i;
BUFFER Bf, Tmp;
if( !Chain[0]->NInfo )
return;
PrepareBuffer(Bf,Chain);
Glue(Bf,"REM --------------------------------------------------------------------",Out);
Glue(Bf,"REM",Out);
Glue(Bf,"REM STRIDE: Knowledge-based secondary structure assignment",Out);
Glue(Bf,"REM Please cite: D.Frishman & P.Argos, Proteins XX, XXX-XXX, 1995",Out);
Glue(Bf,"REM",Out);
Glue(Bf,"REM Residue accessible surface area calculation",Out);
Glue(Bf,"REM Please cite: F.Eisenhaber & P.Argos, J.Comp.Chem. 14, 1272-1280, 1993 ",Out);
Glue(Bf,"REM F.Eisenhaber et al., J.Comp.Chem., 1994, submitted",Out);
Glue(Bf,"REM",Out);
sprintf(Tmp,"REM ------------------------ ");
strcat(Tmp,"General information");
strcat(Tmp," -----------------------");
Glue(Bf,Tmp,Out);
Glue(Bf,"REM",Out);
for( i=0; i<Chain[0]->NInfo; i++ ) {
strcpy(Tmp,Chain[0]->Info[i]);
Tmp[66] = '\0';
Replace(Tmp,'\n',' ');
Glue(Bf,Tmp,Out);
}
Glue(Bf,"REM",Out);
}
void ReportSummary(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
int Cn, Width, CurrWidth, NBlocks, Tail, i, j, From, To;
BUFFER Bf, Tmp, Tmp1;
PrepareBuffer(Bf,Chain);
sprintf(Tmp,"REM -------------------- ");
strcat(Tmp,"Secondary structure summary");
strcat(Tmp," -------------------");
Glue(Bf,Tmp,Out);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
Width = 50;
Glue(Bf,"REM",Out);
strncpy(Tmp1,Chain[Cn]->File,40);
Tmp1[40] = '\0';
sprintf(Tmp,"CHN %s %c",Tmp1,SpaceToDash(Chain[Cn]->Id));
Glue(Bf,Tmp,Out);
NBlocks = Chain[Cn]->NRes/Width;
Tail = Chain[Cn]->NRes % Width;
if( Tail ) NBlocks++;
for( i=0; i<NBlocks; i++ ) {
Glue(Bf,"REM",Out);
From = i*Width;
if( i == NBlocks-1 && Tail )
CurrWidth = Tail;
else
CurrWidth = Width;
To = From+CurrWidth;
sprintf(Tmp,"REM ");
for( j=0; j<CurrWidth; j++ )
if( j && (j+1)%10 == 0 )
strcat(Tmp,".");
else
strcat(Tmp," ");
Glue(Bf,Tmp,Out);
sprintf(Tmp,"SEQ %-4d ",From+1);
for( j=From; j<From+Width; j++ ) {
if( j < To )
sprintf(Tmp1,"%c",ThreeToOne(Chain[Cn]->Rsd[j]->ResType));
else
sprintf(Tmp1," ");
strcat(Tmp,Tmp1);
}
sprintf(Tmp1," %4d",To);
strcat(Tmp,Tmp1);
Glue(Bf,Tmp,Out);
sprintf(Tmp,"STR ");
for( j=From; j<To; j++ ) {
if( Chain[Cn]->Rsd[j]->Prop->Asn == 'C' )
sprintf(Tmp1," ");
else
sprintf(Tmp1,"%c",Chain[Cn]->Rsd[j]->Prop->Asn);
strcat(Tmp,Tmp1);
}
strcat(Tmp," ");
Glue(Bf,Tmp,Out);
}
}
}
void ReportDetailed(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
register int i, Cn;
RESIDUE *p;
BUFFER Bf, Tmp, Tmp1;
PrepareBuffer(Bf,Chain);
Glue(Bf,"REM",Out);
sprintf(Tmp,"REM --------------- ");
strcat(Tmp,"Detailed secondary structure assignment");
strcat(Tmp,"-------------");
Glue(Bf,Tmp,Out);
Glue(Bf,"REM",Out);
Glue(Bf,"REM |---Residue---| |--Structure--| |-Phi-| |-Psi-| |-Area-| ",Out);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( i=0; i<Chain[Cn]->NRes; i++ ) {
p = Chain[Cn]->Rsd[i];
sprintf(Tmp,"ASG %3s %c %4s %4d %c %11s %7.2f %7.2f %7.1f",
p->ResType,SpaceToDash(Chain[Cn]->Id),p->PDB_ResNumb,i+1,
p->Prop->Asn,Translate(p->Prop->Asn),p->Prop->Phi,
p->Prop->Psi,p->Prop->Solv);
if( Cmd->BrookhavenAsn ) {
Tmp[26] = p->Prop->PdbAsn;
Tmp[25] = ' ';
Tmp[27] = ' ';
}
if( Cmd->DsspAsn ) {
Tmp[28] = p->Prop->DsspAsn;
Tmp[27] = ' ';
Tmp[29] = ' ';
sprintf(Tmp1," %6.1f ",p->Prop->DsspSolv);
strcat(Tmp,Tmp1);
}
Glue(Bf,Tmp,Out);
}
}
}
void ReportHydrBonds(CHAIN **Chain, int NChain, HBOND **HBond, FILE *Out,
COMMAND *Cmd)
{
register int i, k, Cn;
int Cnt, Res;
BUFFER Bf, Tmp, Tmp1;
HBOND *p;
RESIDUE *r;
PrepareBuffer(Bf,Chain);
Glue(Bf,"REM",Out);
sprintf(Tmp,"REM ------------------ ");
strcat(Tmp,"Mainchain hydrogen bonds");
strcat(Tmp," ------------------------");
Glue(Bf,Tmp,Out);
Glue(Bf,"REM",Out);
Glue(Bf,"REM Definition of Stickle et al., J.Mol.Biol. 226:1143-1159, 1992",Out);
Glue(Bf,"REM A1 is the angle between the planes of donor complex and O..N-C",Out);
Glue(Bf,"REM A2 is the angle between the planes of acceptor complex and N..O=C",Out);
Glue(Bf,"REM",Out);
sprintf(Tmp,"HBT %-6d",Chain[0]->NHydrBondTotal);
Glue(Bf,Tmp,Out);
sprintf(Tmp,"HBI %-6d",Chain[0]->NHydrBondInterchain);
Glue(Bf,Tmp,Out);
for( Cn=0; Cn<NChain; Cn++ )
if( Chain[Cn]->Valid ) {
sprintf(Tmp,"HBC %-6d %s %c %4d",
Chain[Cn]->NHydrBond,Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id),Chain[Cn]->NRes);
Glue(Bf,Tmp,Out);
}
Glue(Bf,"REM",Out);
Glue(Bf,"REM |--Residue 1--| |--Residue 2--| N-O N..O=C O..N-C A1 A2",Out);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( i=0; i<Chain[Cn]->NRes; i++ ) {
r = Chain[Cn]->Rsd[i];
Cnt = 0;
for( k=0; k<r->Inv->NBondDnr; k++ ) {
p = HBond[r->Inv->HBondDnr[k]];
if( p->ExistHydrBondRose ) {
Res = p->Acc->A_Res;
sprintf(Tmp,"DNR %4s %c %4s %4d -> ",
r->ResType,SpaceToDash(Chain[Cn]->Id),r->PDB_ResNumb,i);
sprintf(Tmp1,"%4s %c %4s %4d %4.1f %6.1f %6.1f %6.1f %6.1f ",
p->Acc->Chain->Rsd[Res]->ResType,
/* patch replace SpaceToDash(Chain[Cn]->Id), */
SpaceToDash(p->Acc->Chain->Id),
p->Acc->Chain->Rsd[Res]->PDB_ResNumb,Res,p->AccDonDist,p->AccAng,
p->DonAng,p->AccDonAng,p->DonAccAng);
strcat(Tmp,Tmp1);
Glue(Bf,Tmp,Out);
Cnt++;
}
}
Cnt = 0;
for( k=0; k<r->Inv->NBondAcc; k++ ) {
p = HBond[r->Inv->HBondAcc[k]];
if( p->ExistHydrBondRose ) {
Res = p->Dnr->D_Res;
sprintf(Tmp,"ACC %4s %c %4s %4d -> ",
r->ResType,SpaceToDash(Chain[Cn]->Id),r->PDB_ResNumb,i);
sprintf(Tmp1,"%4s %c %4s %4d %4.1f %6.1f %6.1f %6.1f %6.1f ",
p->Dnr->Chain->Rsd[Res]->ResType,
/* patch replace SpaceToDash(Chain[Cn]->Id), */
SpaceToDash(p->Dnr->Chain->Id),
p->Dnr->Chain->Rsd[Res]->PDB_ResNumb,Res,p->AccDonDist,
p->AccAng,p->DonAng,p->AccDonAng,p->DonAccAng);
strcat(Tmp,Tmp1);
Glue(Bf,Tmp,Out);
Cnt++;
}
}
}
}
}
void ReportSSBonds(CHAIN **Chain, FILE *Out)
{
register int i;
BUFFER Bf, Tmp;
SSBOND *s;
if( !Chain[0]->NBond ) return;
PrepareBuffer(Bf,Chain);
for( i=0; i<Chain[0]->NBond; i++ ) {
s = Chain[0]->SSbond[i];
sprintf(Tmp,"LOC Disulfide CYS %4s %c CYS %4s %c ",
s->PDB_ResNumb1,SpaceToDash(s->ChainId1),
s->PDB_ResNumb2,SpaceToDash(s->ChainId2));
if( s->AsnSource == Pdb )
strcat(Tmp," PDB");
else
strcat(Tmp,"STRIDE\n");
Glue(Bf,Tmp,Out);
}
}
void ReportTurnTypes(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
register int Cn, Tn;
BUFFER Bf, Tmp;
TURN *t;
Tn = 0;
for( Cn=0; Cn<NChain; Cn++ )
if( Chain[Cn]->Valid )
Tn += Chain[Cn]->NAssignedTurn;
if( !Tn ) return;
PrepareBuffer(Bf,Chain);
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
for( Tn=0; Tn<Chain[Cn]->NAssignedTurn; Tn++ ) {
t = Chain[Cn]->AssignedTurn[Tn];
sprintf(Tmp,"LOC %-11s %3s %4s %c %3s %4s %c",
Translate(t->TurnType),t->Res1,t->PDB_ResNumb1,
SpaceToDash(Chain[Cn]->Id),t->Res2,
t->PDB_ResNumb2,SpaceToDash(Chain[Cn]->Id));
Glue(Bf,Tmp,Out);
}
}
}
void ReportShort(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
register int Cn, i;
BUFFER Bf, Tmp;
char *Asn;
static char *StrTypes = "HGIE";
int Bound[MAX_ASSIGN][2], NStr;
if( !ExistsSecStr(Chain,NChain) )
return;
PrepareBuffer(Bf,Chain);
Glue(Bf,"REM",Out);
Glue(Bf,"REM",Out);
Glue(Bf,"REM",Out);
for( ; *StrTypes!= '\0'; StrTypes++ ) {
for( Cn=0; Cn<NChain; Cn++ ) {
if( !Chain[Cn]->Valid )
continue;
Asn = (char *)ckalloc(Chain[Cn]->NRes*sizeof(char));
ExtractAsn(Chain,Cn,Asn);
NStr = Boundaries(Asn,Chain[Cn]->NRes,(*StrTypes),Bound);
for( i=0; i<NStr; i++ ) {
sprintf(Tmp,"LOC %-10s %3s %4s %c %3s %4s %c",Translate(*StrTypes),
Chain[Cn]->Rsd[Bound[i][0]]->ResType,
Chain[Cn]->Rsd[Bound[i][0]]->PDB_ResNumb,
SpaceToDash(Chain[Cn]->Id),
Chain[Cn]->Rsd[Bound[i][1]]->ResType,
Chain[Cn]->Rsd[Bound[i][1]]->PDB_ResNumb,
SpaceToDash(Chain[Cn]->Id));
Glue(Bf,Tmp,Out);
}
free(Asn);
}
}
}
void PrepareBuffer(BUFFER Bf, CHAIN **Chain)
{
memset(Bf,' ',OUTPUTWIDTH);
strcpy(Bf+OUTPUTWIDTH-5,Chain[0]->PdbIdent);
Bf[OUTPUTWIDTH] = '\0';
Bf[OUTPUTWIDTH-1] = '\n';
}
void Glue(char *String1, char *String2, FILE *Out)
{
BUFFER Bf;
strcpy(Bf,String1);
strncpy(Bf,String2,(int)strlen(String2));
fprintf(Out,"%s",Bf);
}

@ -0,0 +1,499 @@
#include "stride.h"
void Sheet(CHAIN **Chain, int Cn1, int Cn2, HBOND **HBond, COMMAND *Cmd, float **PhiPsiMap)
{
PATTERN **PatN, **PatP;
RESIDUE *Res1, *Res3, *Res2, *Res4, *ResA, *ResB, *Res1m1, *Res3p1;
int R1, R3, R2, R4, RA, RB, PatCntN = 0, PatCntP = 0, Beg;
char *AntiPar1, *Par1, *AntiPar2, *Par2;
register int i;
PatN = (PATTERN **)ckalloc(MAXHYDRBOND*sizeof(PATTERN *));
PatP = (PATTERN **)ckalloc(MAXHYDRBOND*sizeof(PATTERN *));
AntiPar1 = (char *)ckalloc(Chain[Cn1]->NRes*sizeof(char)); /* Antiparallel strands */
Par1 = (char *)ckalloc(Chain[Cn1]->NRes*sizeof(char)); /* Parallel strands */
AntiPar2 = (char *)ckalloc(Chain[Cn2]->NRes*sizeof(char)); /* Antiparallel strands */
Par2 = (char *)ckalloc(Chain[Cn2]->NRes*sizeof(char)); /* Parallel strands */
for( i=0; i<Chain[Cn1]->NRes; i++ ) {
AntiPar1[i] = 'C';
Par1[i] = 'C';
}
for( i=0; i<Chain[Cn2]->NRes; i++ ) {
AntiPar2[i] = 'C';
Par2[i] = 'C';
}
for( R1=0; R1<Chain[Cn1]->NRes; R1++ ) {
Res1 = Chain[Cn1]->Rsd[R1];
if( (!Res1->Inv->NBondDnr && !Res1->Inv->NBondAcc) ||
((Cn1 != Cn2) && !Res1->Inv->InterchainHBonds) )
continue;
RA = R1+1;
R2 = R1+2;
Res1m1 = Chain[Cn1]->Rsd[R1-1];
ResA = Chain[Cn1]->Rsd[RA];
Res2 = Chain[Cn1]->Rsd[R2];
if( R2 >= Chain[Cn1]->NRes ||
Res1->Prop->PhiZn == ERR || Res1->Prop->PsiZn == ERR ||
Res2->Prop->PhiZn == ERR || Res2->Prop->PsiZn == ERR ||
ResA->Prop->PhiZn == ERR || ResA->Prop->PsiZn == ERR )
continue;
if( Cn1 != Cn2 )
Beg = 0;
else
Beg = R1+1;
for( R3=Beg; R3<Chain[Cn2]->NRes; R3++ ) {
/* Process anti-parallel strands */
Res3 = Chain[Cn2]->Rsd[R3];
if( (!Res3->Inv->NBondAcc && !Res3->Inv->NBondDnr ) ||
((Cn1 != Cn2) && !Res3->Inv->InterchainHBonds) )
continue;
RB = R3-1;
R4 = R3-2;
Res3p1 = Chain[Cn2]->Rsd[R3+1];
ResB = Chain[Cn2]->Rsd[RB];
Res4 = Chain[Cn2]->Rsd[R4];
if( Cn1 != Cn2 || R3 - R1 >= 3 )
Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,Res1,Res1,Res3,
PhiPsiMap,PatN,&PatCntN,"1331",Cmd->Treshold_E1,Cmd,0);
if( R2 < Chain[Cn1]->NRes && ((Cn1 != Cn2 && R4 >= 0) || R4-R2 >=2 ) )
Link(HBond,Chain,Cn2,Cn1,Res3,Res1,Res2,Res4,ResB,ResA,
PhiPsiMap,PatN,&PatCntN,"3124",Cmd->Treshold_E1,Cmd,0);
if( ((Cn1 != Cn2 && RB >= 0 ) || RB-R1 > 4) &&
( RA >= Chain[Cn1]->NRes || (Cn1 == Cn2 && R3-RA <= 4 ) ||
!Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,ResA,NULL,Res3,
PhiPsiMap,PatN,&PatCntN,"133A",Cmd->Treshold_E1,Cmd,1))
&&
( R1-1 < 0 ||
!Link(HBond,Chain,Cn1,Cn2,Res1m1,ResB,ResB,Res1,NULL,ResB,
PhiPsiMap,PatN,&PatCntN,"1-BB1",Cmd->Treshold_E1,Cmd,1)))
Link(HBond,Chain,Cn1,Cn2,Res1,Res3,ResB,Res1,Res1,NULL,
PhiPsiMap,PatN,&PatCntN,"13B1",Cmd->Treshold_E1,Cmd,0);
if( (RA < Chain[Cn1]->NRes && (Cn1 != Cn2 || R3-RA > 4)) &&
( (Cn1 == Cn2 && RB-R1 <= 4 ) || (Cn1 != Cn2 && RB < 0 ) ||
!Link(HBond,Chain,Cn1,Cn2,Res1,Res3,ResB,Res1,Res1,NULL,
PhiPsiMap,PatN,&PatCntN,"13B1",Cmd->Treshold_E1,Cmd,1))
&&
( R3+1 >= Chain[Cn2]->NRes ||
!Link(HBond,Chain,Cn1,Cn2,ResA,Res3p1,Res3,ResA,ResA,NULL,
PhiPsiMap,PatN,&PatCntN,"A3+3A",Cmd->Treshold_E1,Cmd,1)))
Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,ResA,NULL,Res3,
PhiPsiMap,PatN,&PatCntN,"133A",Cmd->Treshold_E1,Cmd,0);
/* Process parallel strands */
R4 = R3+2;
RB = R3+1;
ResB = Chain[Cn2]->Rsd[RB];
Res4 = Chain[Cn2]->Rsd[R4];
if( (Cn1 == Cn2 && abs(R3-R1) <= 3) || R4 >= Chain[Cn2]->NRes ) continue;
if( R2 < Chain[Cn1]->NRes && (Cn1 != Cn2 || abs(R2-R3) > 3) )
Link(HBond,Chain,Cn2,Cn1,Res3,Res1,Res2,Res3,Res3,ResA,
PhiPsiMap,PatP,&PatCntP,"3123",Cmd->Treshold_E2,Cmd,0);
if( R4 < Chain[Cn2]->NRes && (Cn1 != Cn2 || abs(R4-R1) > 3) )
Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res4,Res1,Res1,ResB,
PhiPsiMap,PatP,&PatCntP,"1341",Cmd->Treshold_E2,Cmd,0);
}
}
FilterAntiPar(PatN,PatCntN);
FilterPar(PatP,PatCntP);
MergePatternsAntiPar(PatN,PatCntN);
MergePatternsPar(PatP,PatCntP);
if( Cmd->Info ) {
PrintPatterns(PatN,PatCntN,Chain,Cn1,Cn2);
PrintPatterns(PatP,PatCntP,Chain,Cn1,Cn2);
}
FillAsnAntiPar(AntiPar1,AntiPar2,Chain,Cn1,Cn2,PatN,PatCntN,Cmd);
FillAsnPar(Par1,Par2,Chain,Cn1,Cn2,PatP,PatCntP,Cmd);
Bridge(AntiPar1,AntiPar2,Chain,Cn1,Cn2,PatN,PatCntN);
Bridge(Par1,Par2,Chain,Cn1,Cn2,PatP,PatCntP);
for( i=0; i<Chain[Cn1]->NRes; i++ )
if( AntiPar1[i] == 'N' || Par1[i] == 'P' )
Chain[Cn1]->Rsd[i]->Prop->Asn = 'E';
else
if( AntiPar1[i] == 'B' || Par1[i] == 'B' )
Chain[Cn1]->Rsd[i]->Prop->Asn = 'B';
else
if( AntiPar1[i] == 'b' || Par1[i] == 'b' )
Chain[Cn1]->Rsd[i]->Prop->Asn = 'b';
for( i=0; i<Chain[Cn2]->NRes; i++ )
if( Chain[Cn2]->Rsd[i]->Prop->Asn == 'E' )
continue;
else
if( AntiPar2[i] == 'N' || Par2[i] == 'P' )
Chain[Cn2]->Rsd[i]->Prop->Asn = 'E';
else
if( AntiPar2[i] == 'B' || Par2[i] == 'B' )
Chain[Cn2]->Rsd[i]->Prop->Asn = 'B';
else
if( AntiPar2[i] == 'b' || Par2[i] == 'b' )
Chain[Cn2]->Rsd[i]->Prop->Asn = 'b';
/*
for( i=0; i<PatCntN; i++ )
free(PatN[i]);
for( i=0; i<PatCntP; i++ )
free(PatP[i]);
*/
free(PatN);
free(PatP);
free(AntiPar1);
free(Par1);
free(AntiPar2);
free(Par2);
}
int Link(HBOND **HBond, CHAIN **Chain, int Cn1, int Cn2, RESIDUE *Res1_1,
RESIDUE *Res1_2, RESIDUE *Res2_2, RESIDUE *Res2_1, RESIDUE *CRes1,
RESIDUE *CRes2, float **PhiPsiMap, PATTERN **Pattern, int *NumPat,
char *Text, float Treshold, COMMAND *Cmd, int Test)
{
int BondNumber1, BondNumber2, Flag = 0;
static char *Result[2] = {" NO \n"," YES \n"};
float Prob1, Prob2, Conf, Coeff;
if( (BondNumber1 = FindPolInt(HBond,Res1_1,Res1_2)) == ERR )
return(FAILURE);
if( (BondNumber2 = FindPolInt(HBond,Res2_2,Res2_1)) == ERR )
return(FAILURE);
if( CRes1 == NULL ) {
if( CRes2->Prop->PhiZn == ERR || CRes2->Prop->PsiZn == ERR )
return(FAILURE);
Conf = PhiPsiMap[CRes2->Prop->PhiZn][CRes2->Prop->PsiZn];
}
else
if( CRes2 == NULL ) {
if( CRes1->Prop->PhiZn == ERR || CRes1->Prop->PsiZn == ERR )
return(FAILURE);
Conf = PhiPsiMap[CRes1->Prop->PhiZn][CRes1->Prop->PsiZn];
}
else {
if( CRes2->Prop->PhiZn == ERR || CRes2->Prop->PsiZn == ERR ||
CRes1->Prop->PhiZn == ERR || CRes1->Prop->PsiZn == ERR )
return(FAILURE);
Conf =
0.5*(PhiPsiMap[CRes1->Prop->PhiZn][CRes1->Prop->PsiZn]+
PhiPsiMap[CRes2->Prop->PhiZn][CRes2->Prop->PsiZn]);
}
Coeff = 1+Cmd->C1_E+Cmd->C2_E*Conf;
Prob1 = HBond[BondNumber1]->Energy*Coeff;
Prob2 = HBond[BondNumber2]->Energy*Coeff;
if( Prob1 < Treshold && Prob2 < Treshold ) {
if( !Test ) {
Pattern[*NumPat] = (PATTERN *)ckalloc(sizeof(PATTERN));
Pattern[*NumPat]->ExistPattern = YES;
Pattern[*NumPat]->Hb1 = HBond[BondNumber1];
Pattern[*NumPat]->Hb2 = HBond[BondNumber2];
Pattern[*NumPat]->Nei1 = NULL;
Pattern[*NumPat]->Nei2 = NULL;
strcpy(Pattern[*NumPat]->Type,Text);
(*NumPat)++;
}
Flag = 1;
}
if( Cmd->Info && Flag ) {
fprintf(stdout,"%s %c: %3s %c: %3s | %c: %3s %c: %3s | ",
Text,
Chain[Cn1]->Id,Res1_1->PDB_ResNumb,
Chain[Cn2]->Id,Res1_2->PDB_ResNumb,
Chain[Cn2]->Id,Res2_2->PDB_ResNumb,
Chain[Cn1]->Id,Res2_1->PDB_ResNumb);
fprintf(stdout,"%8.6f %6.4f | ", Prob1,HBond[BondNumber1]->Energy);
fprintf(stdout,"%8.6f %6.4f | ", Prob2,HBond[BondNumber2]->Energy);
if( CRes1 != NULL &&
CRes1->Prop->PhiZn != ERR && CRes1->Prop->PsiZn != ERR )
fprintf(stdout,"%6.4f %2d %2d | ",
PhiPsiMap[CRes1->Prop->PhiZn][CRes1->Prop->PsiZn],
CRes1->Prop->PhiZn,CRes1->Prop->PsiZn);
else
fprintf(stdout,"000000 00 00 | ");
if( CRes2 != NULL &&
CRes2->Prop->PhiZn != ERR && CRes2->Prop->PsiZn != ERR )
fprintf(stdout,"%6.4f %2d %2d | ",
PhiPsiMap[CRes2->Prop->PhiZn][CRes2->Prop->PsiZn],
CRes2->Prop->PhiZn,CRes2->Prop->PsiZn);
else
fprintf(stdout,"000000 00 00 | ");
fprintf(stdout,"%s",Result[Flag]);
}
return(Flag);
}
void PrintPatterns(PATTERN **Pat, int NPat, CHAIN **Chain, int Cn1, int Cn2)
{
register int i;
int D1, A1, D2, A2;
for( i=0; i<NPat; i++ ) {
if( !Pat[i]->ExistPattern ) continue;
D1 = Pat[i]->Hb1->Dnr->D_Res;
A1 = Pat[i]->Hb1->Acc->A_Res;
D2 = Pat[i]->Hb2->Dnr->D_Res;
A2 = Pat[i]->Hb2->Acc->A_Res;
fprintf(stdout,"%3d %c %c ",
i,Pat[i]->Hb1->Dnr->Chain->Id,Pat[i]->Hb2->Dnr->Chain->Id);
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d)",
Chain[Cn1]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn2]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn2]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn1]->Rsd[A2]->PDB_ResNumb,A2);
else
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d)",
Chain[Cn2]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn1]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn1]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn2]->Rsd[A2]->PDB_ResNumb,A2);
if( Pat[i]->Nei1 != NULL ) {
D1 = Pat[i]->Nei1->Hb1->Dnr->D_Res;
A1 = Pat[i]->Nei1->Hb1->Acc->A_Res;
D2 = Pat[i]->Nei1->Hb2->Dnr->D_Res;
A2 = Pat[i]->Nei1->Hb2->Acc->A_Res;
fprintf(stdout," N1 %c %c ",
Pat[i]->Nei1->Hb1->Dnr->Chain->Id,Pat[i]->Nei1->Hb2->Dnr->Chain->Id);
if( Pat[i]->Nei1->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d) ",
Chain[Cn1]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn2]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn2]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn1]->Rsd[A2]->PDB_ResNumb,A2);
else
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d) ",
Chain[Cn2]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn1]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn1]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn2]->Rsd[A2]->PDB_ResNumb,A2);
}
if( Pat[i]->Nei2 != NULL ) {
D1 = Pat[i]->Nei2->Hb1->Dnr->D_Res;
A1 = Pat[i]->Nei2->Hb1->Acc->A_Res;
D2 = Pat[i]->Nei2->Hb2->Dnr->D_Res;
A2 = Pat[i]->Nei2->Hb2->Acc->A_Res;
fprintf(stdout," N2 %c %c ",
Pat[i]->Nei2->Hb1->Dnr->Chain->Id,Pat[i]->Nei2->Hb2->Dnr->Chain->Id);
if( Pat[i]->Nei2->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id )
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d) ",
Chain[Cn1]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn2]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn2]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn1]->Rsd[A2]->PDB_ResNumb,A2);
else
fprintf(stdout,"%3s(%3d) %3s(%3d) %3s(%3d) %3s(%3d) ",
Chain[Cn2]->Rsd[D1]->PDB_ResNumb,D1,
Chain[Cn1]->Rsd[A1]->PDB_ResNumb,A1,
Chain[Cn1]->Rsd[D2]->PDB_ResNumb,D2,
Chain[Cn2]->Rsd[A2]->PDB_ResNumb,A2);
}
fprintf(stdout,"\n");
}
}
void Bridge(char *Asn1, char *Asn2, CHAIN **Chain, int Cn1, int Cn2, PATTERN **Pat, int NPat)
{
register int i;
int B_Res;
for( i=0; i<NPat; i++ ) {
if( Pat[i]->Nei1 != NULL || Pat[i]->Nei2 != NULL ) continue;
if( !strcmp(Pat[i]->Type,"1331") &&
( Cn1 != Cn2 || abs(Pat[i]->Hb1->Dnr->D_Res-Pat[i]->Hb1->Acc->A_Res) >= 3 ) ) {
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id ) {
if( Asn1[Pat[i]->Hb1->Dnr->D_Res] == 'C' )
Asn1[Pat[i]->Hb1->Dnr->D_Res] = 'B';
if( Asn2[Pat[i]->Hb1->Acc->A_Res] == 'C' )
Asn2[Pat[i]->Hb1->Acc->A_Res] = 'B';
}
else {
if( Asn2[Pat[i]->Hb1->Dnr->D_Res] == 'C' )
Asn2[Pat[i]->Hb1->Dnr->D_Res] = 'B';
if( Asn1[Pat[i]->Hb1->Acc->A_Res] == 'C' )
Asn1[Pat[i]->Hb1->Acc->A_Res] = 'B';
}
}
else
if( !strcmp(Pat[i]->Type,"3124") &&
( Cn1 != Cn2 ||
(abs(Pat[i]->Hb1->Dnr->D_Res-Pat[i]->Hb1->Acc->A_Res) >= 2 &&
abs(Pat[i]->Hb2->Dnr->D_Res-Pat[i]->Hb2->Acc->A_Res) >= 2 ) ) ) {
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id ) {
if( Pat[i]->Hb1->Dnr->D_Res > Pat[i]->Hb2->Acc->A_Res )
B_Res = Pat[i]->Hb1->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb1->Dnr->D_Res+1;
if( Asn1[B_Res] == 'C' )
Asn1[B_Res] = 'B';
if( Pat[i]->Hb2->Dnr->D_Res > Pat[i]->Hb1->Acc->A_Res )
B_Res = Pat[i]->Hb2->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb2->Dnr->D_Res+1;
if( Asn2[B_Res] == 'C' )
Asn2[B_Res] = 'B';
}
else {
if( Pat[i]->Hb1->Dnr->D_Res > Pat[i]->Hb2->Acc->A_Res )
B_Res = Pat[i]->Hb1->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb1->Dnr->D_Res+1;
if( Asn2[B_Res] == 'C' )
Asn2[B_Res] = 'B';
if( Pat[i]->Hb2->Dnr->D_Res > Pat[i]->Hb1->Acc->A_Res )
B_Res = Pat[i]->Hb2->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb2->Dnr->D_Res+1;
if( Asn1[B_Res] == 'C' )
Asn1[B_Res] = 'B';
}
}
else
if( ( ( !strcmp(Pat[i]->Type,"3123") || !strcmp(Pat[i]->Type,"1341") ) &&
( Cn1 != Cn2 ||
(abs(Pat[i]->Hb1->Dnr->D_Res-Pat[i]->Hb1->Acc->A_Res) > 3 &&
abs(Pat[i]->Hb2->Dnr->D_Res-Pat[i]->Hb2->Acc->A_Res) > 3 ) ) ) ) {
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id ) {
if( Pat[i]->Hb1->Dnr->D_Res == Pat[i]->Hb2->Acc->A_Res ) {
if( Asn1[Pat[i]->Hb1->Dnr->D_Res] == 'C' )
Asn1[Pat[i]->Hb1->Dnr->D_Res] = 'B';
if( Pat[i]->Hb2->Dnr->D_Res > Pat[i]->Hb1->Acc->A_Res )
B_Res = Pat[i]->Hb2->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb2->Dnr->D_Res+1;
if( Asn2[B_Res] == 'C' )
Asn2[B_Res] = 'B';
}
else {
if( Pat[i]->Hb2->Dnr->D_Res == Pat[i]->Hb1->Acc->A_Res )
if( Asn2[Pat[i]->Hb2->Dnr->D_Res] == 'C' )
Asn2[Pat[i]->Hb2->Dnr->D_Res] = 'B';
if( Pat[i]->Hb1->Dnr->D_Res > Pat[i]->Hb2->Acc->A_Res )
B_Res = Pat[i]->Hb1->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb1->Dnr->D_Res+1;
if( Asn1[B_Res] == 'C' )
Asn1[B_Res] = 'B';
}
}
}
else
if( ( !strcmp(Pat[i]->Type,"13B1") || !strcmp(Pat[i]->Type,"133A") ) &&
( Cn1 != Cn2 ||
(abs(Pat[i]->Hb1->Dnr->D_Res-Pat[i]->Hb1->Acc->A_Res) > 4 &&
abs(Pat[i]->Hb2->Dnr->D_Res-Pat[i]->Hb2->Acc->A_Res) > 4 ) ) ) {
if( Pat[i]->Hb1->Dnr->Chain->Id == Chain[Cn1]->Id ) {
if( Pat[i]->Hb1->Dnr->D_Res == Pat[i]->Hb2->Acc->A_Res ) {
if( Asn1[Pat[i]->Hb1->Dnr->D_Res] == 'C' )
Asn1[Pat[i]->Hb1->Dnr->D_Res] = 'B';
if( Pat[i]->Hb2->Dnr->D_Res > Pat[i]->Hb1->Acc->A_Res )
B_Res = Pat[i]->Hb2->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb2->Dnr->D_Res+1;
if( Asn2[B_Res] == 'C' )
Asn2[B_Res] = 'B';
}
else {
if( Pat[i]->Hb2->Dnr->D_Res == Pat[i]->Hb1->Acc->A_Res )
if( Asn2[Pat[i]->Hb2->Dnr->D_Res] == 'C' )
Asn2[Pat[i]->Hb2->Dnr->D_Res] = 'b';
if( Pat[i]->Hb1->Dnr->D_Res > Pat[i]->Hb2->Acc->A_Res )
B_Res = Pat[i]->Hb1->Dnr->D_Res-1;
else
B_Res = Pat[i]->Hb1->Dnr->D_Res+1;
if( Asn1[B_Res] == 'C' )
Asn1[B_Res] = 'b';
}
}
}
}
}

@ -0,0 +1,37 @@
/* Split a char string into text fields */
#include "stride.h"
int SplitString(char *Buffer, char **Fields, int MaxField)
{
int FieldCnt, SymbCnt, FieldFlag, BuffLen;
static char LocalBuffer[BUFSZ];
FieldCnt =0; FieldFlag = 0;
BuffLen = (int)strlen(Buffer) - 1;
strcpy(LocalBuffer,Buffer);
for(SymbCnt=0; SymbCnt<BuffLen; SymbCnt++) {
if( (isspace(LocalBuffer[SymbCnt])) && FieldFlag == 0 && SymbCnt != BuffLen-1 ) continue;
if( (!isspace(LocalBuffer[SymbCnt])) && FieldFlag == 1 && SymbCnt == BuffLen-1 ) {
LocalBuffer[SymbCnt+1] = '\0';
return(FieldCnt);
}
else
if( (isspace(LocalBuffer[SymbCnt])) && FieldFlag == 1 ) {
LocalBuffer[SymbCnt] = '\0';
FieldFlag = 0;
if( FieldCnt == MaxField ) return(FieldCnt);
}
else
if( (!isspace(LocalBuffer[SymbCnt])) && FieldFlag == 0 ) {
FieldFlag = 1;
Fields[FieldCnt] = LocalBuffer+SymbCnt;
FieldCnt++;
}
}
return(FieldCnt);
}

@ -0,0 +1,60 @@
#include "stride.h"
int SSBond(CHAIN **Chain, int NChain)
{
register int Res1, Res2, Cn1, Cn2;
int S1, S2, Bn, Cnt=0;
for( Cn1=0; Cn1<NChain; Cn1++ )
for( Res1=0; Res1<Chain[Cn1]->NRes; Res1++ ) {
if( strcmp(Chain[Cn1]->Rsd[Res1]->ResType,"CYS") )
continue;
for( Cn2=Cn1; Cn2<NChain; Cn2++ )
for( Res2 = ( (Cn2 == Cn1)? Res1+1 : 0) ; Res2<Chain[Cn2]->NRes; Res2++ ) {
if( strcmp(Chain[Cn2]->Rsd[Res2]->ResType,"CYS") )
continue;
if( !ExistSSBond(Chain,NChain,Cn1,Cn2,
Chain[Cn1]->Rsd[Res1]->PDB_ResNumb,
Chain[Cn2]->Rsd[Res2]->PDB_ResNumb) &&
FindAtom(Chain[Cn1],Res1,"SG",&S1) && FindAtom(Chain[Cn2],Res2,"SG",&S2) &&
Dist(Chain[Cn1]->Rsd[Res1]->Coord[S1],
Chain[Cn2]->Rsd[Res2]->Coord[S2]) <= SSDIST ) {
Bn = Chain[0]->NBond;
Chain[0]->SSbond[Bn] = (SSBOND *)ckalloc(sizeof(SSBOND));
strcpy(Chain[0]->SSbond[Bn]->PDB_ResNumb1,Chain[Cn1]->Rsd[Res1]->PDB_ResNumb);
strcpy(Chain[0]->SSbond[Bn]->PDB_ResNumb2,Chain[Cn2]->Rsd[Res2]->PDB_ResNumb);
Chain[0]->SSbond[Bn]->ChainId1 = Chain[Cn1]->Id;
Chain[0]->SSbond[Bn]->ChainId2 = Chain[Cn2]->Id;
Chain[0]->SSbond[Bn]->AsnSource = Stride;
Chain[0]->NBond++;
Cnt++;
}
}
}
return(Cnt);
}
BOOLEAN ExistSSBond(CHAIN **Chain,int NChain, int Cn1,int Cn2,char *Res1,char *Res2)
{
register int i;
SSBOND *ptr;
for( i=0; i<Chain[0]->NBond; i++ ) {
ptr = Chain[0]->SSbond[i];
if( ( !strcmp(Res1,ptr->PDB_ResNumb1) &&
!strcmp(Res2,ptr->PDB_ResNumb2) &&
FindChain(Chain,NChain,ptr->ChainId1) == Cn1 &&
FindChain(Chain,NChain,ptr->ChainId2) == Cn2 ) ||
( !strcmp(Res2,ptr->PDB_ResNumb1) &&
!strcmp(Res1,ptr->PDB_ResNumb2) &&
FindChain(Chain,NChain,ptr->ChainId1) == Cn2 &&
FindChain(Chain,NChain,ptr->ChainId2) == Cn1 ) )
return(SUCCESS);
}
return(FAILURE);
}

@ -0,0 +1,40 @@
int Replace(char *String, char From, char To)
{
int Replaced=0;
if( From == '\0' )
return(Replaced);
for( ; *String != '\0'; String++ )
if( *String == From ) {
*String = To;
Replaced++;
}
return(Replaced);
}
int Delete(char *String, char From)
{
int Deleted = 0;
char *c;
if( From == '\0' )
return(Deleted);
for( ; *String != '\0'; String++ )
if( *String == From ) {
c = String;
for( ;; c++ ) {
*c = *(c+1);
if( *c == '\0' )
break;
}
Deleted++;
String--;
}
return(Deleted);
}

@ -0,0 +1,343 @@
#include "stride.h"
/* #include <console.h> */ /* For Macintosh only, see readme.mac */
int main(int argc, char **argv)
{
CHAIN **Chain;
HBOND **HBond;
COMMAND *Cmd;
int Cn, NChain=0, NHBond=0, ValidChain=0;
float **PhiPsiMapHelix, **PhiPsiMapSheet;
register int i;
/* argc = ccommand(&argv); */ /* For Macintosh only, see readme.mac */
Chain = (CHAIN **)ckalloc(MAX_CHAIN*sizeof(CHAIN *));
HBond = (HBOND **)ckalloc(MAXHYDRBOND*sizeof(HBOND *));
Cmd = (COMMAND *)ckalloc(sizeof(COMMAND));
ProcessStrideOptions(argv,argc,Cmd);
if( !ReadPDBFile(Chain,&NChain,Cmd) || !NChain )
die("Error reading PDB file %s\n",Cmd->InputFile);
for( Cn=0; Cn<NChain; Cn++ )
ValidChain += CheckChain(Chain[Cn],Cmd);
/* if( Cmd->Stringent )
* exit(0);
*/
if( !ValidChain )
die("No valid chain in %s\n",Chain[0]->File);
if( Cmd->BrookhavenAsn )
GetPdbAsn(Chain,NChain);
if( Cmd->DsspAsn )
GetDsspAsn(Chain,NChain,Cmd);
BackboneAngles(Chain,NChain);
if( Cmd->OutSeq )
OutSeq(Chain,NChain,Cmd);
if( Cmd->ContactOrder )
ContactOrder(Chain,NChain,Cmd);
if( Cmd->ContactMap )
ContactMap(Chain,NChain,Cmd);
if( !strlen(Cmd->MapFileHelix) )
PhiPsiMapHelix = DefaultHelixMap(Cmd);
else
ReadPhiPsiMap(Cmd->MapFileHelix,&PhiPsiMapHelix,Cmd);
if( !strlen(Cmd->MapFileSheet) )
PhiPsiMapSheet = DefaultSheetMap(Cmd);
else
ReadPhiPsiMap(Cmd->MapFileSheet,&PhiPsiMapSheet,Cmd);
for( Cn=0; Cn<NChain; Cn++ )
PlaceHydrogens(Chain[Cn]);
if( (NHBond = FindHydrogenBonds(Chain,Cn,HBond,Cmd)) == 0 )
die("No hydrogen bonds found in %s\n",Cmd->InputFile);
NoDoubleHBond(HBond,NHBond);
DiscrPhiPsi(Chain,NChain,Cmd);
if(Cmd->ExposedArea)
Area(Chain,NChain,Cmd);
for( Cn=0; Cn<NChain; Cn++ ) {
if( Chain[Cn]->Valid ) {
Helix(Chain,Cn,HBond,Cmd,PhiPsiMapHelix);
for( i=0; i<NChain; i++ )
if( Chain[i]->Valid )
Sheet(Chain,Cn,i,HBond,Cmd,PhiPsiMapSheet);
BetaTurn(Chain,Cn);
GammaTurn(Chain,Cn,HBond);
}
}
Report(Chain,NChain,HBond,Cmd);
if( Cmd->MolScript )
MolScript(Chain,NChain,Cmd);
for( i=0; i<Cn; i++ ) free(Chain[i]);
for( i=0; i<NHBond; i++ ) free(HBond[i]);
free(Cmd);
return(0);
}
void ProcessStrideOptions(char **List, int ListLength, COMMAND *Cmd)
{
int i, InpFile = 0;
char OPTION;
BOOLEAN Password = NO;
if( Uniq(List,ListLength) == 0 ) {
fprintf(stderr,"All options must be unique\n");
PrintStrideHelp(Cmd);
}
DefaultCmd(Cmd);
Password = Specified(List,ListLength,'$');
for( i=1; i<ListLength; i++ ) {
if( *List[i] == '-' ) {
OPTION = toupper((*(List[i]+1)));
/*********************** Process public options ************************/
if(OPTION == 'M') {
strcpy(Cmd->MolScriptFile,List[i]+2);
Cmd->MolScript = YES;
}
else if( OPTION == 'O' ) Cmd->ReportSummaryOnly = YES;
else if( OPTION == 'H' ) Cmd->ReportBonds = YES;
else if( OPTION == 'R' ) strcpy(Cmd->Active,List[i]+2);
else if( OPTION == 'C' ) strcpy(Cmd->Processed,List[i]+2);
else if( OPTION == 'F' ) strcpy(Cmd->OutFile,List[i]+2);
else if( OPTION == 'Q' ) {
strcpy(Cmd->SeqFile,List[i]+2);
Cmd->OutSeq = YES;
}
/*********************** Process private options ************************/
else if( OPTION == 'I' && Password ) Cmd->Info = YES;
else if( OPTION == 'Z' && Password ) Cmd->Measure = YES;
else if( OPTION == 'K' && Password ) Cmd->ContactOrder = YES;
else if( OPTION == 'W' && Password ) Cmd->ContactMap = YES;
else if( OPTION == 'X' && Password ) strcpy(Cmd->FirstResidue,List[i]+2);
else if( OPTION == 'Y' && Password ) strcpy(Cmd->LastResidue,List[i]+2);
else if( OPTION == 'D' && Password ) {
strcpy(Cmd->DsspFile,List[i]+2);
Cmd->DsspAsn = YES;
}
else if( OPTION == 'B' && Password ) Cmd->BrookhavenAsn = YES;
else
if(OPTION == 'P'&& Password ) {
if( toupper(*(List[i]+2)) == 'H' )
strcpy(Cmd->MapFileHelix,List[i]+3);
else
if( toupper(*(List[i]+2)) == 'E' )
strcpy(Cmd->MapFileSheet,List[i]+3);
else
PrintStrideHelp(Cmd);
}
else
if( OPTION == 'T' && Password ) {
if( toupper(*(List[i]+2)) == 'H' ) {
if( toupper(*(List[i]+3)) == 'A' )
Cmd->Treshold_H1 = atof(List[i]+4);
else
if( toupper(*(List[i]+3)) == 'C' )
Cmd->Treshold_H3 = atof(List[i]+4);
else
if( toupper(*(List[i]+3)) == 'D' )
Cmd->Treshold_H4 = atof(List[i]+4);
else
PrintStrideHelp(Cmd);
}
else
if( toupper(*(List[i]+2)) == 'E' ) {
if( toupper(*(List[i]+3)) == 'A' )
Cmd->Treshold_E1 = atof(List[i]+4);
else
if( toupper(*(List[i]+3)) == 'B' )
Cmd->Treshold_E2 = atof(List[i]+4);
else
if( toupper(*(List[i]+3)) == 'C' )
Cmd->Treshold_E3 = atof(List[i]+4);
else
if( toupper(*(List[i]+3)) == 'D' )
Cmd->Treshold_E4 = atof(List[i]+4);
else
PrintStrideHelp(Cmd);
}
}
else if( OPTION == 'S' && Password ) {
Cmd->Stringent = YES;
if( (int)strlen(List[i]+2) > MAXCONDITIONS-1 )
PrintStrideHelp(Cmd);
strcpy(Cmd->Cond,List[i]+2);
}
else if( OPTION == 'L' && Password ) {
if( toupper(*(List[i]+2)) == 'L' ) Cmd->MaxLength = atoi(List[i]+3);
if( toupper(*(List[i]+2)) == 'G' ) Cmd->MinLength = atoi(List[i]+3);
}
else if( OPTION == 'U' && Password ) {
if( toupper(*(List[i]+2)) == 'L' ) Cmd->MaxResolution = atof(List[i]+3);
if( toupper(*(List[i]+2)) == 'G' ) Cmd->MinResolution = atof(List[i]+3);
}
else
if( OPTION != '$' )
PrintStrideHelp(Cmd);
}
else {
strcpy(Cmd->InputFile,List[i]);
InpFile++;
}
}
if( InpFile > 1 ) {
fprintf(stderr,"\nOnly one input file is allowed\n");
PrintStrideHelp(Cmd);
}
else
if( !InpFile ) {
fprintf(stderr,"\nYou must specify input file \n");
PrintStrideHelp(Cmd);
}
Cmd->NActive = (int)strlen(Cmd->Active);
Cmd->NProcessed = (int)strlen(Cmd->Processed);
if( Cmd->Measure ) {
Cmd->BrookhavenAsn = YES;
Cmd->DsspAsn = YES;
}
}
void PrintStrideHelp(COMMAND *Cmd)
{
fprintf(stderr,"\nAction: secondary structure assignment\n");
fprintf(stderr,"Usage: stride [Options] InputFile [ > file ]\n");
fprintf(stderr,"Options: \n");
fprintf(stderr," -fFile Output file\n");
fprintf(stderr," -mFile MolScript file\n");
fprintf(stderr," -o Report secondary structure summary Only\n");
fprintf(stderr," -h Report Hydrogen bonds\n");
fprintf(stderr," -rId1Id2.. Read only chains Id1, Id2 ...\n");
fprintf(stderr," -cId1Id2.. Process only Chains Id1, Id2 ...\n");
fprintf(stderr," -q[File] Generate SeQuence file in FASTA format and die\n");
fprintf(stderr,"\nOptions are position and case insensitive\n");
/*************** Private options - not for general use ****************/
if( Cmd->Info ) {
fprintf(stderr," -phFile PhiPsiMap file for alpha helix\n");
fprintf(stderr," -peFile PhiPsiMap file for beta-sheet\n");
fprintf(stderr," -pgFile PhiPsiMap file for 3-1 helix\n");
fprintf(stderr," -tha treshold (Ener*Conf*Conf) for H\n");
fprintf(stderr," -thc treshold (Conf) for H\n");
fprintf(stderr," -thd treshold (Conf) for H\n");
fprintf(stderr," -tea treshold (Ener*Conf*Conf) for E\n");
fprintf(stderr," -teb treshold (Conf) for E\n");
fprintf(stderr," -dFile Dssp file\n");
fprintf(stderr," -b Include Brookhaven assignment\n");
fprintf(stderr," -i Print detailed information\n");
fprintf(stderr," -llNumber Sequence Length less then Number (with -s)\n");
fprintf(stderr," -lgNumber Sequence Length greater then Number (with -s)\n");
fprintf(stderr," -ulNumber ResolUtion less (better) then Number (with -s)\n");
fprintf(stderr," -ugNumber ResolUtion greater (worse) then Number (with -s)\n");
fprintf(stderr," -s[xcnmapd] Stringent: discard wrong or suspisious PDB files \n");
fprintf(stderr," -x Process X-Ray structures\n");
fprintf(stderr," -n Process NMR structures\n");
fprintf(stderr," -m Process Model structures\n");
fprintf(stderr," -c Exlude structures with only Calpha atoms\n");
fprintf(stderr," -d Exculde structures with automatic secondary structure assignment\n");
fprintf(stderr," -a Exclude structures without secondary structure assignment\n");
fprintf(stderr," -p Exlude structures that are not published or in press\n");
fprintf(stderr," -z Measure differences with PDB and DSSP\n");
}
exit(0);
}
void DefaultCmd(COMMAND *Cmd)
{
Cmd->SideChainHBond = NO;
Cmd->MainChainHBond = YES;
Cmd->MainChainPolarInt = YES;
Cmd->Published = NO;
Cmd->DsspAssigned = NO;
Cmd->UseResolution = NO;
Cmd->Info = NO;
Cmd->Truncate = YES;
Cmd->ExposedArea = YES;
Cmd->ReportSummaryOnly = NO;
Cmd->ReportBonds = NO;
Cmd->BrookhavenAsn = NO;
Cmd->DsspAsn = NO;
Cmd->MolScript = NO;
Cmd->OutSeq = NO;
Cmd->Stringent = NO;
Cmd->Measure = NO;
Cmd->EnergyType = 'G';
Cmd->DistCutOff = 6.0;
Cmd->PhiPsiStep = 0.0;
Cmd->C1_H = -1.0;
Cmd->C2_H = 1.0;
Cmd->C1_E = -0.2;
Cmd->C2_E = 0.2;
Cmd->Treshold_H1 = -230.0;
Cmd->Treshold_H3 = 0.12;
Cmd->Treshold_H4 = 0.06;
Cmd->Treshold_E1 = -240.0;
Cmd->Treshold_E2 = -310.0;
Cmd->MinResolution = 0.1;
Cmd->MaxResolution = 100.0;
Cmd->MinLength = 0;
Cmd->MaxLength = MAX_RES;
Cmd->NPixel = 0;
Cmd->NActive = 0;
Cmd->NProcessed = 0;
strcpy(Cmd->FirstResidue,"");
strcpy(Cmd->LastResidue,"");
strcpy(Cmd->MapFileHelix,"");
strcpy(Cmd->MapFileSheet,"");
strcpy(Cmd->OutFile,"");
strcpy(Cmd->Active,"");
strcpy(Cmd->Processed,"");
strcpy(Cmd->Cond,"");
}

@ -0,0 +1,311 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <stdarg.h>
#define Pi 3.1415927
#define Eps 0.000001
#define Minimum(x,y) ((x)<(y) ? x : y)
#define Maximum(x,y) ((x)<(y) ? y : x)
#define Sign(x) ((x)<0 ? -1 : 1)
#define IN(x, target, range) ( (x >= (target - range)) && (x <= (target + range)) )
#define RAD(x) (x)*Pi/180.0
#define DEG(x) (x)*180.0/Pi
#define RADDEG 57.2958
#define BREAKDIST 2.5
#define SSDIST 3.0
#define SUCCESS 1
#define FAILURE 0
#define YES 1
#define NO 0
#define ERR -1
#define BUFSZ 1024
#define MAX_FIELD 50
#define MAX_AtomType 200
#define MAX_ResType 50
#define MAXNONSTAND 4.0
#define MAX_CHAIN 100
#define MAX_RES 20000
#define MAX_HETRES 20000
#define MAX_HET 200
#define MAX_HELIX 500
#define MAX_SHEET 500
#define MAX_STRAND_IN_SHEET 20
#define MAX_TURN 300
#define MAX_BOND 100
#define MAX_ASSIGN 500
#define MAX_INFO 1000
#define MAX_AT_IN_RES 75
#define MAX_AT_IN_HETERORES 200
#define MAXRESDNR 6
#define MAXRESACC 6
#define RES_FIELD 6
#define AT_FIELD 5
#define MAX_X 180.000
#define MAX_Y 180.000
#define MAX_Z 180.000
#define MIN_X -100.000
#define MIN_Y -100.000
#define MIN_Z -100.000
#define MAX_Occupancy 1.00
#define MIN_Occupancy 0.00
#define MAX_TempFactor 1000.00
#define MIN_TempFactor 0.00
#define OUTPUTWIDTH 80
#define MAXCONDITIONS 20
#define MAXHYDRBOND 50000
#define MAXDONOR MAX_RES
#define MAXACCEPTOR MAX_RES
#define MINPHIPSI -180.0
#define MAXPHIPSI 180.0
#define DEFNUMPIXEL 18
#define DIST_N_H 1.0
#define RmGRID 3.0
#define EmGRID -2.8
#define CGRID -3.0*EmGRID*pow(RmGRID,8.0)
#define DGRID -4.0*EmGRID*pow(RmGRID,6.0)
#define K1GRID 0.9/pow(cos(RAD(110.0)),6.0)
#define K2GRID pow(cos(RAD(110.0)),2.0)
#define MINACCANG_SP2 90.0
#define MAXACCANG_SP2 180.0
#define MINACCANG_SP3 60.0
#define MAXACCANG_SP3 180.0
#define MINDONANG_SP2 90.0
#define MAXDONANG_SP2 180.0
#define MINDONANG_SP3 90.0
#define MAXDONANG_SP3 180.0
#define ACCDONANG 60.0
#define DONACCANG 90.0
#define DSSPPATH "/data/dssp/"
#define NAcd 20
enum ASNSOURCE {Stride, Pdb, Dssp};
enum METHOD {XRay, NMR, Model};
enum HYBRID {Nsp2, Nsp3, Osp2, Osp3, Ssp3};
enum GROUP {Peptide, Trp, Asn, Gln, Arg, His, Lys, Ser, Thr, Tyr, Asp, Glu, Met, Cys};
enum HBONDTYPE {MM, MS, SM, SS };
typedef char BUFFER[BUFSZ+1];
typedef int BOOLEAN;
#define MAX_FILE 500
typedef struct {
char *FileName[MAX_FILE];
char *ChainId[MAX_FILE];
} CHAINLIST;
typedef struct {
float Phi, Psi, Omega;
int PhiZn, PsiZn;
float Solv, DsspSolv;
char Asn, PdbAsn, DsspAsn;
} PROPERTY;
typedef struct {
int HBondDnr[MAXRESDNR];
int HBondAcc[MAXRESACC];
int NBondDnr, NBondAcc;
BOOLEAN InterchainHBonds;
} INVOLVED;
typedef struct {
int NAtom;
char PDB_ResNumb[RES_FIELD];
char ResType[RES_FIELD];
char AtomType[MAX_AT_IN_RES][AT_FIELD];
float Coord[MAX_AT_IN_RES][3];
float Occupancy[MAX_AT_IN_RES];
float TempFactor[MAX_AT_IN_RES];
PROPERTY *Prop;
INVOLVED *Inv;
} RESIDUE;
typedef struct {
int NAtom;
char PDB_ResNumb[RES_FIELD];
char ResType[RES_FIELD];
char AtomType[MAX_AT_IN_HETERORES][AT_FIELD];
char Mendeleev[MAX_AT_IN_HETERORES];
float Coord[MAX_AT_IN_HETERORES][3];
float Occupancy[MAX_AT_IN_HETERORES];
float TempFactor[MAX_AT_IN_HETERORES];
} HETERORESIDUE;
typedef struct {
char HetId[4];
char PDB_ResNumb[RES_FIELD];
char InsCode;
int AtomNumb;
} HET;
typedef struct {
char Res1[RES_FIELD];
char Res2[RES_FIELD];
char PDB_ResNumb1[RES_FIELD], PDB_ResNumb2[RES_FIELD];
char InsCode1, InsCode2;
int Class;
} HELIX;
typedef struct {
int NStrand;
char SheetId[RES_FIELD];
char ResType1[MAX_STRAND_IN_SHEET][RES_FIELD];
char ResType2[MAX_STRAND_IN_SHEET][RES_FIELD];
char PDB_ResNumb1[MAX_STRAND_IN_SHEET][RES_FIELD];
char PDB_ResNumb2[MAX_STRAND_IN_SHEET][RES_FIELD];
char InsCode1[MAX_STRAND_IN_SHEET];
char InsCode2[MAX_STRAND_IN_SHEET];
int Sence[MAX_STRAND_IN_SHEET];
int RegYN[MAX_STRAND_IN_SHEET];
char AtomNameReg1[MAX_STRAND_IN_SHEET][AT_FIELD];
char AtomNameReg2[MAX_STRAND_IN_SHEET][AT_FIELD];
char ResTypeReg1[MAX_STRAND_IN_SHEET][RES_FIELD];
char ResTypeReg2[MAX_STRAND_IN_SHEET][RES_FIELD];
char PDB_ResNumbReg1[MAX_STRAND_IN_SHEET][RES_FIELD];
char PDB_ResNumbReg2[MAX_STRAND_IN_SHEET][RES_FIELD];
char InsCodeReg1[MAX_STRAND_IN_SHEET];
char InsCodeReg2[MAX_STRAND_IN_SHEET];
} SHEET;
typedef struct {
char Res1[RES_FIELD];
char Res2[RES_FIELD];
char PDB_ResNumb1[RES_FIELD], PDB_ResNumb2[RES_FIELD];
char InsCode1, InsCode2;
char TurnType;
} TURN;
typedef struct {
char PDB_ResNumb1[RES_FIELD], PDB_ResNumb2[RES_FIELD];
char InsCode1, InsCode2;
char ChainId1, ChainId2;
enum ASNSOURCE AsnSource;
} SSBOND;
typedef struct {
int NRes, NHetRes, NonStandRes, Ter;
int NHet, NAtom, NonStandAtom, NHelix, NSheet;
int NTurn, NAssignedTurn, NBond, NHydrBond, NHydrBondInterchain, NHydrBondTotal, NInfo;
char Id, *File;
float Resolution;
enum METHOD Method;
BOOLEAN Valid, Published, DsspAssigned;
RESIDUE **Rsd;
HETERORESIDUE **HetRsd;
HET **Het;
HELIX **Helix;
SHEET **Sheet;
TURN **Turn;
TURN **AssignedTurn;
SSBOND **SSbond;
char **Info;
char PdbIdent[5];
} CHAIN;
typedef struct {
CHAIN *Chain;
int D_Res, DD_Res, DDI_Res;
int D_At, DD_At, DDI_At, H;
enum HYBRID Hybrid;
enum GROUP Group;
float HB_Radius;
} DONOR;
typedef struct {
CHAIN *Chain;
int A_Res, AA_Res, AA2_Res;
int A_At, AA_At, AA2_At;
enum HYBRID Hybrid;
enum GROUP Group;
float HB_Radius;
} ACCEPTOR;
typedef struct {
BUFFER InputFile, OutFile, SeqFile;
BUFFER MapFileHelix, MapFileSheet;
BUFFER MolScriptFile, DsspFile;
char EnergyType, Active[MAX_CHAIN+1];
char Processed[MAX_CHAIN+1], Cond[MAXCONDITIONS];
char FirstResidue[RES_FIELD], LastResidue[RES_FIELD];
int NPixel, NActive, NProcessed;
int MinLength, MaxLength;
float PhiPsiStep, DistCutOff;
float Treshold_H1, Treshold_H2, Treshold_H3, Treshold_H4;
float Treshold_E1, Treshold_E2, Treshold_E3, Treshold_E4;
float MinResolution, MaxResolution;
float C1_H, C2_H, C1_E, C2_E;
BOOLEAN SideChainHBond, MainChainHBond, MainChainPolarInt;
BOOLEAN Published, DsspAssigned, UseResolution, Info, Truncate;
BOOLEAN ExposedArea, ReportSummaryOnly, ReportBonds, BrookhavenAsn, DsspAsn;
BOOLEAN MolScript, OutSeq, Stringent, Measure, ContactOrder, ContactMap;
/* Not used by STRIDE */
BOOLEAN Shrink;
BUFFER CarteFile, MapFile, MathFile;
char AsnSource, Mode, SecStrType;
int FilterOrder;
int NStepA, NStepB, NStepC, NStepD;
float Treshold_From_A, Treshold_To_A, StepA;
float Treshold_From_B, Treshold_To_B, StepB;
float Treshold_From_C, Treshold_To_C, StepC;
float Treshold_From_D, Treshold_To_D, StepD;
} COMMAND;
typedef struct {
DONOR *Dnr;
ACCEPTOR *Acc;
BOOLEAN ExistPolarInter, ExistHydrBondRose, ExistHydrBondBaker;
float Energy, Er, Et, Ep, ti, to, p;
float AccDonDist, OHDist, AngNHO, AngCOH;
float AccAng, DonAng, AccDonAng, DonAccAng;
} HBOND;
typedef struct PAT {
HBOND *Hb1, *Hb2;
struct PAT *Nei1, *Nei2;
BOOLEAN ExistPattern;
BUFFER Type;
} PATTERN;
typedef struct {
BUFFER File;
char Id;
int NRes;
char **ResType;
char *SecondStr;
char **PDB_ResNumb;
float *Accessibility;
} DSSP;
typedef struct {
int TP, TN, FP, FN;
float Corr, Perc;
} QUALITY;
#include "protot.h"
#include "nsc.h"

@ -0,0 +1,252 @@
#include "stride.h"
/*************************************************************************
** **
** Find sequential residue number for a PDB residue number **
** **
** INPUT: *Chain Pointer to a protein chain **
** *PdbN String containing PDB residue number **
** **
** OUTPUT: *SeqN Pointer to the sequential residue number **
** **
*************************************************************************/
int PdbN2SeqN(CHAIN *Chain, char *PdbN, int *SeqN)
{
for( (*SeqN)=0; (*SeqN)<Chain->NRes; (*SeqN)++ )
if( !strcmp(Chain->Rsd[(*SeqN)]->PDB_ResNumb,PdbN) )
return(SUCCESS);
return(FAILURE);
}
/*************************************************************************
** **
** Find atom of specified type in a residue **
** **
** INPUT: *Chain Pointer to a protein chain **
** ResNumb Number of residue in the protein chain **
** *Atom String containing atom name **
** **
** OUTPUT: *AtNumb Pointer to the atom number in the residue **
** **
*************************************************************************/
int FindAtom(CHAIN *Chain, int ResNumb, char *Atom, int *AtNumb)
{
for( (*AtNumb)=0; (*AtNumb)<Chain->Rsd[ResNumb]->NAtom; (*AtNumb)++ )
if( !strcmp(Atom,Chain->Rsd[ResNumb]->AtomType[(*AtNumb)]) )
return(SUCCESS);
*AtNumb = ERR;
return(FAILURE);
}
/*************************************************************************
** **
** Find beginning and end residues of each secondary structure element **
** in a secondary structure assignment **
** **
** INPUT: *Asn One letter secondary structure assignment **
** L Length of the protein chain **
** SecondStr Secondary structure type **
** **
** OUTPUT: *(Bound)[2] Two dimensional array containing numbers of **
** first and last residue of each secondary **
** structure element **
** **
** RETURNS: Number of the Secondary structure elements **
** **
*************************************************************************/
int Boundaries(char *Asn, int L, char SecondStr, int (*Bound)[2])
{
register int Res;
int NStr = 0, Flag = 0;
for( Res=0; Res<L; Res++ ) {
if( Asn[Res] == SecondStr && Flag == 0 ) {
Flag = 1;
Bound[NStr][0] = Res;
}
else
if( Asn[Res] != SecondStr && Flag == 1 ) {
Flag = 0;
Bound[NStr++][1] = Res-1;
}
}
return(NStr);
}
/*************************************************************************
** **
** Find protein chain with a given chain identifier number **
** **
** INPUT: **Chain Array of protein chains **
** NChain Number of chains **
** ChainId Chain identifier **
** **
** RETURNS: Number of the protein chain with identifier ChainId **
** **
*************************************************************************/
int FindChain(CHAIN **Chain, int NChain, char ChainId)
{
register int i;
for( i=0; i<NChain; i++ )
if( Chain[i]->Id == ChainId )
return(i);
return(ERR);
}
BOOLEAN IsHydrogen(char *AtomName)
{
if( ( isdigit(AtomName[0]) &&
( AtomName[1] == 'H' || AtomName[1] == 'D' ||
AtomName[1] == 'T' || AtomName[1] == 'Q' ) ) ||
AtomName[0] == 'H' || AtomName[0] == 'D' ||
AtomName[0] == 'T' || AtomName[0] == 'Q' )
return(SUCCESS);
else
return(FAILURE);
}
char *Translate(char Code)
{
static char *Dictionary[18] = {
"AlphaHelix","310Helix","PiHelix","Strand","Bridge","Coil","TurnI","TurnI'",
"TurnII","TurnII'","TurnVIa","TurnVIb","TurnVIII","TurnIV","GammaClassic",
"GammaInv","Turn","Unknown" };
switch(Code) {
case 'H': return(Dictionary[0]);
case 'G': return(Dictionary[1]);
case 'I': return(Dictionary[2]);
case 'E': return(Dictionary[3]);
case 'B':
case 'b':
return(Dictionary[4]);
case 'C': return(Dictionary[5]);
case '1': return(Dictionary[6]);
case '2': return(Dictionary[7]);
case '3': return(Dictionary[8]);
case '4': return(Dictionary[9]);
case '5': return(Dictionary[10]);
case '6': return(Dictionary[11]);
case '7': return(Dictionary[12]);
case '8': return(Dictionary[13]);
case '@': return(Dictionary[14]);
case '&': return(Dictionary[15]);
case 'T': return(Dictionary[16]);
default: return(Dictionary[17]);
}
}
char SpaceToDash(char Id)
{
static char NewId;
if( Id == ' ' )
NewId = '-';
else
NewId = Id;
return(NewId);
}
BOOLEAN ChInStr(char *String, char Char)
{
if( strchr(String,toupper(Char)) ||
strchr(String,Char) ||
strchr(String,tolower(Char)) )
return(YES);
return(NO);
}
void ExtractAsn(CHAIN **Chain, int Cn, char *Asn)
{
register int Res;
for( Res=0; Res<Chain[Cn]->NRes; Res++ )
Asn[Res] = Chain[Cn]->Rsd[Res]->Prop->Asn;
}
void ExtractPdbAsn(CHAIN **Chain, int Cn, char *Asn)
{
register int Res;
for( Res=0; Res<Chain[Cn]->NRes; Res++ )
Asn[Res] = Chain[Cn]->Rsd[Res]->Prop->PdbAsn;
}
void ExtractDsspAsn(CHAIN **Chain, int Cn, char *Asn)
{
register int Res;
for( Res=0; Res<Chain[Cn]->NRes; Res++ )
Asn[Res] = Chain[Cn]->Rsd[Res]->Prop->DsspAsn;
}
BOOLEAN ExistsSecStr(CHAIN **Chain, int NChain)
{
register int i, Cn;
for( Cn=0; Cn<NChain; Cn++ )
for( i=0; i<Chain[Cn]->NRes; i++ )
if( Chain[Cn]->Rsd[i]->Prop->Asn != 'C' )
return(YES);
return(NO);
}
/*************************************************************************
** **
** Calculate the number of residues in helical or beta sheet state and **
** what percent they constitute from the total number of residues in a **
** protein chain **
** **
** INPUT: *Chain Pointer to a protein chain **
** **
** OUTPUT: *HelAlp Number of alpha-helical residues **
** *HelPI Number of residues in pi-helices **
** *Hel310 Number of residues in 3-10 helices **
** *Sheet Number of residues in beta sheet **
** **
** RETURNS: Secondary structure content **
** **
*************************************************************************/
float SecStrContent(CHAIN *Chain, int *HelAlp, int *HelPI, int *Hel310, int *Sheet, int *Turn)
{
int Res;
float Content = 0.0;
*HelAlp = 0; *HelPI = 0; *Hel310 = 0; *Sheet = 0; *Turn = 0;
for( Res=0; Res<Chain->NRes; Res++ ) {
switch( Chain->Rsd[Res]->Prop->PdbAsn ) {
case 'H' : (*HelAlp)++;
break;
case 'G' : (*Hel310)++;
break;
case 'I' : (*HelPI)++;
break;
case 'E' : (*Sheet)++;
break;
case 'T' : (*Turn)++;
break;
}
}
Content = ( (float)( (*HelAlp)+(*HelPI)+(*Hel310)+(*Sheet)+(*Turn) ) )/(float)Chain->NRes;
return(Content);
}

@ -0,0 +1,30 @@
#include <string.h>
#include <stdio.h>
char ThreeToOne(char *Three)
{
if( !strcmp(Three,"ALA") ) return('A');
else if( !strcmp(Three,"ARG") ) return('R');
else if( !strcmp(Three,"ASN") ) return('N');
else if( !strcmp(Three,"ASP") ) return('D');
else if( !strcmp(Three,"ASX") ) return('B');
else if( !strcmp(Three,"CYS") ) return('C');
else if( !strcmp(Three,"GLN") ) return('Q');
else if( !strcmp(Three,"GLU") ) return('E');
else if( !strcmp(Three,"GLX") ) return('Z');
else if( !strcmp(Three,"GLY") ) return('G');
else if( !strcmp(Three,"HIS") ) return('H');
else if( !strcmp(Three,"ILE") ) return('I');
else if( !strcmp(Three,"LEU") ) return('L');
else if( !strcmp(Three,"LYS") ) return('K');
else if( !strcmp(Three,"MET") ) return('M');
else if( !strcmp(Three,"PRO") ) return('P');
else if( !strcmp(Three,"PHE") ) return('F');
else if( !strcmp(Three,"SER") ) return('S');
else if( !strcmp(Three,"THR") ) return('T');
else if( !strcmp(Three,"TRP") ) return('W');
else if( !strcmp(Three,"TYR") ) return('Y');
else if( !strcmp(Three,"VAL") ) return('V');
else return('X');
}

@ -0,0 +1,20 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define BUFSZ 1024
char *tolostr(char *InputString)
{
register int i;
int Length;
static char OutputString[BUFSZ];
strcpy(OutputString,InputString);
Length = (int)strlen(OutputString);
for( i=0; i<Length; i++ )
OutputString[i] = tolower(OutputString[i]);
return(OutputString);
}

155
turn.c

@ -0,0 +1,155 @@
#include "stride.h"
void BetaTurn(CHAIN **Chain, int Cn)
{
register int i;
RESIDUE **r;
TURN *t;
int CA1, CA4, Tn;
float Phi2, Phi3, Psi2, Psi3, Range1 = 30.0, Range2 = 45.0;
char TurnType;
for( i=0; i<Chain[Cn]->NRes-4; i++ ) {
r = &Chain[Cn]->Rsd[i];
if( r[1]->Prop->Asn == 'H' || r[2]->Prop->Asn == 'H' ||
r[1]->Prop->Asn == 'G' || r[2]->Prop->Asn == 'G' ||
r[1]->Prop->Asn == 'I' || r[2]->Prop->Asn == 'G' ||
!FindAtom(Chain[Cn],i,"CA",&CA1) || !FindAtom(Chain[Cn],i+3,"CA",&CA4) ||
Dist(r[0]->Coord[CA1],r[3]->Coord[CA4]) > 7.0 )
continue;
Phi2 = r[1]->Prop->Phi;
Psi2 = r[1]->Prop->Psi;
Phi3 = r[2]->Prop->Phi;
Psi3 = r[2]->Prop->Psi;
if( TurnCondition(Phi2,-60.0,Psi2,-30,Phi3,-90.0,Psi3,0,Range1,Range2) )
TurnType = '1';
else
if( TurnCondition(Phi2,60.0,Psi2,30,Phi3,90.0,Psi3,0,Range1,Range2) )
TurnType = '2';
else
if( TurnCondition(Phi2,-60.0,Psi2,120,Phi3,80.0,Psi3,0,Range1,Range2) )
TurnType = '3';
else
if( TurnCondition(Phi2,60.0,Psi2,-120,Phi3,-80.0,Psi3,0,Range1,Range2) )
TurnType = '4';
else
if( TurnCondition(Phi2,-60.0,Psi2,120,Phi3,-90.0,Psi3,0,Range1,Range2) )
TurnType = '5';
else
if( TurnCondition(Phi2,-120.0,Psi2,120,Phi3,-60.0,Psi3,0,Range1,Range2) )
TurnType = '6';
else
if( TurnCondition(Phi2,-60.0,Psi2,-30,Phi3,-120.0,Psi3,120,Range1,Range2) )
TurnType = '7';
else
TurnType = '8';
if( r[0]->Prop->Asn == 'C' )
r[0]->Prop->Asn = 'T';
if( r[1]->Prop->Asn == 'C' )
r[1]->Prop->Asn = 'T';
if( r[2]->Prop->Asn == 'C' )
r[2]->Prop->Asn = 'T';
if( r[3]->Prop->Asn == 'C' )
r[3]->Prop->Asn = 'T';
Tn = Chain[Cn]->NAssignedTurn;
Chain[Cn]->AssignedTurn[Tn] = (TURN *)ckalloc(sizeof(TURN));
t = Chain[Cn]->AssignedTurn[Tn];
strcpy(t->Res1,r[0]->ResType);
strcpy(t->Res2,r[3]->ResType);
strcpy(t->PDB_ResNumb1,r[0]->PDB_ResNumb);
strcpy(t->PDB_ResNumb2,r[3]->PDB_ResNumb);
t->TurnType = TurnType;
Chain[Cn]->NAssignedTurn++;
}
}
void GammaTurn(CHAIN **Chain, int Cn, HBOND **HBond)
{
register int i;
RESIDUE **r;
TURN *t;
int Tn;
float Phi2, Psi2;
char TurnType, Asn;
for( i=0; i<Chain[Cn]->NRes-2; i++ ) {
r = &Chain[Cn]->Rsd[i-1];
Asn = r[2]->Prop->Asn;
if( Asn == 'H' || Asn == 'T' || Asn == 'G' || Asn == 'I' ||
FindBnd(HBond,r[3],r[1]) == ERR ||
(i > 0 && FindBnd(HBond,r[3],r[0]) != ERR) ||
(i < Chain[Cn]->NRes-3 && FindBnd(HBond,r[4],r[1]) != ERR) )
continue;
Phi2 = r[2]->Prop->Phi;
Psi2 = r[2]->Prop->Psi;
if( Phi2 > 0.0 && Psi2 < 0.0 )
TurnType = '@';
else
if( Phi2 < 0.0 && Psi2 > 0.0 )
TurnType = '&';
else
continue;
if( r[1]->Prop->Asn == 'C' )
r[1]->Prop->Asn = 'T';
if( r[2]->Prop->Asn == 'C' )
r[2]->Prop->Asn = 'T';
if( r[3]->Prop->Asn == 'C' )
r[3]->Prop->Asn = 'T';
Tn = Chain[Cn]->NAssignedTurn;
Chain[Cn]->AssignedTurn[Tn] = (TURN *)ckalloc(sizeof(TURN));
t = Chain[Cn]->AssignedTurn[Tn];
strcpy(t->Res1,r[1]->ResType);
strcpy(t->Res2,r[3]->ResType);
strcpy(t->PDB_ResNumb1,r[1]->PDB_ResNumb);
strcpy(t->PDB_ResNumb2,r[3]->PDB_ResNumb);
t->TurnType = TurnType;
Chain[Cn]->NAssignedTurn++;
}
}
int TurnCondition(float Phi2,float Phi2S,float Psi2,float Psi2S,
float Phi3,float Phi3S,float Psi3,float Psi3S,
float Range1,float Range2)
{
if((IN(Phi2,Phi2S,Range2)==YES && IN(Psi2,Psi2S,Range1)==YES &&
IN(Phi3,Phi3S,Range1)==YES && IN(Psi3,Psi3S,Range1)==YES)
||
(IN(Phi2,Phi2S,Range1)==YES && IN(Psi2,Psi2S,Range2)==YES &&
IN(Phi3,Phi3S,Range1)==YES && IN(Psi3,Psi3S,Range1)==YES)
||
(IN(Phi2,Phi2S,Range1)==YES && IN(Psi2,Psi2S,Range1)==YES &&
IN(Phi3,Phi3S,Range2)==YES && IN(Psi3,Psi3S,Range1)==YES)
||
(IN(Phi2,Phi2S,Range1)==YES && IN(Psi2,Psi2S,Range1)==YES &&
IN(Phi3,Phi3S,Range1)==YES && IN(Psi3,Psi3S,Range2)==YES)
)
return(SUCCESS);
return(FAILURE);
}
Loading…
Cancel
Save