1 /* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 /*********************************************************************
4 * Clustal Omega - Multiple sequence alignment
6 * Copyright (C) 2010 University College Dublin
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.
13 * This file is part of Clustal-Omega.
15 ********************************************************************/
18 * RCS $Id: clustalo-api-test.c 280 2013-05-16 16:04:12Z fabian $
24 /* see clustal-omega.c for documentation */
26 /* Include clustal-omega's header. That's all you need
28 * If you developing in C++, use the following instead:
30 * #include "clustal-omega.h"
33 #include "clustal-omega.h"
37 main(int argc, char **argv)
39 /* the multiple sequence structure */
40 mseq_t *prMSeq = NULL;
41 /* for openmp: number of threads to use */
43 /* alignment options to use */
50 /* Must happen first: setup logger */
51 LogDefaultSetup(&rLog);
53 SetDefaultAlnOpts(&rAlnOpts);
55 InitClustalOmega(iThreads);
57 /* Get sequence input file name from command line
60 Log(&rLog, LOG_FATAL, "Need sequence file as argument");
62 pcSeqInfile = argv[1];
67 if (ReadSequences(prMSeq, pcSeqInfile,
70 Log(&rLog, LOG_FATAL, "Reading sequence file '%s' failed", pcSeqInfile);
73 /* Dump some info about the sequences
75 for (iAux=0; iAux<prMSeq->nseqs; iAux++) {
77 "Sequence no %d has the following name: %s",
78 iAux, prMSeq->sqinfo[iAux].name);
80 "Sequence no %d has the following residues: %s",
81 iAux, prMSeq->seq[iAux]);
82 /* more info can be found in prMSeq->sqinfo[iAux] */
86 /* Align the sequences without a profile (NULL)
88 if (Align(prMSeq, NULL, &rAlnOpts)) {
89 Log(&rLog, LOG_FATAL, "A fatal error happended during the alignment process");
93 /* Output of final alignment to stdout (NULL) as aligned fasta/a2m
96 if (WriteAlignment(prMSeq, NULL, MSAFILE_A2M, LINE_WRAP)) {
97 Log(&rLog, LOG_FATAL, "Could not save alignment");
102 Log(&rLog, LOG_INFO, "Successfull program exit");
106 /*** end of main() ***/