| 1 | <HTML> |
| 2 | |
| 3 | <HEAD> |
| 4 | <TITLE> |
| 5 | EMBOSS: codcmp |
| 6 | </TITLE> |
| 7 | </HEAD> |
| 8 | <BODY BGCOLOR="#FFFFFF" text="#000000"> |
| 9 | |
| 10 | <table align=center border=0 cellspacing=0 cellpadding=0> |
| 11 | <tr><td valign=top> |
| 12 | <A HREF="/" ONMOUSEOVER="self.status='Go to the EMBOSS home page';return true"><img border=0 src="/images/emboss_icon.jpg" alt="" width=150 height=48></a> |
| 13 | </td> |
| 14 | <td align=left valign=middle> |
| 15 | <b><font size="+6"> |
| 16 | codcmp |
| 17 | </font></b> |
| 18 | </td></tr> |
| 19 | </table> |
| 20 | <br> |
| 21 | <p> |
| 22 | |
| 23 | |
| 24 | <H2> |
| 25 | Wiki |
| 26 | </H2> |
| 27 | |
| 28 | The master copies of EMBOSS documentation are available |
| 29 | at <a href="http://emboss.open-bio.org/wiki/Appdocs"> |
| 30 | http://emboss.open-bio.org/wiki/Appdocs</a> |
| 31 | on the EMBOSS Wiki. |
| 32 | |
| 33 | <p> |
| 34 | Please help by correcting and extending the Wiki pages. |
| 35 | |
| 36 | <H2> |
| 37 | Function |
| 38 | </H2> |
| 39 | Codon usage table comparison |
| 40 | <H2> |
| 41 | Description |
| 42 | </H2> |
| 43 | |
| 44 | <p><b>codcmp</b> reads two codon usage table files and writes to file the differences in codon usage fractions between the two tables.</p> |
| 45 | <p>The usage fraction of a codon is its proportion (0 to 1) of the total number of the codons in the sequences used to construct the usage table. For each codon that is used in both tables, it takes the difference between the usage fractions in the two tables. The sum of the differences and the sum of the differences squared is reported in the output file. It also counts the number of the 64 possible codons which are unused (i.e. has a usage fraction of 0) in either one or the other or both of the codon usage tables, and writes this to the output file.</p> |
| 46 | |
| 47 | |
| 48 | |
| 49 | <H3> |
| 50 | Statistical significance |
| 51 | </H3> |
| 52 | |
| 53 | <b>Question:</b> |
| 54 | |
| 55 | <p> |
| 56 | |
| 57 | How do you interpret the statistical significance of any difference |
| 58 | between the tables? |
| 59 | |
| 60 | <p> |
| 61 | |
| 62 | <b>Answer:</b> |
| 63 | |
| 64 | <p> |
| 65 | |
| 66 | This is a very interesting question. I don't think that there is any |
| 67 | way to say if it is statistically significant just from looking at it, |
| 68 | as it is essentially a descriptive statistic about the difference |
| 69 | between two 64-mer vectors. If you have a whole lot of sequences and |
| 70 | codcmp results for all the possible pairwise comparisons, then the |
| 71 | resulting distance matrix can be used to build a phylogenetic tree based |
| 72 | on codon usage. |
| 73 | |
| 74 | <p> |
| 75 | |
| 76 | However, if you generate a series of random sequences, measure their codon |
| 77 | usage and then do codcmp between each of your test sequences and all the |
| 78 | random sequences, you could then use a z-test to see if the result between |
| 79 | the two test sequences was outside of the top or bottom 5%. |
| 80 | |
| 81 | <p> |
| 82 | |
| 83 | This would assume that the codcmp results were normally distributed, but |
| 84 | you could test that too. The simplest way is just to plot them and look |
| 85 | for a bell-curve. For more rigour, find the mean and standard deviation of |
| 86 | your results from the random sequences, use the normal distribution |
| 87 | equation to generate a theoretical distribution for that mean and standard |
| 88 | deviation, and then perform a chi square between the random data and the |
| 89 | theoretically generated normal distribution. If you generate two sets of |
| 90 | random data, each based on your two test sequences, an F-test should be |
| 91 | used to establish that they have equal variances. Then you can safely go |
| 92 | ahead and perform the z-test. |
| 93 | |
| 94 | <p> |
| 95 | |
| 96 | You could use shuffle to base your random sequences on the test |
| 97 | sequences - so that would ensure the randomised background had the same |
| 98 | nucleotide content. |
| 99 | |
| 100 | <p> |
| 101 | |
| 102 | F-tests, z-tests and chi-tests can all be done in Excel, as well as |
| 103 | being standard in most statistical analysis packages. |
| 104 | |
| 105 | <p> |
| 106 | |
| 107 | <i>Answered by Derek Gatherer <d.gatherer © vir.gla.ac.uk> 21 Nov 2003</i> |
| 108 | |
| 109 | |
| 110 | <H2> |
| 111 | Usage |
| 112 | </H2> |
| 113 | Here is a sample session with <b>codcmp</b> |
| 114 | <p> |
| 115 | This compares the codon usage tables for Escherichia coli and Haemophilus influenzae. |
| 116 | <p> |
| 117 | |
| 118 | <p> |
| 119 | <table width="90%"><tr><td bgcolor="#CCFFFF"><pre> |
| 120 | |
| 121 | % <b>codcmp </b> |
| 122 | Codon usage table comparison |
| 123 | Codon usage file: <b>Eecoli.cut</b> |
| 124 | Second Codon usage file: <b>Ehaein.cut</b> |
| 125 | Output file [eecoli.codcmp]: <b></b> |
| 126 | |
| 127 | </pre></td></tr></table><p> |
| 128 | <p> |
| 129 | <a href="#output.1">Go to the output files for this example</a><p><p> |
| 130 | |
| 131 | <H2> |
| 132 | Command line arguments |
| 133 | </H2> |
| 134 | |
| 135 | <table CELLSPACING=0 CELLPADDING=3 BGCOLOR="#f5f5ff" ><tr><td> |
| 136 | <pre> |
| 137 | Codon usage table comparison |
| 138 | Version: EMBOSS:6.6.0.0 |
| 139 | |
| 140 | Standard (Mandatory) qualifiers: |
| 141 | [-first] codon First codon usage file |
| 142 | [-second] codon Second codon usage file for comparison |
| 143 | [-outfile] outfile [*.codcmp] Output file name |
| 144 | |
| 145 | Additional (Optional) qualifiers: (none) |
| 146 | Advanced (Unprompted) qualifiers: (none) |
| 147 | Associated qualifiers: |
| 148 | |
| 149 | "-first" associated qualifiers |
| 150 | -format1 string Data format |
| 151 | |
| 152 | "-second" associated qualifiers |
| 153 | -format2 string Data format |
| 154 | |
| 155 | "-outfile" associated qualifiers |
| 156 | -odirectory3 string Output directory |
| 157 | |
| 158 | General qualifiers: |
| 159 | -auto boolean Turn off prompts |
| 160 | -stdout boolean Write first file to standard output |
| 161 | -filter boolean Read first file from standard input, write |
| 162 | first file to standard output |
| 163 | -options boolean Prompt for standard and additional values |
| 164 | -debug boolean Write debug output to program.dbg |
| 165 | -verbose boolean Report some/full command line options |
| 166 | -help boolean Report command line options and exit. More |
| 167 | information on associated and general |
| 168 | qualifiers can be found with -help -verbose |
| 169 | -warning boolean Report warnings |
| 170 | -error boolean Report errors |
| 171 | -fatal boolean Report fatal errors |
| 172 | -die boolean Report dying program messages |
| 173 | -version boolean Report version number and exit |
| 174 | |
| 175 | </pre> |
| 176 | </td></tr></table> |
| 177 | <P> |
| 178 | <table border cellspacing=0 cellpadding=3 bgcolor="#ccccff"> |
| 179 | <tr bgcolor="#FFFFCC"> |
| 180 | <th align="left">Qualifier</th> |
| 181 | <th align="left">Type</th> |
| 182 | <th align="left">Description</th> |
| 183 | <th align="left">Allowed values</th> |
| 184 | <th align="left">Default</th> |
| 185 | </tr> |
| 186 | |
| 187 | <tr bgcolor="#FFFFCC"> |
| 188 | <th align="left" colspan=5>Standard (Mandatory) qualifiers</th> |
| 189 | </tr> |
| 190 | |
| 191 | <tr bgcolor="#FFFFCC"> |
| 192 | <td>[-first]<br>(Parameter 1)</td> |
| 193 | <td>codon</td> |
| 194 | <td>First codon usage file</td> |
| 195 | <td>Codon usage file in EMBOSS data path</td> |
| 196 | <td> </td> |
| 197 | </tr> |
| 198 | |
| 199 | <tr bgcolor="#FFFFCC"> |
| 200 | <td>[-second]<br>(Parameter 2)</td> |
| 201 | <td>codon</td> |
| 202 | <td>Second codon usage file for comparison</td> |
| 203 | <td>Codon usage file in EMBOSS data path</td> |
| 204 | <td> </td> |
| 205 | </tr> |
| 206 | |
| 207 | <tr bgcolor="#FFFFCC"> |
| 208 | <td>[-outfile]<br>(Parameter 3)</td> |
| 209 | <td>outfile</td> |
| 210 | <td>Output file name</td> |
| 211 | <td>Output file</td> |
| 212 | <td><i><*></i>.codcmp</td> |
| 213 | </tr> |
| 214 | |
| 215 | <tr bgcolor="#FFFFCC"> |
| 216 | <th align="left" colspan=5>Additional (Optional) qualifiers</th> |
| 217 | </tr> |
| 218 | |
| 219 | <tr> |
| 220 | <td colspan=5>(none)</td> |
| 221 | </tr> |
| 222 | |
| 223 | <tr bgcolor="#FFFFCC"> |
| 224 | <th align="left" colspan=5>Advanced (Unprompted) qualifiers</th> |
| 225 | </tr> |
| 226 | |
| 227 | <tr> |
| 228 | <td colspan=5>(none)</td> |
| 229 | </tr> |
| 230 | |
| 231 | <tr bgcolor="#FFFFCC"> |
| 232 | <th align="left" colspan=5>Associated qualifiers</th> |
| 233 | </tr> |
| 234 | |
| 235 | <tr bgcolor="#FFFFCC"> |
| 236 | <td align="left" colspan=5>"-first" associated codon qualifiers |
| 237 | </td> |
| 238 | </tr> |
| 239 | |
| 240 | <tr bgcolor="#FFFFCC"> |
| 241 | <td> -format1<br>-format_first</td> |
| 242 | <td>string</td> |
| 243 | <td>Data format</td> |
| 244 | <td>Any string</td> |
| 245 | <td> </td> |
| 246 | </tr> |
| 247 | |
| 248 | <tr bgcolor="#FFFFCC"> |
| 249 | <td align="left" colspan=5>"-second" associated codon qualifiers |
| 250 | </td> |
| 251 | </tr> |
| 252 | |
| 253 | <tr bgcolor="#FFFFCC"> |
| 254 | <td> -format2<br>-format_second</td> |
| 255 | <td>string</td> |
| 256 | <td>Data format</td> |
| 257 | <td>Any string</td> |
| 258 | <td> </td> |
| 259 | </tr> |
| 260 | |
| 261 | <tr bgcolor="#FFFFCC"> |
| 262 | <td align="left" colspan=5>"-outfile" associated outfile qualifiers |
| 263 | </td> |
| 264 | </tr> |
| 265 | |
| 266 | <tr bgcolor="#FFFFCC"> |
| 267 | <td> -odirectory3<br>-odirectory_outfile</td> |
| 268 | <td>string</td> |
| 269 | <td>Output directory</td> |
| 270 | <td>Any string</td> |
| 271 | <td> </td> |
| 272 | </tr> |
| 273 | |
| 274 | <tr bgcolor="#FFFFCC"> |
| 275 | <th align="left" colspan=5>General qualifiers</th> |
| 276 | </tr> |
| 277 | |
| 278 | <tr bgcolor="#FFFFCC"> |
| 279 | <td> -auto</td> |
| 280 | <td>boolean</td> |
| 281 | <td>Turn off prompts</td> |
| 282 | <td>Boolean value Yes/No</td> |
| 283 | <td>N</td> |
| 284 | </tr> |
| 285 | |
| 286 | <tr bgcolor="#FFFFCC"> |
| 287 | <td> -stdout</td> |
| 288 | <td>boolean</td> |
| 289 | <td>Write first file to standard output</td> |
| 290 | <td>Boolean value Yes/No</td> |
| 291 | <td>N</td> |
| 292 | </tr> |
| 293 | |
| 294 | <tr bgcolor="#FFFFCC"> |
| 295 | <td> -filter</td> |
| 296 | <td>boolean</td> |
| 297 | <td>Read first file from standard input, write first file to standard output</td> |
| 298 | <td>Boolean value Yes/No</td> |
| 299 | <td>N</td> |
| 300 | </tr> |
| 301 | |
| 302 | <tr bgcolor="#FFFFCC"> |
| 303 | <td> -options</td> |
| 304 | <td>boolean</td> |
| 305 | <td>Prompt for standard and additional values</td> |
| 306 | <td>Boolean value Yes/No</td> |
| 307 | <td>N</td> |
| 308 | </tr> |
| 309 | |
| 310 | <tr bgcolor="#FFFFCC"> |
| 311 | <td> -debug</td> |
| 312 | <td>boolean</td> |
| 313 | <td>Write debug output to program.dbg</td> |
| 314 | <td>Boolean value Yes/No</td> |
| 315 | <td>N</td> |
| 316 | </tr> |
| 317 | |
| 318 | <tr bgcolor="#FFFFCC"> |
| 319 | <td> -verbose</td> |
| 320 | <td>boolean</td> |
| 321 | <td>Report some/full command line options</td> |
| 322 | <td>Boolean value Yes/No</td> |
| 323 | <td>Y</td> |
| 324 | </tr> |
| 325 | |
| 326 | <tr bgcolor="#FFFFCC"> |
| 327 | <td> -help</td> |
| 328 | <td>boolean</td> |
| 329 | <td>Report command line options and exit. More information on associated and general qualifiers can be found with -help -verbose</td> |
| 330 | <td>Boolean value Yes/No</td> |
| 331 | <td>N</td> |
| 332 | </tr> |
| 333 | |
| 334 | <tr bgcolor="#FFFFCC"> |
| 335 | <td> -warning</td> |
| 336 | <td>boolean</td> |
| 337 | <td>Report warnings</td> |
| 338 | <td>Boolean value Yes/No</td> |
| 339 | <td>Y</td> |
| 340 | </tr> |
| 341 | |
| 342 | <tr bgcolor="#FFFFCC"> |
| 343 | <td> -error</td> |
| 344 | <td>boolean</td> |
| 345 | <td>Report errors</td> |
| 346 | <td>Boolean value Yes/No</td> |
| 347 | <td>Y</td> |
| 348 | </tr> |
| 349 | |
| 350 | <tr bgcolor="#FFFFCC"> |
| 351 | <td> -fatal</td> |
| 352 | <td>boolean</td> |
| 353 | <td>Report fatal errors</td> |
| 354 | <td>Boolean value Yes/No</td> |
| 355 | <td>Y</td> |
| 356 | </tr> |
| 357 | |
| 358 | <tr bgcolor="#FFFFCC"> |
| 359 | <td> -die</td> |
| 360 | <td>boolean</td> |
| 361 | <td>Report dying program messages</td> |
| 362 | <td>Boolean value Yes/No</td> |
| 363 | <td>Y</td> |
| 364 | </tr> |
| 365 | |
| 366 | <tr bgcolor="#FFFFCC"> |
| 367 | <td> -version</td> |
| 368 | <td>boolean</td> |
| 369 | <td>Report version number and exit</td> |
| 370 | <td>Boolean value Yes/No</td> |
| 371 | <td>N</td> |
| 372 | </tr> |
| 373 | |
| 374 | </table> |
| 375 | |
| 376 | <H2> |
| 377 | Input file format |
| 378 | </H2> |
| 379 | |
| 380 | It reads in the Codon Usage Tables - these are available as EMBOSS data files. |
| 381 | See below for details. |
| 382 | |
| 383 | <p> |
| 384 | |
| 385 | |
| 386 | |
| 387 | <H2> |
| 388 | Output file format |
| 389 | </H2> |
| 390 | |
| 391 | <a name="output.1"></a> |
| 392 | <h3>Output files for usage example </h3> |
| 393 | <p><h3>File: eecoli.codcmp</h3> |
| 394 | <table width="90%"><tr><td bgcolor="#CCFFCC"> |
| 395 | <pre> |
| 396 | # CODCMP codon usage table comparison |
| 397 | # Eecoli.cut vs Ehaein.cut |
| 398 | |
| 399 | Sum Squared Difference = 2.178 |
| 400 | Mean Squared Difference = 0.034 |
| 401 | Root Mean Squared Difference = 0.184 |
| 402 | Sum Difference = 9.504 |
| 403 | Mean Difference = 0.149 |
| 404 | Codons not appearing = 0 |
| 405 | </pre> |
| 406 | </td></tr></table><p> |
| 407 | |
| 408 | |
| 409 | <H2> |
| 410 | Data files |
| 411 | </H2> |
| 412 | |
| 413 | <p><b>codcmp</b> requires two codon usage tables which are read by default from the EMBOSS data file from <tt>Ehum.cut</tt> in the data/CODONS directory of the EMBOSS distribution. If the name of a codon usage file is specified on the command line, then this file will first be searched for in the current directory and then in the <tt>data/CODONS</tt> directory of the EMBOSS distribution. </p> |
| 414 | |
| 415 | |
| 416 | <p> |
| 417 | EMBOSS data files are distributed with the application and stored |
| 418 | in the standard EMBOSS data directory, which is defined |
| 419 | by the EMBOSS environment variable EMBOSS_DATA. |
| 420 | |
| 421 | <p> |
| 422 | |
| 423 | To see the available EMBOSS data files, run: |
| 424 | <p> |
| 425 | <pre> |
| 426 | % embossdata -showall |
| 427 | </pre> |
| 428 | <p> |
| 429 | To fetch one of the data files (for example 'Exxx.dat') into your |
| 430 | current directory for you to inspect or modify, run: |
| 431 | |
| 432 | <pre> |
| 433 | |
| 434 | % embossdata -fetch -file Exxx.dat |
| 435 | |
| 436 | </pre> |
| 437 | <p> |
| 438 | |
| 439 | Users can provide their own data files in their own directories. |
| 440 | Project specific files can be put in the current directory, or for |
| 441 | tidier directory listings in a subdirectory called |
| 442 | ".embossdata". Files for all EMBOSS runs can be put in the user's home |
| 443 | directory, or again in a subdirectory called ".embossdata". |
| 444 | |
| 445 | <p> |
| 446 | The directories are searched in the following order: |
| 447 | |
| 448 | <ul> |
| 449 | <li> . (your current directory) |
| 450 | <li> .embossdata (under your current directory) |
| 451 | <li> ~/ (your home directory) |
| 452 | <li> ~/.embossdata |
| 453 | </ul> |
| 454 | <p> |
| 455 | |
| 456 | <H2> |
| 457 | Notes |
| 458 | </H2> |
| 459 | |
| 460 | <p>The following notes based on Derek Gatherer's comments are useful for interpreting the significance of any difference between the tables.</p> |
| 461 | |
| 462 | <p>It's not normally possible to be certain a a difference is statistically significant just from looking at it, as it is essentially a descriptive statistic about the difference between two 64-mer vectors. If you have a whole lot of sequences and <b>codcmp</b> results for all the possible pairwise comparisons, then the resulting distance matrix can be used to build a phylogenetic tree based on codon usage.</p> |
| 463 | |
| 464 | <p>However, if you generate a series of random sequences, measure their codon usage and then do <b>codcmp</b> between each of your test sequences and all the random sequences, you could then use a z-test to see if the result between the two test sequences was outside of the top or bottom 5%.</p> |
| 465 | |
| 466 | <p>This would assume that the <b>codcmp</b> results were normally distributed, but you could test that too. The simplest way is just to plot them and look for a bell-curve. For more rigour, find the mean and standard deviation of your results from the random sequences, use the normal distribution equation to generate a theoretical distribution for that mean and standard deviation, and then perform a chi square between the random data and the theoretically generated normal distribution. If you generate two sets of random data, each based on your two test sequences, an F-test should be used to establish that they have equal variances. Then you can safely go ahead and perform the z-test.</p> |
| 467 | |
| 468 | <p>You could use the shuffle program to base your random sequences on the test sequences - so that would ensure the randomised background had the same nucleotide content. F-tests, z-tests and chi-tests can all be done in Excel, as well as being standard in most statistical analysis packages.</p> |
| 469 | |
| 470 | |
| 471 | <H2> |
| 472 | References |
| 473 | </H2> |
| 474 | |
| 475 | |
| 476 | None. |
| 477 | |
| 478 | <H2> |
| 479 | Warnings |
| 480 | </H2> |
| 481 | |
| 482 | |
| 483 | None. |
| 484 | |
| 485 | <H2> |
| 486 | Diagnostic Error Messages |
| 487 | </H2> |
| 488 | |
| 489 | |
| 490 | None. |
| 491 | |
| 492 | <H2> |
| 493 | Exit status |
| 494 | </H2> |
| 495 | |
| 496 | |
| 497 | This program always exits with a status of 0. |
| 498 | |
| 499 | <H2> |
| 500 | Known bugs |
| 501 | </H2> |
| 502 | |
| 503 | None. |
| 504 | |
| 505 | <h2><a name="See also">See also</a></h2> |
| 506 | <table border cellpadding=4 bgcolor="#FFFFF0"> |
| 507 | <tr><th>Program name</th> |
| 508 | <th>Description</th></tr> |
| 509 | <tr> |
| 510 | <td><a href="cai.html">cai</a></td> |
| 511 | <td>Calculate codon adaptation index</td> |
| 512 | </tr> |
| 513 | |
| 514 | <tr> |
| 515 | <td><a href="chips.html">chips</a></td> |
| 516 | <td>Calculate Nc codon usage statistic</td> |
| 517 | </tr> |
| 518 | |
| 519 | <tr> |
| 520 | <td><a href="codcopy.html">codcopy</a></td> |
| 521 | <td>Copy and reformat a codon usage table</td> |
| 522 | </tr> |
| 523 | |
| 524 | <tr> |
| 525 | <td><a href="cusp.html">cusp</a></td> |
| 526 | <td>Create a codon usage table from nucleotide sequence(s)</td> |
| 527 | </tr> |
| 528 | |
| 529 | <tr> |
| 530 | <td><a href="syco.html">syco</a></td> |
| 531 | <td>Draw synonymous codon usage statistic plot for a nucleotide sequence</td> |
| 532 | </tr> |
| 533 | |
| 534 | </table> |
| 535 | <H2> |
| 536 | Author(s) |
| 537 | </H2> |
| 538 | |
| 539 | Alan Bleasby |
| 540 | <br> |
| 541 | European Bioinformatics Institute, Wellcome Trust Genome Campus, Hinxton, Cambridge CB10 1SD, UK |
| 542 | |
| 543 | <p> |
| 544 | Please report all bugs to the EMBOSS bug team (emboss-bug © emboss.open-bio.org) not to the original author. |
| 545 | <p> |
| 546 | |
| 547 | Some more statistics were added by |
| 548 | David Martin |
| 549 | |
| 550 | <p> |
| 551 | Please report all bugs to the EMBOSS bug team (emboss-bug © emboss.open-bio.org) not to the original author. |
| 552 | <H2> |
| 553 | History |
| 554 | </H2> |
| 555 | |
| 556 | Completed 9 Sept 1999 |
| 557 | <br> |
| 558 | 20 Oct 2000 - David Martin added a couple more statistics to the output. |
| 559 | |
| 560 | <H2> |
| 561 | Target users |
| 562 | </H2> |
| 563 | This program is intended to be used by everyone and everything, from naive users to embedded scripts. |
| 564 | |
| 565 | <H2> |
| 566 | Comments |
| 567 | </H2> |
| 568 | None |
| 569 | |
| 570 | </BODY> |
| 571 | </HTML> |
| 572 |