/* * Copyright (C) 1992-1994 Dmitrij Frishman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #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 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= ElLength && ( Count2 < ElLength || Count3 < ElLength ) ) for( j=Beg-1; j= ElLength && ( Count1 < ElLength || Count3 < ElLength ) ) for( j=Beg-1; j= ElLength && ( Count1 < ElLength || Count2 < ElLength ) ) for( j=Beg-1; j Count2 ) (*Worse)++; else if( Count2 > Count1 ) (*Better)++; Beg = -1; } } return(TotalNumber); }