JWS-112 Bumping version of ClustalO (src, binaries and windows) to version 1.2.4.
[jabaws.git] / binaries / src / clustalo / src / clustal-omega.h
1 /* -*- mode: c; tab-width: 4; c-basic-offset: 4;  indent-tabs-mode: nil -*- */
2
3 /*********************************************************************
4  * Clustal Omega - Multiple sequence alignment
5  *
6  * Copyright (C) 2010 University College Dublin
7  *
8  * Clustal-Omega is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This file is part of Clustal-Omega.
14  *
15  ********************************************************************/
16
17 /*
18  *  RCS $Id: clustal-omega.h 212 2011-03-10 15:09:46Z andreas $
19  */
20
21 #ifndef CLUSTALO_H
22 #define CLUSTALO_H
23
24
25
26 #ifdef HAVE_OPENMP
27 #include <omp.h>
28 #endif
29 #include <stdbool.h>
30
31 #include "clustal-omega-config.h"
32
33 /* the following needs to be kept in sync with library_include_HEADERS of all
34  * subdir Makefile.am's 
35  */
36
37 /* hhalign */
38 #include "hhalign/general.h"
39 #include "hhalign/hhfunc.h"
40
41
42 /* clustal */
43 #include "clustal/log.h"
44 #include "clustal/util.h"
45 #include "clustal/symmatrix.h"
46 #include "clustal/tree.h"
47 #include "clustal/seq.h"
48 #include "clustal/mbed.h"
49 #include "clustal/weights.h"
50 #include "clustal/pair_dist.h"
51 #include "clustal/hhalign_wrapper.h"
52
53
54
55 #define CLUSTERING_UNKNOWN 0
56 #define CLUSTERING_UPGMA 1
57
58 /* weights will be computed if 1. but are not really used for now and they
59  * might slow things down. also, mbed's screws up branch lengths which will
60  * have a negative effect on weights 
61 */
62 #define USE_WEIGHTS 0
63
64 extern int iNumberOfThreads;
65
66 /* output order */
67 enum {INPUT_ORDER = 0, TREE_ORDER};
68
69
70 /** user/commandline options
71  *
72  * changes here will have to be reflected in ParseCommandLine()
73  * and during setup of the default opts
74  *
75  */
76 typedef struct {
77     /* auto: Clustal (know what) is good for you
78      */
79     bool bAutoOptions;
80
81     /* Distance matrix
82      */
83     /** distance matrix input file */
84     char *pcDistmatInfile;
85     /** distance matrix output file */
86     char *pcDistmatOutfile;
87     
88     /* Clustering / guide-tree
89      */
90     /** clustering type (from cmdline arg) */
91     int iClusteringType;
92     /** number of sequences in cluster */
93     int iClustersizes; 
94     /** file with clustering information */
95     char *pcClustfile; 
96     /** use transitivity */
97     int iTransitivity; 
98     /** file with posterior probability information */
99     char *pcPosteriorfile; 
100     /** pairwise distance method */
101     int iPairDistType;
102     /** use mbed-like clustering */
103     bool bUseMbed;
104     /** use mbed-like clustering also during iteration */
105     bool bUseMbedForIteration;
106     /** pile-up flag */
107     bool bPileup;
108     /** guidetree output file */
109     char *pcGuidetreeOutfile;
110     /** guidetree input file */
111     char *pcGuidetreeInfile;
112     /** use Kimura corrected distance */
113     bool bUseKimura;
114     /** print percentage identity */
115     bool bPercID;
116
117     /* HMMs
118      */
119     /** HMM input files. index range: 0..iHMMInputFiles */
120     char **ppcHMMInput;
121     /** number of provided HMM input files. not really a user
122        option but need for ppcHMMInput */
123     int iHMMInputFiles;
124     /** HMM batch-file, specify HMMs for individual sequences. FS, r291 -> */
125     char *pcHMMBatch;
126
127     /* Iteration
128      */
129     /** number of iterations */
130     int iNumIterations;
131     /** determine number of iterations automatically */
132         bool bIterationsAuto;
133     /** maximum number of hmm iterations */
134     int iMaxHMMIterations;
135     /** max number of guidetree iterations */
136         int iMaxGuidetreeIterations;
137     
138     hhalign_para rHhalignPara;
139
140     /* changes here will have to be reflected in FreeAlnOpts(),
141          * SetDefaultAlnOpts(), AlnOptsLogicCheck() etc 
142          */
143 } opts_t;
144
145
146
147 extern void 
148 PrintLongVersion(char *pcStr, int iSize);
149
150 extern void
151 SetDefaultAlnOpts(opts_t *opts);
152
153 extern void
154 FreeAlnOpts(opts_t *aln_opts);
155
156 extern void
157 AlnOptsLogicCheck(opts_t *opts);
158
159 extern void
160 PrintAlnOpts(FILE *prFile, opts_t *opts);
161
162 extern void
163 InitClustalOmega(int iNumThreadsToUse);
164
165 extern void
166 SequentialAlignmentOrder(int **piOrderLR_p, int iNumSeq);
167
168 extern int
169 AlignmentOrder(int **piOrderLR_p, double **pdSeqWeights_p, mseq_t *prMSeq,
170                int iPairDistType, char *pcDistmatInfile, char *pcDistmatOutfile,
171                int iClusteringType, int iClustersizes,
172                char *pcGuidetreeInfile, char *pcGuidetreeOutfile, char *pcClusterFile,
173                bool bUseMBed, bool bPercID);
174
175 extern int
176 Align(mseq_t *prMSeq, 
177       mseq_t *prMSeqProfile,
178           opts_t *prOpts);
179
180 extern int
181 AlignProfiles(mseq_t *prMSeqProfile1, 
182                           mseq_t *prMSeqProfile2, hhalign_para rHhalignPara);
183
184 #endif
185 extern int
186 ReadPseudoCountParams(hhalign_para *rHhalignPara_p, char *pcPseudoFile);