Mac binaries
[jabaws.git] / website / archive / binaries / mac / src / muscle / outweights.cpp
diff --git a/website/archive/binaries/mac/src/muscle/outweights.cpp b/website/archive/binaries/mac/src/muscle/outweights.cpp
new file mode 100644 (file)
index 0000000..58f0a20
--- /dev/null
@@ -0,0 +1,17 @@
+#include "muscle.h"\r
+#include "msa.h"\r
+\r
+void OutWeights(const char *FileName, const MSA &msa)\r
+       {\r
+       FILE *f = fopen(FileName, "w");\r
+       if (0 == f)\r
+               Quit("Cannot open '%s'", FileName);\r
+       const unsigned uSeqCount = msa.GetSeqCount();\r
+       for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)\r
+               {\r
+               const char *Id = msa.GetSeqName(uSeqIndex);\r
+               const WEIGHT w = msa.GetSeqWeight(uSeqIndex);\r
+               fprintf(f, "%s\t%.3g\n", Id, w);\r
+               }\r
+       fclose(f);\r
+       }\r