166 strcpy(chain,pdb->
chain);
172 if(strncmp(p->
resnam,
"NTER",4) &&
173 strncmp(p->
resnam,
"CTER",4) &&
184 strcpy(chain,p->
chain);
189 if(NBreak) rescount += NBreak;
192 sequence = malloc((rescount + 1) *
sizeof(
char));
201 (!strncmp(p->
resnam,
"NTER",4) ||
219 if(NoX && sequence[0] ==
'X')
224 strcpy(chain,p->
chain);
235 sequence[rescount++] =
'*';
236 strcpy(chain,p->
chain);
242 if(strncmp(p->
resnam,
"NTER",4) && strncmp(p->
resnam,
"CTER",4))
244 sequence[rescount] = ((DoAsxGlx) ?
253 if(NoX && sequence[rescount-1] ==
'X')
263 sequence[rescount] =
'\0';
307 lastresnum = (-1000);
308 strcpy(lastinsert,
"z");
318 if((sequence=(
char *)malloc(ArraySize *
sizeof(
char)))==
NULL)
346 if((p->
resnum != lastresnum) ||
350 if(strncmp(p->
resnam,
"NTER",4) &&
351 strncmp(p->
resnam,
"CTER",4))
353 sequence[nres]=((DoAsxGlx) ?
blThronex((p)->resnam) :
361 (!NoX || (sequence[nres] !=
'X')))
365 if(nres >= ArraySize)
368 if((sequence=(
char *)realloc(sequence, ArraySize))==
NULL)
376 sequence[nres] =
'\0';
381 strcpy(lastinsert, p->
insert);
382 strcpy(lastchain, p->
chain);
398 int main(
int argc,
char **argv)
406 if((fp = fopen(argv[1],
"r"))!=
NULL)
412 printf(
"blDoPDB2Seq(): %s\n", seq);
416 char **chains =
NULL;
418 printf(
"blDoPDB2SeqByChain()\n");
423 for(i=0; chains[i]!=
NULL; i++)
int main(int argc, char **argv)
Include file for PDB routines.
char blThronex(char *three)
char ** blGetHashKeyList(HASHTABLE *hashtable)
BOOL gBioplibSeqNucleicAcid
char * blGetHashValueString(HASHTABLE *hashtable, char *key)
BOOL blSetHashValueString(HASHTABLE *hashtable, char *key, char *value)
char * blDoPDB2Seq(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX)
HASHTABLE * blInitializeHash(ULONG hashsize)
PDB * blReadPDB(FILE *fp, int *natom)
Header file for sequence handling.
void blFreeHashKeyList(char **keylist)
#define INSERTMATCH(ins1, ins2)
void blFreeHash(HASHTABLE *hashtable)
BOOL blHashKeyDefined(HASHTABLE *hashtable, char *key)
char blThrone(char *three)
#define CHAINMATCH(chain1, chain2)
char chain[blMAXCHAINLABEL]
HASHTABLE * blDoPDB2SeqByChain(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX)