| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#include <esl_config.h> |
| 8 |
#include "config.h" |
| 9 |
|
| 10 |
#include <stdio.h> |
| 11 |
#include <stdlib.h> |
| 12 |
#include <string.h> |
| 13 |
#include <time.h> |
| 14 |
|
| 15 |
#include "easel.h" |
| 16 |
#include "esl_exponential.h" |
| 17 |
#include "esl_getopts.h" |
| 18 |
#include "esl_histogram.h" |
| 19 |
#include "esl_random.h" |
| 20 |
#include "esl_randomseq.h" |
| 21 |
#include "esl_sqio.h" |
| 22 |
#include "esl_stats.h" |
| 23 |
#include "esl_vectorops.h" |
| 24 |
#include "esl_wuss.h" |
| 25 |
|
| 26 |
#include "hmmer.h" |
| 27 |
|
| 28 |
#include "infernal.h" |
| 29 |
|
| 30 |
#define OUTOPTS "-E,-P,-T,--cut_ga,--cut_nc,--cut_tc" |
| 31 |
|
| 32 |
#define OUTMODE_DEFAULT 0 |
| 33 |
#define OUTMODE_BITSCORES_E 1 |
| 34 |
#define OUTMODE_BITSCORES_P 2 |
| 35 |
#define OUTMODE_EVALUES 3 |
| 36 |
#define OUTMODE_GA 4 |
| 37 |
#define OUTMODE_NC 5 |
| 38 |
#define OUTMODE_TC 6 |
| 39 |
#define NOUTMODES 7 |
| 40 |
|
| 41 |
static ESL_OPTIONS options[] = { |
| 42 |
|
| 43 |
{ "-h", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, NULL, "show brief help on version and usage", 0 }, |
| 44 |
{ "-E", eslARG_REAL, NULL, NULL, "x>0", NULL, NULL, OUTOPTS, "print bit scores that correspond to E-value threshold of <x>", 0 }, |
| 45 |
{ "-P", eslARG_REAL, NULL, NULL, "x>0", NULL, NULL, OUTOPTS, "print bit scores that correspond to E-value threshold of <x>", 0 }, |
| 46 |
{ "-T", eslARG_REAL, NULL, NULL, "x>0", NULL, NULL, OUTOPTS, "print E-values that correspond to bit score threshold of <x>", 0 }, |
| 47 |
{ "-Z", eslARG_REAL, "10", NULL, "x>0", NULL, NULL, NULL, "set database size in *Mb* to <x> for E-value calculations", 0 }, |
| 48 |
{ "--cut_ga", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, OUTOPTS, "print E-values that correspond to GA bit score thresholds", 0 }, |
| 49 |
{ "--cut_nc", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, OUTOPTS, "print E-values that correspond to NC bit score thresholds", 0 }, |
| 50 |
{ "--cut_tc", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, OUTOPTS, "print E-values that correspond to TC bit score thresholds", 0 }, |
| 51 |
{ "--key", eslARG_STRING, NULL, NULL, NULL, NULL, NULL, NULL, "only print statistics for CM with name or accession <s>", 0 }, |
| 52 |
{ "--hmmonly", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, NULL, "print filter HMM bit scores/E-values, not CM ones", 0 }, |
| 53 |
{ "--nohmmonly", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, "--nohmmonly", "print CM bit scores/E-values, even for models with 0 basepairs", 0 }, |
| 54 |
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 55 |
}; |
| 56 |
|
| 57 |
static char usage[] = "[-options] <cmfile>"; |
| 58 |
static char banner[] = "display summary statistics for CMs"; |
| 59 |
|
| 60 |
static void output_stats(ESL_GETOPTS *go, CM_t *cm, int ncm, P7_BG *bg, int output_mode); |
| 61 |
|
| 62 |
int |
| 63 |
main(int argc, char **argv) |
| 64 |
{ |
| 65 |
ESL_GETOPTS *go = NULL; |
| 66 |
|
| 67 |
ESL_ALPHABET *abc = NULL; |
| 68 |
char *cmfile; |
| 69 |
CM_FILE *cmfp; |
| 70 |
CM_t *cm; |
| 71 |
int ncm; |
| 72 |
char errbuf[eslERRBUFSIZE]; |
| 73 |
int status; |
| 74 |
int output_mode; |
| 75 |
char *key = NULL; |
| 76 |
P7_BG *bg = NULL; |
| 77 |
int do_hmmonly = FALSE; |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
go = esl_getopts_Create(options); |
| 82 |
if (esl_opt_ProcessCmdline(go, argc, argv) != eslOK || |
| 83 |
esl_opt_VerifyConfig(go) != eslOK) |
| 84 |
{ |
| 85 |
printf("Failed to parse command line: %s\n", go->errbuf); |
| 86 |
esl_usage(stdout, argv[0], usage); |
| 87 |
printf("\nTo see more help on available options, do %s -h\n\n", argv[0]); |
| 88 |
exit(1); |
| 89 |
} |
| 90 |
if (esl_opt_GetBoolean(go, "-h") == TRUE) |
| 91 |
{ |
| 92 |
cm_banner(stdout, argv[0], banner); |
| 93 |
esl_usage(stdout, argv[0], usage); |
| 94 |
puts("\nOptions:"); |
| 95 |
esl_opt_DisplayHelp(stdout, go, 0, 2, 80); |
| 96 |
exit(0); |
| 97 |
} |
| 98 |
if (esl_opt_ArgNumber(go) != 1) |
| 99 |
{ |
| 100 |
puts("Incorrect number of command line arguments."); |
| 101 |
esl_usage(stdout, argv[0], usage); |
| 102 |
printf("\nTo see more help on available options, do %s -h\n\n", argv[0]); |
| 103 |
exit(1); |
| 104 |
} |
| 105 |
|
| 106 |
if ((cmfile = esl_opt_GetArg(go, 1)) == NULL) |
| 107 |
{ |
| 108 |
puts("Failed to read <cmfile> argument from command line."); |
| 109 |
esl_usage(stdout, argv[0], usage); |
| 110 |
printf("\nTo see more help on available options, do %s -h\n\n", argv[0]); |
| 111 |
exit(1); |
| 112 |
} |
| 113 |
|
| 114 |
cm_banner(stdout, argv[0], banner); |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
status = cm_file_Open(cmfile, NULL, FALSE, &cmfp, errbuf); |
| 119 |
if (status == eslENOTFOUND) cm_Fail("File existence/permissions problem in trying to open CM file %s.\n%s\n", cmfile, errbuf); |
| 120 |
else if (status == eslEFORMAT) cm_Fail("File format problem in trying to open CM file %s.\n%s\n", cmfile, errbuf); |
| 121 |
else if (status != eslOK) cm_Fail("Unexpected error %d in opening CM file %s.\n%s\n", status, cmfile, errbuf); |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
output_mode = OUTMODE_DEFAULT; |
| 126 |
if (esl_opt_IsUsed(go, "-E")) { output_mode = OUTMODE_BITSCORES_E; } |
| 127 |
else if(esl_opt_IsUsed(go, "-P")) { output_mode = OUTMODE_BITSCORES_P; } |
| 128 |
else if(esl_opt_IsUsed(go, "-T")) { output_mode = OUTMODE_EVALUES; } |
| 129 |
else if(esl_opt_IsUsed(go, "--cut_ga")) { output_mode = OUTMODE_GA; } |
| 130 |
else if(esl_opt_IsUsed(go, "--cut_tc")) { output_mode = OUTMODE_TC; } |
| 131 |
else if(esl_opt_IsUsed(go, "--cut_nc")) { output_mode = OUTMODE_NC; } |
| 132 |
|
| 133 |
do_hmmonly = esl_opt_GetBoolean(go, "--hmmonly") ? TRUE : FALSE; |
| 134 |
|
| 135 |
if(output_mode == OUTMODE_DEFAULT) { |
| 136 |
fprintf(stdout, "# %-4s %-20s %-9s %8s %8s %5s %5s %4s %4s %5s %12s\n", "", "", "", "", "", "", "", "", "", "", "rel entropy"); |
| 137 |
fprintf(stdout, "# %-4s %-20s %-9s %8s %8s %5s %5s %4s %4s %5s %12s\n", "", "", "", "", "", "", "", "", "", "", "------------"); |
| 138 |
fprintf(stdout, "# %-4s %-20s %-9s %8s %8s %5s %5s %4s %4s %5s %5s %5s\n", "idx", "name", "accession", "nseq", "eff_nseq", "clen", "W", "bps", "bifs", "model", "cm", "hmm"); |
| 139 |
fprintf(stdout, "# %-4s %-20s %-9s %8s %8s %5s %5s %4s %4s %5s %5s %5s\n", "----", "--------------------", "---------", "--------", "--------", "-----", "-----", "----", "----", "-----", "-----", "-----"); |
| 140 |
} |
| 141 |
else { |
| 142 |
if(output_mode == OUTMODE_BITSCORES_E) { |
| 143 |
fprintf(stdout, "# Printing cmsearch bit scores corresponding to E-value of %g in a database of size %.6f Mb\n", esl_opt_GetReal(go, "-E"), esl_opt_GetReal(go, "-Z")); |
| 144 |
fprintf(stdout, "#\n"); |
| 145 |
if(do_hmmonly) fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-forward","local-viterbi", "glocal-forwrd", "glocal-vitrbi", "model"); |
| 146 |
else fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-inside", "local-cyk", "glocal-inside", "glocal-cyk", "model"); |
| 147 |
fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "----", "--------------------", "---------", "-------------", "-------------", "-------------", "-------------", "-----"); |
| 148 |
} |
| 149 |
else if(output_mode == OUTMODE_BITSCORES_P) { |
| 150 |
fprintf(stdout, "# Printing bit scores corresponding to P-value of %g\n", esl_opt_GetReal(go, "-P")); |
| 151 |
fprintf(stdout, "#\n"); |
| 152 |
if(do_hmmonly) fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-forward", "local-viterbi", "glocal-forwrd", "glocal-vitrbi", "model"); |
| 153 |
else fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-inside", "local-cyk", "glocal-inside", "glocal-cyk", "model"); |
| 154 |
fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "----", "--------------------", "---------", "-------------", "-------------", "-------------", "-------------", "-----"); |
| 155 |
} |
| 156 |
else if(output_mode == OUTMODE_EVALUES) { |
| 157 |
fprintf(stdout, "# Printing cmsearch E-values corresponding to a bit score of %.2f in a database of size %.6f Mb\n", esl_opt_GetReal(go, "-T"), esl_opt_GetReal(go, "-Z")); |
| 158 |
fprintf(stdout, "#\n"); |
| 159 |
if(do_hmmonly) fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-forward", "local-viterbi", "glocal-forwrd", "glocal-vitrbi", "model"); |
| 160 |
else fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "local-inside", "local-cyk", "glocal-inside", "glocal-cyk", "model"); |
| 161 |
fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %5s\n", "----", "--------------------", "---------", "-------------", "-------------", "-------------", "-------------", "-----"); |
| 162 |
} |
| 163 |
else { |
| 164 |
if(output_mode == OUTMODE_GA) { |
| 165 |
fprintf(stdout, "# Printing cmsearch E-values corresponding to GA bit score thresholds in a database of size %.6f Mb\n", esl_opt_GetReal(go, "-Z")); |
| 166 |
} |
| 167 |
else if(output_mode == OUTMODE_NC) { |
| 168 |
fprintf(stdout, "# Printing cmsearch E-values corresponding to NC bit score thresholds in a database of size %.6f Mb\n", esl_opt_GetReal(go, "-Z")); |
| 169 |
} |
| 170 |
else if(output_mode == OUTMODE_TC) { |
| 171 |
fprintf(stdout, "# Printing cmsearch E-values corresponding to TC bit score thresholds in a database of size %.6f Mb\n", esl_opt_GetReal(go, "-Z")); |
| 172 |
} |
| 173 |
fprintf(stdout, "#\n"); |
| 174 |
if(do_hmmonly) fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "bit-score", "local-forward", "local-viterbi", "glocal-forwrd", "glocal-vitrbi", "model"); |
| 175 |
else fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %13s %5s\n", "idx", "name", "accession", "bit-score", "local-inside", "local-cyk", "glocal-inside", "glocal-cyk", "model"); |
| 176 |
fprintf(stdout, "# %-4s %-20s %-9s %13s %13s %13s %13s %13s %5s\n", "----", "--------------------", "---------", "-------------", "-------------", "-------------", "-------------", "-------------", "-----"); |
| 177 |
} |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
if(! esl_opt_IsUsed(go, "--key")) { |
| 184 |
ncm = 0; |
| 185 |
while ((status = cm_file_Read(cmfp, TRUE, &abc, &cm)) != eslEOF) |
| 186 |
{ |
| 187 |
if (status == eslEOD) cm_Fail("read failed, CM file %s may be truncated?", cmfile); |
| 188 |
else if (status != eslOK) cm_Fail(cmfp->errbuf); |
| 189 |
ncm++; |
| 190 |
if (bg == NULL) bg = p7_bg_Create(abc); |
| 191 |
|
| 192 |
output_stats(go, cm, ncm, bg, output_mode); |
| 193 |
FreeCM(cm); |
| 194 |
} |
| 195 |
} |
| 196 |
else { |
| 197 |
key = esl_opt_GetString(go, "--key"); |
| 198 |
if(cmfp->ssi != NULL) { |
| 199 |
|
| 200 |
status = cm_file_PositionByKey(cmfp, key); |
| 201 |
if (status == eslENOTFOUND) cm_Fail("CM %s not found in SSI index for file %s\n", key, cmfile); |
| 202 |
else if (status == eslEFORMAT) cm_Fail("Failed to parse SSI index for %s\n", cmfile); |
| 203 |
else if (status != eslOK) cm_Fail("Failed to look up location of CM %s in SSI index of file %s\n", key, cmfile); |
| 204 |
} |
| 205 |
while ((status = cm_file_Read(cmfp, TRUE, &abc, &cm)) != eslEOF) |
| 206 |
{ |
| 207 |
|
| 208 |
if(cm == NULL) cm_Fail(cmfp->errbuf); |
| 209 |
if (strcmp(key, cm->name) == 0 || (cm->acc && strcmp(key, cm->acc) == 0)) break; |
| 210 |
FreeCM(cm); |
| 211 |
cm = NULL; |
| 212 |
} |
| 213 |
if(status == eslOK) { |
| 214 |
if (bg == NULL) bg = p7_bg_Create(abc); |
| 215 |
output_stats(go, cm, 1, bg, output_mode); |
| 216 |
FreeCM(cm); |
| 217 |
} |
| 218 |
else if (status != eslEOF) { |
| 219 |
cm_Fail(cmfp->errbuf); |
| 220 |
} |
| 221 |
else { |
| 222 |
cm_Fail("CM %s not found in file %s\n", key, cmfile); |
| 223 |
} |
| 224 |
} |
| 225 |
fprintf(stdout, "#\n"); |
| 226 |
p7_bg_Destroy(bg); |
| 227 |
esl_alphabet_Destroy(abc); |
| 228 |
cm_file_Close(cmfp); |
| 229 |
esl_getopts_Destroy(go); |
| 230 |
exit(0); |
| 231 |
} |
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
static void |
| 237 |
output_stats(ESL_GETOPTS *go, CM_t *cm, int ncm, P7_BG *bg, int output_mode) |
| 238 |
{ |
| 239 |
int status; |
| 240 |
char errbuf[eslERRBUFSIZE]; |
| 241 |
float lins; |
| 242 |
float lcyk; |
| 243 |
float gins; |
| 244 |
float gcyk; |
| 245 |
float lfwd; |
| 246 |
float lvit; |
| 247 |
float gfwd; |
| 248 |
double E; |
| 249 |
double P; |
| 250 |
float T; |
| 251 |
float Z; |
| 252 |
int use_cm; |
| 253 |
|
| 254 |
Z = esl_opt_GetReal(go, "-Z") * 1000000.; |
| 255 |
|
| 256 |
if (esl_opt_GetBoolean(go, "--nohmmonly")) use_cm = TRUE; |
| 257 |
else if (esl_opt_GetBoolean(go, "--hmmonly")) use_cm = FALSE; |
| 258 |
else use_cm = (CMCountNodetype(cm, MATP_nd) > 0) ? TRUE : FALSE; |
| 259 |
|
| 260 |
if(output_mode != OUTMODE_DEFAULT) { |
| 261 |
if(use_cm && (! (cm->flags & CMH_EXPTAIL_STATS))) { |
| 262 |
if(esl_opt_IsUsed(go, "-E")) cm_Fail("-E requires E-value statistics (from cmcalibrate), model number %d has none.", ncm); |
| 263 |
if(esl_opt_IsUsed(go, "-T")) cm_Fail("-T requires E-value statistics (from cmcalibrate), model number %d has none.", ncm); |
| 264 |
if(esl_opt_IsUsed(go, "--cut_ga")) cm_Fail("--cut_ga requires E-value statistics (from cmcalibrate), model number %d has none.", ncm); |
| 265 |
if(esl_opt_IsUsed(go, "--cut_tc")) cm_Fail("--cut_tc requires E-value statistics (from cmcalibrate), model number %d has none.", ncm); |
| 266 |
if(esl_opt_IsUsed(go, "--cut_nc")) cm_Fail("--cut_nc requires E-value statistics (from cmcalibrate), model number %d has none.", ncm); |
| 267 |
} |
| 268 |
} |
| 269 |
|
| 270 |
if(output_mode == OUTMODE_DEFAULT) { |
| 271 |
|
| 272 |
if(use_cm) { |
| 273 |
|
| 274 |
if((status = build_cp9_hmm(cm, errbuf, FALSE, 0.0001, 0, &(cm->cp9), &(cm->cp9map))) != eslOK) cm_Fail(errbuf); |
| 275 |
} |
| 276 |
|
| 277 |
fprintf(stdout, "%6d %-20s %-9s %8d %8.2f %5d %5d %4d %4d %5s", |
| 278 |
ncm, |
| 279 |
cm->name, |
| 280 |
cm->acc == NULL ? "-" : cm->acc, |
| 281 |
cm->nseq, |
| 282 |
(use_cm) ? cm->eff_nseq : cm->fp7->eff_nseq, |
| 283 |
cm->clen, |
| 284 |
cm->W, |
| 285 |
(use_cm) ? CMCountStatetype(cm, MP_st) : 0, |
| 286 |
(use_cm) ? CMCountStatetype(cm, B_st) : 0, |
| 287 |
(use_cm) ? "cm" : "hmm"); |
| 288 |
if(use_cm) { |
| 289 |
fprintf(stdout, " %5.3f %5.3f\n", cm_MeanMatchRelativeEntropy(cm), cp9_MeanMatchRelativeEntropy(cm->cp9)); |
| 290 |
} |
| 291 |
else { |
| 292 |
fprintf(stdout, " %5s %5.3f\n", "-", p7_MeanMatchRelativeEntropy(cm->fp7, bg)); |
| 293 |
} |
| 294 |
} |
| 295 |
else if(output_mode == OUTMODE_BITSCORES_E) { |
| 296 |
E = esl_opt_GetReal(go, "-E"); |
| 297 |
if(use_cm) { |
| 298 |
if((status = UpdateExpsForDBSize(cm, errbuf, Z)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 299 |
if((status = E2ScoreGivenExpInfo(cm->expA[EXP_CM_LI], errbuf, E, &lins)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 300 |
if((status = E2ScoreGivenExpInfo(cm->expA[EXP_CM_LC], errbuf, E, &lcyk)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 301 |
if((status = E2ScoreGivenExpInfo(cm->expA[EXP_CM_GI], errbuf, E, &gins)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 302 |
if((status = E2ScoreGivenExpInfo(cm->expA[EXP_CM_GC], errbuf, E, &gcyk)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 303 |
} |
| 304 |
else { |
| 305 |
lfwd = cm_p7_E2Score(E, Z, cm->fp7->max_length, cm->fp7_evparam[CM_p7_LFTAU], cm->fp7_evparam[CM_p7_LFLAMBDA]); |
| 306 |
} |
| 307 |
fprintf(stdout, "%6d %-20s %-9s", |
| 308 |
ncm, |
| 309 |
cm->name, |
| 310 |
cm->acc == NULL ? "-" : cm->acc); |
| 311 |
if(use_cm) fprintf(stdout, " %13.2f %13.2f %13.2f %13.2f %5s\n", lins, lcyk, gins, gcyk, "cm"); |
| 312 |
else fprintf(stdout, " %13.2f %13s %13s %13s %5s\n", lfwd, "-", "-", "-", "hmm"); |
| 313 |
} |
| 314 |
else if(output_mode == OUTMODE_BITSCORES_P) { |
| 315 |
P = esl_opt_GetReal(go, "-P"); |
| 316 |
if(use_cm) { |
| 317 |
if((status = P2ScoreGivenExpInfo(cm->expA[EXP_CM_LI], errbuf, P, &lins)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 318 |
if((status = P2ScoreGivenExpInfo(cm->expA[EXP_CM_LC], errbuf, P, &lcyk)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 319 |
if((status = P2ScoreGivenExpInfo(cm->expA[EXP_CM_GI], errbuf, P, &gins)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 320 |
if((status = P2ScoreGivenExpInfo(cm->expA[EXP_CM_GC], errbuf, P, &gcyk)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 321 |
} |
| 322 |
else { |
| 323 |
lfwd = cm_p7_P2Score(P, cm->fp7_evparam[CM_p7_LFTAU], cm->fp7_evparam[CM_p7_LFLAMBDA]); |
| 324 |
lvit = cm_p7_P2Score(P, cm->fp7_evparam[CM_p7_LVMU], cm->fp7_evparam[CM_p7_LVLAMBDA]); |
| 325 |
gfwd = cm_p7_P2Score(P, cm->fp7_evparam[CM_p7_GFMU], cm->fp7_evparam[CM_p7_GFLAMBDA]); |
| 326 |
} |
| 327 |
fprintf(stdout, "%6d %-20s %-9s", |
| 328 |
ncm, |
| 329 |
cm->name, |
| 330 |
cm->acc == NULL ? "-" : cm->acc); |
| 331 |
if(use_cm) fprintf(stdout, " %13.2f %13.2f %13.2f %13.2f %5s\n", lins, lcyk, gins, gcyk, "cm"); |
| 332 |
else fprintf(stdout, " %13.2f %13.2f %13.2f %13s %5s\n", lfwd, lvit, gfwd, "-", "hmm"); |
| 333 |
|
| 334 |
} |
| 335 |
else { |
| 336 |
if((status = UpdateExpsForDBSize(cm, errbuf, Z)) != eslOK) cm_Fail("model %s: %s\n", cm->name, errbuf); |
| 337 |
if(output_mode == OUTMODE_EVALUES) { T = esl_opt_GetReal(go, "-T"); } |
| 338 |
if(output_mode == OUTMODE_GA) { T = (cm->flags & CMH_GA) ? cm->ga : 0.; } |
| 339 |
if(output_mode == OUTMODE_NC) { T = (cm->flags & CMH_GA) ? cm->nc : 0.; } |
| 340 |
if(output_mode == OUTMODE_TC) { T = (cm->flags & CMH_GA) ? cm->tc : 0.; } |
| 341 |
if(use_cm) { |
| 342 |
if(! (cm->flags & CMH_EXPTAIL_STATS)) cm_Fail("model %s does not have CM exponential tail stats"); |
| 343 |
lins = Score2E(T, cm->expA[EXP_CM_LI]->mu_extrap, cm->expA[EXP_CM_LI]->lambda, cm->expA[EXP_CM_LI]->cur_eff_dbsize); |
| 344 |
lcyk = Score2E(T, cm->expA[EXP_CM_LC]->mu_extrap, cm->expA[EXP_CM_LC]->lambda, cm->expA[EXP_CM_LC]->cur_eff_dbsize); |
| 345 |
gins = Score2E(T, cm->expA[EXP_CM_GI]->mu_extrap, cm->expA[EXP_CM_GI]->lambda, cm->expA[EXP_CM_GI]->cur_eff_dbsize); |
| 346 |
gcyk = Score2E(T, cm->expA[EXP_CM_GC]->mu_extrap, cm->expA[EXP_CM_GC]->lambda, cm->expA[EXP_CM_GC]->cur_eff_dbsize); |
| 347 |
} |
| 348 |
else { |
| 349 |
lfwd = Score2E(T, cm->fp7_evparam[CM_p7_LFTAU], cm->fp7_evparam[CM_p7_LFLAMBDA], (Z / (float) cm->fp7->max_length)); |
| 350 |
} |
| 351 |
if(output_mode == OUTMODE_EVALUES) { |
| 352 |
fprintf(stdout, "%6d %-20s %-9s", |
| 353 |
ncm, |
| 354 |
cm->name, |
| 355 |
cm->acc == NULL ? "-" : cm->acc); |
| 356 |
if(use_cm) fprintf(stdout, " %13g %13g %13g %13g %5s\n", lins, lcyk, gins, gcyk, "cm"); |
| 357 |
else fprintf(stdout, " %13g %13s %13s %13s %5s\n", lfwd, "-", "-", "-", "hmm"); |
| 358 |
} |
| 359 |
else { |
| 360 |
if((output_mode == OUTMODE_GA && (! (cm->flags & CMH_GA))) || |
| 361 |
(output_mode == OUTMODE_NC && (! (cm->flags & CMH_NC))) || |
| 362 |
(output_mode == OUTMODE_TC && (! (cm->flags & CMH_TC)))) |
| 363 |
{ |
| 364 |
|
| 365 |
fprintf(stdout, "%6d %-20s %-9s %13s %13s %13s %13s %13s %5s\n", |
| 366 |
ncm, |
| 367 |
cm->name, |
| 368 |
cm->acc == NULL ? "-" : cm->acc, |
| 369 |
"<not-set>", "-", "-", "-", "-", |
| 370 |
use_cm ? "cm" : "hmm"); |
| 371 |
} |
| 372 |
else { |
| 373 |
fprintf(stdout, "%6d %-20s %-9s %13.2f", |
| 374 |
ncm, |
| 375 |
cm->name, |
| 376 |
cm->acc == NULL ? "-" : cm->acc, T); |
| 377 |
if(use_cm) fprintf(stdout, " %13g %13g %13g %13g %5s\n", lins, lcyk, gins, gcyk, "cm"); |
| 378 |
else fprintf(stdout, " %13g %13s %13s %13s %5s\n", lfwd, "-", "-", "-", "hmm"); |
| 379 |
} |
| 380 |
} |
| 381 |
} |
| 382 |
} |
| 383 |
|