3 * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
16 /** Log simple statistics about input and output
19 * FIXME: please add license text
21 * @section DESCRIPTION
22 * The hashing functions have to be enabled at compile/configure time
23 * otherwise they will not be used.
37 /** set the name of the file where stats are logged to
40 void setStatsFile(string f) {logfilename=f;};
43 * return name of used stats file
46 string getStatsFile() {return logfilename;};
48 /** enable stats logging
50 void setEnabled(bool b) {enabled=b;};
52 /** check if stats logging is enabled
53 * @return true if enabled, false otherwise
55 bool isEnabled() {return enabled;};
57 /** log the command line arguments
58 * @param argc number arguments
59 * @param argv argument array
61 void logCmdLine(int argc, char **argv);
63 /** log statistics about sequence input
64 * @param alnObj: input "alignment" (confusing isn't it?)
66 void logInputSeqStats(Alignment *alnObj);
68 /** log statistics about sequence input
69 * @param alnObj: input "alignment" (confusing isn't it?)
71 void logAlignedSeqStats(Alignment *alnObj);
82 /** Compute pairwise identity of two sequences
84 * Adopted from Sean Eddy'ssquid:aligneval.c
85 * He defines pairwise identity as fraction:
86 * idents / min(len1, len2)
88 * Function is case sensitive!
90 * @param alnObj alignment object
91 * @param s1 index of first sequence
92 * @param s2 index of first sequence
93 * @return pairwise identity as float
95 float pairwiseIdentity(Alignment *alnObj, int s1, int s2);
99 /** compute md5 hash from string
100 * @param thread string to hash
101 * @return hash string, or NULL on failure
103 char * Md5Hash(const char *thread);
105 /** compute md5 hash for a sequence
106 * @param alnObj alignment object
107 * @param s index of sequence
108 * @return md5 hash string
110 string Md5ForSeq(Alignment *alnObj, int s);
112 /** compute md5 hash for all sequences
113 * sorts and concatenates all sequences beforehand
114 * thus sequence order doesn't matter
116 * @param alnObj alignment object
117 * @param s index of sequence
118 * @return md5 hash string
120 string ConcatInputHash(Alignment *alnObj);
125 /** the filename used for logging statistics */
127 /** logging of statistics enabled */