From c308d88b6dabc9e75057ce5d5707238ecc2fc477 Mon Sep 17 00:00:00 2001 From: Frederic Lemoine Date: Mon, 3 Jul 2017 13:51:56 +0200 Subject: [PATCH] Added comments and doc --- align/align.go | 4 ++++ cmd/stats.go | 7 +++++-- docs/commands/stats.md | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/align/align.go b/align/align.go index 86cce7b..aa4d49f 100644 --- a/align/align.go +++ b/align/align.go @@ -954,6 +954,10 @@ func (a *align) Concat(c Alignment) (err error) { return err } +/* + Returns the number of variable sites in the alignment. +It does not take into account gaps and other charactes like "." +*/ func (a *align) NbVariableSites() int { nbinfo := 0 for site := 0; site < a.Length(); site++ { diff --git a/cmd/stats.go b/cmd/stats.go index dfecd8b..5d816b4 100644 --- a/cmd/stats.go +++ b/cmd/stats.go @@ -14,8 +14,11 @@ var statsCmd = &cobra.Command{ Short: "Prints different characteristics of the alignment", Long: `Prints different characteristics of the alignment. -1 - Length -2 - Number of sequences +1. Length of alignment; +2. Number of sequences; +3. Average number of alleles per site; +4. Number of variables sites (does ot take into account gaps or special characters); +5. Character frequencies. If the input alignment contains several alignments, will process all of them diff --git a/docs/commands/stats.md b/docs/commands/stats.md index 904f616..4a69bd7 100644 --- a/docs/commands/stats.md +++ b/docs/commands/stats.md @@ -8,7 +8,8 @@ Without any subcommand, it prints the following information: 1. Length of alignment; 2. Number of sequences; 3. Average number of alleles per site; -4. Character frequencies. +4. Number of variables sites (does ot take into account gaps or special characters); +5. Character frequencies. Different sub-commands: * `goalign stats alleles`: Prints the average number of alleles per site of the alignment;