funcs.h

来自「这是一个基于HMM 模型的生物多序列比对算法的linux实现版本。hmmer」· C头文件 代码 · 共 363 行 · 第 1/2 页

H
363
字号
/************************************************************ * HMMER - Biological sequence analysis with profile HMMs * Copyright (C) 1992-2003 Washington University School of Medicine * All Rights Reserved *  *     This source code is distributed under the terms of the *     GNU General Public License. See the files COPYING and LICENSE *     for details. ************************************************************//* funcs.h  * RCS $Id: funcs.h,v 1.37 2003/10/02 16:39:41 eddy Exp $ * * Declarations of external functions in HMMER. */            #ifndef FUNCSH_INCLUDED#define FUNCSH_INCLUDED#include "config.h"#include "structs.h"#include "squid.h"#include "msa.h"/* alphabet.c * Configuration of global alphabet information */extern void           DetermineAlphabet(char **rseqs, int  nseq);extern void           SetAlphabet(int type);extern unsigned char  SymbolIndex(char sym);extern unsigned char *DigitizeSequence(char *seq, int L);extern char          *DedigitizeSequence(unsigned char *dsq, int L);extern void           DigitizeAlignment(MSA *msa, unsigned char ***ret_dsqs);extern void           P7CountSymbol(float *counters, unsigned char sym, float wt);extern void           DefaultGeneticCode(int *aacode);extern void           DefaultCodonBias(float *codebias);/* from core_algorithms.c * Clean research/demonstration versions of basic algorithms. */extern struct dpmatrix_s *CreatePlan7Matrix(int N, int M, int padN, int padM);extern void   ResizePlan7Matrix(struct dpmatrix_s *mx, int N, int M, 				int ***xmx, int ***mmx, int ***imx, int ***dmx);struct dpmatrix_s *AllocPlan7Matrix(int rows, int M, 				    int ***xmx, int ***mmx, int ***imx, int ***dmx);extern struct dpshadow_s *AllocShadowMatrix(int rows, int M, char ***xtb, 					    char ***mtb, char ***itb, char ***dtb);extern void  FreePlan7Matrix(struct dpmatrix_s *mx);extern void  FreeShadowMatrix(struct dpshadow_s *tb);extern int   P7ViterbiSpaceOK(int L, int M, struct dpmatrix_s *mx);extern int   P7ViterbiSize(int L, int M);extern int   P7SmallViterbiSize(int L, int M);extern int   P7WeeViterbiSize(int L, int M);extern float P7Forward(unsigned char *dsq, int L, struct plan7_s *hmm, 			  struct dpmatrix_s **ret_mx);extern float P7Viterbi(unsigned char *dsq, int L, struct plan7_s *hmm, struct dpmatrix_s *mx,			  struct p7trace_s **ret_tr);extern void  P7ViterbiTrace(struct plan7_s *hmm, unsigned char *dsq, int L,			   struct dpmatrix_s *mx, struct p7trace_s **ret_tr);extern float P7SmallViterbi(unsigned char *dsq, int L, struct plan7_s *hmm, 			    struct dpmatrix_s *mx, struct p7trace_s **ret_tr);extern float P7ParsingViterbi(unsigned char *dsq, int L, struct plan7_s *hmm, 			      struct p7trace_s **ret_tr);extern float P7WeeViterbi(unsigned char *dsq, int L, struct plan7_s *hmm, 			  struct p7trace_s **ret_tr);extern float Plan7ESTViterbi(unsigned char *dsq, int L, struct plan7_s *hmm, 			     struct dpmatrix_s **ret_mx);extern struct p7trace_s *P7ViterbiAlignAlignment(MSA *msa, struct plan7_s *hmm);extern struct p7trace_s *ShadowTrace(struct dpshadow_s *tb, struct plan7_s *hmm, int L);extern float  PostprocessSignificantHit(struct tophit_s *ghit, struct tophit_s *dhit,					struct p7trace_s   *tr, struct plan7_s *hmm, unsigned char *dsq, 					int L, char *seqname, char *seqacc, char *seqdesc, 					int do_forward, float sc_override, int do_null2,					struct threshold_s *thresh, int hmmpfam_mode);/* from debug.c * Debugging output of various sorts. */extern char *Statetype(char st);extern char *AlphabetType2String(int type);extern void P7PrintTrace(FILE *fp, struct p7trace_s *tr, 			 struct plan7_s *hmm, unsigned char *dsq);extern void P7PrintPrior(FILE *fp, struct p7prior_s *pri);extern int  TraceCompare(struct p7trace_s *t1, struct p7trace_s *t2);extern int  TraceVerify(struct p7trace_s *tr, int M, int N);/*  * from display.c * Ian Holmes' functions for displaying HMMER2 data structures, especially * for posterior probabilities in alignments. */extern void DisplayPlan7Matrix(unsigned char *dsq, int L, struct plan7_s *hmm,			       struct dpmatrix_s *mx);extern void DisplayPlan7Posteriors(int L, struct plan7_s *hmm,				   struct dpmatrix_s *forward, struct dpmatrix_s *backward,				   struct p7trace_s *viterbi, struct p7trace_s *optacc);extern void DisplayPlan7PostAlign(int L, struct plan7_s *hmm,				  struct dpmatrix_s *forward, struct dpmatrix_s *backward,				  struct p7trace_s **alignment, int A);/* from emit.c * Generation of sequences/traces from an HMM */extern void EmitSequence(struct plan7_s *hmm, unsigned char **ret_dsq, int *ret_L, 			 struct p7trace_s **ret_tr);extern void EmitConsensusSequence(struct plan7_s *hmm, char **ret_seq, unsigned char **ret_dsq,				  int *ret_L, struct p7trace_s **ret_tr);extern void StateOccupancy(struct plan7_s *hmm, float **ret_mp, float **ret_ip, float **ret_dp);/* from emulation.c * Interfaces between HMMER and other software packages */extern void WriteProfile(FILE *fp, struct plan7_s *hmm, int do_xsw);/* from histogram.c * accumulation of scores */extern struct histogram_s *AllocHistogram(int min, int max, int lumpsize);extern void FreeHistogram(struct histogram_s *h);extern void UnfitHistogram(struct histogram_s *h);extern void AddToHistogram(struct histogram_s *h, float sc);extern void PrintASCIIHistogram(FILE *fp, struct histogram_s *h); extern void PrintXMGRHistogram(FILE *fp, struct histogram_s *h);extern void PrintXMGRDistribution(FILE *fp, struct histogram_s *h);extern void PrintXMGRRegressionLine(FILE *fp, struct histogram_s *h);extern void EVDBasicFit(struct histogram_s *h);extern int  ExtremeValueFitHistogram(struct histogram_s *h, int censor,				     float high_hint);extern void ExtremeValueSetHistogram(struct histogram_s *h, float mu, float lambda, 				     float low, float high, int ndegrees);extern int  GaussianFitHistogram(struct histogram_s *h, float high_hint);extern void GaussianSetHistogram(struct histogram_s *h, float mean, float sd);extern double EVDDensity(float x, float mu, float lambda);extern double EVDDistribution(float x, float mu, float lambda);extern double ExtremeValueP (float x, float mu, float lambda);extern double ExtremeValueP2(float x, float mu, float lambda, int N);extern double ExtremeValueE (float x, float mu, float lambda, int N);extern float  EVDrandom(float mu, float lambda);extern int    EVDMaxLikelyFit(float *x, int *y, int n, 			      float *ret_mu, float *ret_lambda);extern int    EVDCensoredFit(float *x, int *y, int n, int z, float c, 			     float *ret_mu, float *ret_lambda);extern void   Lawless416(float *x, int *y, int n, float lambda, 			 float *ret_f, float *ret_df);extern void   Lawless422(float *x, int *y, int n, int z, float c,			 float lambda, float *ret_f, float *ret_df);/* from hmmio.c * Input/output (saving/reading) of models */extern HMMFILE *HMMFileOpen(char *hmmfile, char *env);extern int      HMMFileRead(HMMFILE *hmmfp, struct plan7_s **ret_hmm);extern void     HMMFileClose(HMMFILE *hmmfp);extern int      HMMFileFormat(HMMFILE *hmmfp);extern void     HMMFileRewind(HMMFILE *hmmfp);extern int      HMMFilePositionByName(HMMFILE *hmmfp, char *name);extern int      HMMFilePositionByIndex(HMMFILE *hmmfp, int idx);extern void     WriteAscHMM(FILE *fp, struct plan7_s *hmm);extern void     WriteBinHMM(FILE *fp, struct plan7_s *hmm);/* masks.c * Repetitive sequence masking. */extern int   XNU(unsigned char *dsq, int len);extern float TraceScoreCorrection(struct plan7_s *hmm, struct p7trace_s *tr, unsigned char *dsq);/* mathsupport.c * Much of this code deals with Dirichlet prior mathematics.  */extern int   Prob2Score(float p, float null);extern float Score2Prob(int sc, float null);extern float Scorify(int sc);extern double PValue(struct plan7_s *hmm, float sc);extern float LogSum(float p1, float p2);extern int   ILogsum(int p1, int p2);extern void  LogNorm(float *vec, int n);extern float Logp_cvec(float *cvec, int n, float *alpha);extern void  SampleDirichlet(float *alpha, int n, float *p);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?