********************************************************************/
/*
- * RCS $Id: clustalo-api-test.c 213 2011-03-11 16:10:15Z andreas $
+ * RCS $Id: clustalo-api-test.c 280 2013-05-16 16:04:12Z fabian $
*/
#include <stdio.h>
+/* see clustal-omega.c for documentation */
+
/* Include clustal-omega's header. That's all you need
*
* If you developing in C++, use the following instead:
char *pcSeqInfile;
int iAux;
- /* use LOGLEVEL_QUIET to make Clustal shut up */
- iVerbosityLevel = LOGLEVEL_INFO;
+
+ /* Must happen first: setup logger */
+ LogDefaultSetup(&rLog);
SetDefaultAlnOpts(&rAlnOpts);
/* Get sequence input file name from command line
*/
if (argc!=2) {
- Fatal("Need sequence file as argument");
+ Log(&rLog, LOG_FATAL, "Need sequence file as argument");
}
pcSeqInfile = argv[1];
if (ReadSequences(prMSeq, pcSeqInfile,
SEQTYPE_UNKNOWN,
INT_MAX, INT_MAX)) {
- Fatal("Reading sequence file '%s' failed", pcSeqInfile);
+ Log(&rLog, LOG_FATAL, "Reading sequence file '%s' failed", pcSeqInfile);
}
/* Dump some info about the sequences
*/
for (iAux=0; iAux<prMSeq->nseqs; iAux++) {
- Info(LOGLEVEL_INFO,
+ Log(&rLog, LOG_INFO,
"Sequence no %d has the following name: %s",
iAux, prMSeq->sqinfo[iAux].name);
- Info(LOGLEVEL_INFO,
+ Log(&rLog, LOG_INFO,
"Sequence no %d has the following residues: %s",
iAux, prMSeq->seq[iAux]);
/* more info can be found in prMSeq->sqinfo[iAux] */
/* Align the sequences without a profile (NULL)
*/
- if (Align(prMSeq, NULL, & rAlnOpts)) {
- Fatal("A fatal error happended during the alignment process");
+ if (Align(prMSeq, NULL, &rAlnOpts)) {
+ Log(&rLog, LOG_FATAL, "A fatal error happended during the alignment process");
}
/* Output of final alignment to stdout (NULL) as aligned fasta/a2m
*/
- if (WriteAlignment(prMSeq, NULL, MSAFILE_A2M)) {
- Fatal("Could not save alignment");
+#define LINE_WRAP 60
+ if (WriteAlignment(prMSeq, NULL, MSAFILE_A2M, LINE_WRAP)) {
+ Log(&rLog, LOG_FATAL, "Could not save alignment");
}
FreeMSeq(&prMSeq);
- Info(LOGLEVEL_INFO, "Successfull program exit");
+ Log(&rLog, LOG_INFO, "Successfull program exit");
return EXIT_SUCCESS;
}