Introduction
For more information see http://www.clustal.org/
API
An Example Program
To use libclustalo you will have to include the clustal-omega.h header and link against libclustalo. For linking against libclustalo you will have to use a C++ compiler, no matter if your program was written in C or C++. See below (Using pkg-config / Figuring out compiler flags)) on how to figure out compiler flags with pkg-config.
Assuming Clustal Omega was installed in system-wide default directory (e.g. /usr), first compile (don't link yet) your source (for example code see section Example Source Code) and then link against libclustalo:
$ gcc -c -ansi -Wall clustalo-api-test.c
$ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o -lclustalo
Voila! Now you have your own alignment program based on Clustal Omega which can be run with
$ ./clustalo-api-test <your-sequence-input>
It's best to use the same compiler that you used for compiling libclustal. If libclustal was compiled with OpenMP support, you will have to use OpenMP flags for you program as well.
Using pkg-config / Figuring out compiler flags
Clustal Omega comes with support for pkg-config, which means you can run
$ pkg-config --cflags --libs clustalo
to figure out cflags and library flags needed to compile and link against libclustalo. This is especially handy if Clustal Omega was installed to a non-standard directory.
You might have to change PKG_CONFIG_PATH. For example, if you used the prefix $HOME/local/ for installation then you will first need to set PKG_CONFIG_PATH:
$ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig
$ pkg-config --cflags --libs clustalo
To compile your source use as above but this time using proper flags:
$ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig
$ gcc -c -ansi -Wall $(pkg-config --cflags clustalo) clustalo-api-test.c
$ g++ -ansi -Wall -o clustalo-api-test $(pkg-config --libs clustalo) clustalo-api-test.o
Example Source Code
#include <stdio.h>
int
main(int argc, char **argv)
{
int iThreads = 1;
char *pcSeqInfile;
int iAux;
if (argc!=2) {
}
pcSeqInfile = argv[1];
INT_MAX, INT_MAX)) {
}
for (iAux=0; iAux<prMSeq->
nseqs; iAux++) {
"Sequence no %d has the following name: %s",
iAux, prMSeq->
sqinfo[iAux].name);
"Sequence no %d has the following residues: %s",
iAux, prMSeq->
seq[iAux]);
}
if (
Align(prMSeq, NULL, &rAlnOpts)) {
}
#define LINE_WRAP 60
}
return EXIT_SUCCESS;
}
void SetDefaultAlnOpts(opts_t *opts)
Sets members of given user opts struct to default values.
Definition clustal-omega.c:189
int Align(mseq_t *prMSeq, mseq_t *prMSeqProfile, opts_t *prOpts)
The main alignment function which wraps everything else.
Definition clustal-omega.c:960
void InitClustalOmega(int iNumThreadsToUse)
FIXME.
Definition clustal-omega.c:622
log_t rLog
Definition log.c:34
void Log(log_t *prLog, int iLevel, char *pcFmt,...)
Log to certain level.
Definition log.c:186
void LogDefaultSetup(log_t *log)
Sets up default function pointers.
Definition log.c:152
#define LOG_FATAL
Definition log.h:36
#define LOG_INFO
Definition log.h:31
int WriteAlignment(mseq_t *mseq, const char *pcAlnOutfile, int outfmt, int iWrap, bool bResno)
Write alignment to file.
Definition seq.c:884
int ReadSequences(mseq_t *prMSeq, char *seqfile, int iSeqType, int iSeqFmt, bool bIsProfile, bool bDealignInputSeqs, int iMaxNumSeq, int iMaxSeqLen, char *pcHMMBatch)
reads sequences from file
Definition seq.c:420
void NewMSeq(mseq_t **prMSeq)
allocate and initialise new mseq_t
Definition seq.c:714
void FreeMSeq(mseq_t **mseq)
Frees an mseq_t and it's members and zeros all members.
Definition seq.c:817
#define SEQTYPE_UNKNOWN
Definition seq.h:32
structure for storing multiple sequences
Definition seq.h:47
int nseqs
Definition seq.h:48
char ** seq
Definition seq.h:57
SQINFO * sqinfo
Squid's sequence info structure. Index range: 0–nseq-1.
Definition seq.h:113
Definition clustal-omega.h:76