120 #ifndef NODEPRECATION
121 # ifndef _DEPRECATED_H
122 # define _DEPRECATED_H
157 # if(defined BIOPLIB_DEPRECATED_CHECK || defined BIOPLIB_DEPRECATED_QUIET)
158 # ifndef BIOPLIB_DEPRECATED_QUIET
159 # define DEPRECATED(s, t) \
161 "This code uses %s which is now deprecated!\n" \
162 " Use %s instead\n", (s), (t))
164 # define DEPRECATED(s, t)
167 # define DEPRECATED(s, t) \
169 if(!getenv("BIOPLIB_DEPRECATED_QUIET")) \
171 "This code uses %s which is now deprecated!\n" \
172 " Use %s instead\n" \
173 " Set the BIOPLIB_DEPRECATED_QUIET environment \
174 variable to silence this message\n" , (s), (t)); \
194 # ifdef _GENERAL_H_DEPRECATED
195 # undef _GENERAL_H_DEPRECATED
197 void StringToLower(
char *string1,
char *string2);
198 void StringToUpper(
char *string1,
char *string2);
199 char *KillLeadSpaces(
char *
string);
200 void KillLine(FILE *fp);
201 void SetExtn(
char *File,
char *Ext);
202 int chindex(
char *
string,
char ch);
203 void Word(
char *string1,
char *string2);
204 void WordN(
char *string1,
char *string2,
int MaxChar);
205 void padterm(
char *
string,
int length);
206 void padchar(
char *
string,
int length,
char ch);
207 BOOL CheckExtn(
char *
string,
char *ext);
208 char *ftostr(
char *str,
int maxlen,
REAL x,
int precision);
210 void GetFilestem(
char *filename,
char *stem);
211 int upstrcmp(
char *word1,
char *word2);
212 int upstrncmp(
char *word1,
char *word2,
int ncomp);
213 char *GetWord(
char *buffer,
char *word,
int maxsize);
214 BOOL OpenStdFiles(
char *infile,
char *outfile, FILE **in, FILE **out);
215 FILE *OpenFile(
char *filename,
char *envvar,
char *mode,
BOOL *noenv);
216 int countchar(
char *
string,
char ch);
217 char *fgetsany(FILE *fp);
218 char *strcatalloc(
char *instr,
char *catstr);
224 char *QueryStrStr(
char *
string,
char *substring);
226 void IndexReal(
REAL *arrin,
int *indx,
int n);
228 FILE *OpenOrPipe(
char *filename);
229 int CloseOrPipe(FILE *fp);
231 BOOL WrapString(
char *in,
char *out,
int maxlen);
232 BOOL WrapPrint(FILE *out,
char *
string);
233 void RightJustify(
char *
string);
234 char *GetWordNC(
char *buffer,
char *word,
int maxlen);
235 void getfield(
char *buffer,
int start,
int width,
char *str);
242 # ifdef _PDB_H_DEPRECATED
243 # undef _PDB_H_DEPRECATED
245 char *GetPDBChainLabels(
PDB *pdb);
246 PDB *ReadPDB(FILE *fp,
int *natom);
247 PDB *ReadPDBAll(FILE *fp,
int *natom);
248 PDB *ReadPDBAtoms(FILE *fp,
int *natom);
249 PDB *ReadPDBOccRank(FILE *fp,
int *natom,
int OccRank);
250 PDB *ReadPDBAtomsOccRank(FILE *fp,
int *natom,
int OccRank);
251 PDB *doReadPDB(FILE *fp,
int *natom,
BOOL AllAtoms,
int OccRank,
253 PDB *doReadPDBML(FILE *fp,
int *natom,
BOOL AllAtoms,
int OccRank,
255 BOOL CheckFileFormatPDBML(FILE *fp);
257 void WritePDB(FILE *fp,
PDB *pdb);
258 void WriteAsPDB(FILE *fp,
PDB *pdb);
259 void WriteAsPDBML(FILE *fp,
PDB *pdb);
260 BOOL FormatCheckWritePDB(
PDB *pdb);
261 void WriteWholePDB(FILE *fp,
WHOLEPDB *wpdb);
262 void WriteWholePDBHeader(FILE *fp,
WHOLEPDB *wpdb);
263 void WriteWholePDBTrailer(FILE *fp,
WHOLEPDB *wpdb);
265 void WritePDBRecord(FILE *fp,
PDB *pdb);
266 void WritePDBRecordAtnam(FILE *fp,
PDB *pdb);
267 void WriteGromosPDB(FILE *fp,
PDB *pdb);
268 void WriteGromosPDBRecord(FILE *fp,
PDB *pdb);
269 void GetCofGPDB(
PDB *pdb,
VEC3F *cg);
270 void GetCofGPDBRange(
PDB *start,
PDB *stop,
VEC3F *cg);
271 void GetCofGPDBSCRange(
PDB *start,
PDB *stop,
VEC3F *cg);
272 void OriginPDB(
PDB *pdb);
273 void RotatePDB(
PDB *pdb,
REAL rm[3][3]);
274 void TranslatePDB(
PDB *pdb,
VEC3F tvect);
280 int GetPDBCoor(
PDB *pdb,
COOR **coor);
281 BOOL FindZonePDB(
PDB *pdb,
int start,
char startinsert,
int stop,
282 char stopinsert,
char chain,
int mode,
283 PDB **pdb_start,
PDB **pdb_stop);
284 int HAddPDB(FILE *fp,
PDB *pdb);
285 int ReadPGP(FILE *fp);
286 FILE *OpenPGPFile(
char *pgpfile,
BOOL AllHyd);
287 PDB *SelectAtomsPDB(
PDB *pdbin,
int nsel,
char **sel,
int *natom);
288 PDB *StripHPDB(
PDB *pdbin,
int *natom);
289 SECSTRUC *ReadSecPDB(FILE *fp,
int *nsec);
290 void RenumAtomsPDB(
PDB *pdb);
291 PDB *FindEndPDB(
PDB *start);
294 BOOL GetAtomTypes(
char *resnam,
char **AtomTypes);
296 void CopyPDB(
PDB *out,
PDB *in);
300 REAL CalcChi(
PDB *pdb,
int type);
301 PDB *GetPDBByN(
PDB *pdb,
int n);
304 void SetResnam(
PDB *ResStart,
PDB *NextRes,
char *resnam,
int resnum,
305 char *insert,
char *chain);
306 void ApplyMatrixPDB(
PDB *pdb,
REAL matrix[3][3]);
307 BOOL GetResolPDB(FILE *fp,
REAL *resolution,
REAL *RFactor,
313 char *ReportStructureType(
int type);
314 PDB **IndexPDB(
PDB *pdb,
int *natom);
316 BOOL ParseResSpec(
char *spec,
char *chain,
int *resnum,
char *insert);
317 BOOL ParseResSpecNoUpper(
char *spec,
char *chain,
int *resnum,
char *insert);
318 BOOL DoParseResSpec(
char *spec,
char *chain,
int *resnum,
char *insert,
319 BOOL uppercaseresspec);
320 BOOL RepSChain(
PDB *pdb,
char *sequence,
char *ChiTable,
char *RefCoords);
321 PDB *FindNextChainPDB(
PDB *pdb);
322 BOOL FixCterPDB(
PDB *pdb,
int style);
324 int CalcTetraHCoords(
PDB *nter,
COOR *coor);
325 int AddNTerHs(
PDB **ppdb,
BOOL Charmm);
326 char *FNam2PDB(
char *filename);
327 PDB *TermPDB(
PDB *pdb,
int length);
328 PDB *FindHetatmResidueSpec(
PDB *pdb,
char *resspec);
329 PDB *FindResidueSpec(
PDB *pdb,
char *resspec);
330 PDB *FindNextResidue(
PDB *pdb);
333 void CalcCellTrans(
VEC3F UnitCell,
VEC3F CellAngles,
335 int GetCrystPDB(FILE *fp,
VEC3F *UnitCell,
VEC3F *CellAngles,
337 REAL OrigMatrix[3][4],
REAL ScaleMatrix[3][4]);
338 void WriteCrystPDB(FILE *fp,
VEC3F UnitCell,
VEC3F CellAngles,
340 REAL OrigMatrix[3][4],
REAL ScaleMatrix[3][4]);
341 PDB *ExtractZonePDB(
PDB *inpdb,
char *chain1,
int resnum1,
char *insert1,
342 char *chain2,
int resnum2,
char *insert2);
343 PDB *ExtractZoneSpecPDB(
PDB *pdb,
char *firstRes,
char *lastRes);
344 PDB *FindResidue(
PDB *pdb,
char chain,
int resnum,
char insert);
345 PDB *FindHetatmResidue(
PDB *pdb,
char chain,
int resnum,
char insert);
347 BOOL InPDBZone(
PDB *p,
char chain,
int resnum1,
char insert1,
348 int resnum2,
char insert2);
349 BOOL InPDBZoneSpec(
PDB *p,
char *resspec1,
char *resspec2);
350 BOOL AtomNameMatch(
char *
atnam,
char *spec,
BOOL *ErrorWarn);
351 BOOL AtomNameRawMatch(
char *
atnam,
char *spec,
BOOL *ErrorWarn);
352 BOOL LegalAtomSpec(
char *spec);
353 BOOL RepOneSChain(
PDB *pdb,
char *ResSpec,
char aa,
char *ChiTable,
355 void EndRepSChain(
void);
356 char **ReadSeqresPDB(FILE *fp,
int *nchains);
357 PDB *SelectCaPDB(
PDB *pdb);
358 char *FixAtomName(
char *name,
REAL occup);
362 WHOLEPDB *ReadWholePDBAtoms(FILE *fpin);
365 PDB *StripGlyCB(
PDB *pdb);
366 PDB *RemoveAlternates(
PDB *pdb);
367 PDB *BuildAtomNeighbourPDBList(
PDB *pdb,
PDB *pRes,
REAL NeighbDist);
368 PDB *FindAtomWildcardInRes(
PDB *pdb,
char *pattern);
369 PDB *DupeResiduePDB(
PDB *in);
370 PDB *StripWatersPDB(
PDB *pdbin,
int *natom);
372 PDB *FindNextChain(
PDB *pdb);
373 void FreePDBStructure(
PDBSTRUCT *pdbstruct);
374 void SetElementSymbolFromAtomName(
char *element,
char * atom_name);
381 # ifdef _BUFFINPUT_H_DEPRECATED
382 # undef _BUFFINPUT_H_DEPRECATED
384 INBUFFER *OpenBufferedFile(
char *filename,
int maxstr);
385 BOOL ReadBufferedFile(
INBUFFER *bfp,
char *
string,
int length);
386 BOOL ProbeBufferedFile(
INBUFFER *bfp,
char *
string,
int length);
392 # ifdef _ERRSTACK_H_DEPRECATED
393 # undef _ERRSTACK_H_DEPRECATED
395 void StoreError(
char *routine,
char *error);
396 void ShowErrors(
void *PrintRoutine(
char *),
BOOL Trace);
403 # ifdef _MATHUTIL_H_DEPRECATED
404 # undef _MATHUTIL_H_DEPRECATED
406 void CalcSD(
REAL val,
int action,
REAL *mean,
REAL *SD);
407 void CalcExtSD(
REAL val,
int action,
REAL *Sx,
REAL *SxSq,
408 int *NValues,
REAL *mean,
REAL *SD);
423 ULONG factorial(
int n);
424 ULONG Factdiv(
int n1,
int n2);
425 ULONG NPerm(
int n,
int r);
426 ULONG NComb(
int n,
int r);
433 # ifdef _WINDIO_H_DEPRECATED
434 # undef _WINDIO_H_DEPRECATED
436 void screen(
char *
string);
437 void prompt(
char *
string);
439 void GetKybdString(
char *
string,
int maxlen);
441 void PagingOff(
void);
442 void WindowMode(
BOOL mode);
443 void WindowInteractive(
BOOL mode);
444 int YorN(
char deflt);
451 # ifdef _AALIST_H_DEPRECATED
452 # undef _AALIST_H_DEPRECATED
454 AA *InsertNextResiduesInAAList(
AA *a,
char res,
int nres);
455 AA *InsertNextResidueInAAList(
AA *a,
char res);
456 char *BuildSeqFromAAList(
AA *
aa);
457 AA *InsertResidueInAAListAt(
AA *
aa,
char res,
int pos);
458 AA *InsertResiduesInAAListAt(
AA *
aa,
char res,
int nres,
int pos);
459 AA *BuildAAList(
char *seq);
460 int FindAAListOffsetByResnum(
AA *
aa,
int resnum);
461 AA *FindAAListItemByResnum(
AA *
aa,
int resnum);
462 void SetAAListFlagByResnum(
AA *
aa,
int resnum);
463 char *BuildFlagSeqFromAAList(
AA *
aa,
char ch);
464 int GetAAListLen(
AA *
aa);
471 # ifdef _ANGLE_H_DEPRECATED
472 # undef _ANGLE_H_DEPRECATED
489 # ifdef _ARRAY_H_DEPRECATED
490 # undef _ARRAY_H_DEPRECATED
492 char **Array2D(
int size,
int dim1,
int dim2);
493 void FreeArray2D(
char **array,
int dim1,
int dim2);
494 char ***Array3D(
int size,
int dim1,
int dim2,
int dim3);
495 void FreeArray3D(
char ***array,
int dim1,
int dim2,
int dim3);
503 # ifdef _CSSR_H_DEPRECATED
504 # undef _CSSR_H_DEPRECATED
506 CSSR *ReadCSSR(FILE *fp,
int *natom,
char *name,
char *title);
507 PDB *ReadCSSRasPDB(FILE *fp,
int *natom);
513 REAL amatrx[3][3],
int isw,
int ncode);
514 void WriteCSSR(FILE *fp,
CSSR *cssr,
char *name,
char *title);
521 # ifdef _FIT_H_DEPRECATED
522 # undef _FIT_H_DEPRECATED
533 # ifdef _HBOND_H_DEPRECATED
534 # undef _HBOND_H_DEPRECATED
536 int IsHBonded(
PDB *res1,
PDB *res2,
int type);
538 int IsMCDonorHBonded(
PDB *res1,
PDB *res2,
int type);
539 int IsMCAcceptorHBonded(
PDB *res1,
PDB *res2,
int type);
546 # ifdef _HELP_H_DEPRECATED
547 # undef _HELP_H_DEPRECATED
549 void Help(
char *
string,
char *HelpFile);
550 void DoHelp(
char *
string,
char *HelpFile);
557 # ifdef _HPGL_H_DEPRECATED
558 # undef _HPGL_H_DEPRECATED
560 BOOL HPGLInit(
char *filename,
char *AltFont,
REAL xmargin,
REAL ymargin);
561 void HPGLPen(
int num);
564 void HPGLSetDash(
int style);
565 void HPGLFont(
int font,
REAL size);
571 void HPGLVText(
REAL x,
REAL y,
REAL xoff,
char *text,
int TitleFont,
572 REAL TitleSize,
char *label,
int LabelFont,
REAL LabelSize);
574 void HPGLShowText(
char *text,
BOOL orientation,
int XBase,
int YBase);
581 # ifdef _MATRIX_H_DEPRECATED
582 # undef _MATRIX_H_DEPRECATED
585 void MatMult33_33(
REAL a[3][3],
REAL b[3][3],
REAL out[3][3]);
586 void invert33(
REAL s[3][3],
REAL ss[3][3]);
587 void CreateRotMat(
char direction,
REAL angle,
REAL matrix[3][3]);
595 # ifdef _PARSE_H_DEPRECATED
596 # undef _PARSE_H_DEPRECATED
598 int parse(
char *comline,
int nkeys,
KeyWd *keywords,
REAL *REALparam,
600 int mparse(
char *comline,
int nkeys,
MKeyWd *keywords,
REAL *REALparam,
601 char **strparam,
int *nparams);
602 int match(
char *comstring,
char *string2,
int *nletters);
603 int GetString(
char *command,
char *strparam);
604 int GetParam(
char *command,
REAL *value,
int *nletters);
611 # ifdef _PLOTTING_H_DEPRECATED
612 # undef _PLOTTING_H_DEPRECATED
614 BOOL AMInitPlot(
char *filename,
char *title,
int dest,
REAL OutXSize,
616 char *AltFont,
REAL xmargin,
REAL ymargin,
619 void AMSetPen(
int dest,
int pen);
622 void AMSetLineStyle(
int dest,
int style);
623 void AMEndLine(
int dest);
624 void AMSetFont(
int dest,
char *PSFontName,
REAL FontSize);
625 void AMText(
int dest,
REAL x,
REAL y,
char *text);
626 void AMCBText(
int dest,
REAL x,
REAL y,
char *text);
628 void AMLCText(
int dest,
REAL x,
REAL y,
char *text);
629 void AMCTText(
int dest,
REAL x,
REAL y,
REAL CTOffset,
char *text);
630 void AMEndPlot(
int dest);
631 int PS2HPGLFont(
char *font);
632 char *SimplifyText(
char *
string);
639 # ifdef _PS_H_DEPRECATED
640 # undef _PS_H_DEPRECATED
642 BOOL PSInit(
char *FName,
char *creator,
char *AltFont);
643 void PSThick(
REAL thickness);
646 void PSSetDash(
char *linepatt);
647 void PSClearDash(
void);
649 void PSFont(
char *fontname,
REAL size);
650 void PSLText(
REAL X,
REAL Y,
char *label);
651 void PSCBText(
REAL X,
REAL Y,
REAL Offset,
char *label);
652 void PSROffText(
REAL X,
REAL Y,
REAL offset,
char *label);
653 void PSLCText(
REAL X,
REAL Y,
char *label);
654 void PSCTText(
REAL X,
REAL Y,
REAL Offset,
char *label);
656 char *label,
char *lfont,
REAL lsize);
657 void PSShowText(
char *text);
659 char *PSCorrectCase(
char *font);
666 # ifdef _SAFEMEM_H_DEPRECATED
667 # undef _SAFEMEM_H_DEPRECATED
669 void *safemalloc(
int nbytes);
670 BOOL safefree(
void *ptr);
671 void safeleaks(
void);
678 # ifdef _SEQ_H_DEPRECATED
679 # undef _SEQ_H_DEPRECATED
681 #define PDB2Seq(x) DoPDB2Seq((x), FALSE, FALSE, FALSE)
682 #define PDB2SeqX(x) DoPDB2Seq((x), TRUE, FALSE, FALSE)
683 #define PDB2SeqNoX(x) DoPDB2Seq((x), FALSE, FALSE, TRUE)
684 #define PDB2SeqXNoX(x) DoPDB2Seq((x), TRUE, FALSE, TRUE)
686 #define PDBProt2Seq(x) DoPDB2Seq((x), FALSE, TRUE, FALSE)
687 #define PDBProt2SeqX(x) DoPDB2Seq((x), TRUE, TRUE, FALSE)
688 #define PDBProt2SeqNoX(x) DoPDB2Seq((x), FALSE, TRUE, TRUE)
689 #define PDBProt2SeqXNoX(x) DoPDB2Seq((x), TRUE, TRUE, TRUE)
694 char throne(
char *three);
695 char thronex(
char *three);
696 char *onethr(
char one);
698 int SplitSeq(
char *LinearSeq,
char **seqs);
699 int ReadSimplePIR(FILE *fp,
int maxres,
char **seqs);
700 int ReadPIR(FILE *fp,
BOOL DoInsert,
char **seqs,
int maxchain,
702 int ReadRawPIR(FILE *fp,
char **seqs,
int maxchain,
BOOL upcase,
704 int align(
char *seq1,
int length1,
char *seq2,
int length2,
705 BOOL verbose,
BOOL identity,
int penalty,
706 char *align1,
char *align2,
int *align_len);
707 int affinealign(
char *seq1,
int length1,
char *seq2,
int length2,
708 BOOL verbose,
BOOL identity,
int penalty,
int penext,
709 char *align1,
char *align2,
int *align_len);
710 int CalcMDMScore(
char resa,
char resb);
711 int affinealignuc(
char *seq1,
int length1,
char *seq2,
int length2,
712 BOOL verbose,
BOOL identity,
int penalty,
int penext,
713 char *align1,
char *align2,
int *align_len);
714 int CalcMDMScoreUC(
char resa,
char resb);
715 BOOL ReadMDM(
char *mdmfile);
717 char DNAtoAA(
char *dna);
718 int TrueSeqLen(
char *sequence);
719 int KnownSeqLen(
char *sequence);
720 BOOL NumericReadMDM(
char *mdmfile);
721 int NumericCalcMDMScore(
int resa,
int resb);
722 int NumericAffineAlign(
int *seq1,
int length1,
int *seq2,
int length2,
723 BOOL verbose,
BOOL identity,
int penalty,
724 int penext,
int *align1,
int *align2,
726 void SetMDMScoreWeight(
char resa,
char resb,
REAL weight);
733 # ifdef _EIGEN_H_DEPRECATED
734 # undef _EIGEN_H_DEPRECATED
736 int eigen(
REAL **M,
REAL **Vectors,
REAL *lambda,
int n);
742 # ifdef _REGRESSION_H_DEPRECATED
743 # undef _REGRESSION_H_DEPRECATED
745 BOOL CalculateBestFitLine(
double **coordinates,
int numberOfPoints,
746 int numberOfDimensions,
double *centroid,
747 double *eigenVector);
748 void FindCentroid(
REAL **coordinates,
int numberOfPoints,
749 int numberOfDimensions,
REAL *centroid);
750 BOOL CalculateCovarianceMatrix(
REAL **
x,
int numX,
int numY,
REAL **cov);