File: outweights.cpp

package info (click to toggle)
muscle 3.70%2Bfix1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,424 kB
  • ctags: 2,116
  • sloc: cpp: 26,897; xml: 230; makefile: 25
file content (17 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "muscle.h"
#include "msa.h"

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);
	}