File: outweights.cpp

package info (click to toggle)
libmuscle 3.7%2B4565-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,828 kB
  • ctags: 2,200
  • sloc: cpp: 27,959; makefile: 55; sh: 26
file content (20 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "libMUSCLE/muscle.h"
#include "libMUSCLE/msa.h"

namespace muscle {

void OutWeights(const char *FileName, const MSA &msa)
	{
	FILE *f = fopen(FileName, "w");
	if (0 == f)
		Quit("Cannot open '%s'", FileName);
	const unsigned uSeqCount = msa.GetSeqCount();
	for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)
		{
		const char *Id = msa.GetSeqName(uSeqIndex);
		const WEIGHT w = msa.GetSeqWeight(uSeqIndex);
		fprintf(f, "%s\t%.3g\n", Id, w);
		}
	fclose(f);
	}
}