| 1 | <html> |
| 2 | <head> |
| 3 | <title>README for cm2hmm</title></head> |
| 4 | <body> |
| 5 | <H1>README for cm2hmm</H1> |
| 6 | <P>This program implements the techniques described in Z. Weinberg and W.L. |
| 7 | Ruzzo (2004) "Faster genome annotation of non-coding RNA families without loss |
| 8 | of accuracy", in <EM>Proc. Eighth Annual International Conference on Research in |
| 9 | Computational Molecular Biology (RECOMB),</EM> ACM Press, 243-251.</P> |
| 10 | <H2> |
| 11 | <H2>Licensing</H2> |
| 12 | </H2> |
| 13 | <P>The source code for cm2hmm and cm2hmmsearch is |
| 14 | copyright 2004 by Zasha Weinberg and distributed under the BSD license. |
| 15 | </P> |
| 16 | <P>The source depends on the cfsqp 3rd-party library. CFSQP is |
| 17 | distributed by <A href="http://www.aemdesign.com">www.aemdesign.com</A>. |
| 18 | It is not freely available, but is available on request for free for |
| 19 | academic institutions.</P> |
| 20 | <H2>Installation</H2> |
| 21 | <P>Installation is handled as an integrated part of the Infernal package.</P> |
| 22 | <P>To include rigorous filters when building Infernal, first configure the package</P> |
| 23 | <pre>./configure --with-rigfilters --with-cfsqp=/path/to/cfsqp</pre> |
| 24 | <P>The first option specifies that cm2hmm should be compiled (off by default), and the |
| 25 | second specifies the location of the cfsqp source code. Alternatively, you may |
| 26 | copy the source code into infernal-x.xx/rigfilters/cfsqp/ and omit the second |
| 27 | option.</P> |
| 28 | <P>Following a successful configure, type <pre>make</pre></P> |
| 29 | <H2>Usage</H2> |
| 30 | <P><tt>cm2hmm</tt> creates a compact- or expanded-type HMM from a given CM. |
| 31 | <tt>cm2hmmsearch</tt> searches a FASTA sequence file using a CM and profile HMM |
| 32 | rigorous filters created using cm2hmm. Both programs display simple usage |
| 33 | instructions when run without any parameters.</P> |
| 34 | <P> The input format for cm2hmm is:</P> |
| 35 | <pre> |
| 36 | cm2hmm <input CM file name> <output HMM file name> <0th-order Markov model specification> <HMM type & output format> <solver specification> |
| 37 | <input CM file name> : file name of a CM in Infernal format. |
| 38 | <output HMM file name> : file name of HMM to create. |
| 39 | <0th-order Markov model specification> : one of the following: |
| 40 | uniform : use a uniform 0th-order model (all nucleotides have probability 0.25) |
| 41 | gc <fraction> : the G+C content is <fraction>, a number from 0 to 1. |
| 42 | file <file name> : load it from a file (logic to create these files from an input sequence may or may not be implemented in distribution. |
| 43 | <HMM type & output format> : one of the following: |
| 44 | compact : create a compact-type profile HMM in the default text format. |
| 45 | expanded : create an expanded-type profile HMM in the default text format. |
| 46 | <solver-specification> : one option currently: |
| 47 | cfsqp <B> <C> : use CFSQP, sending solver parameters B&C. <B>=0, <C>=1 are reasonable parameters. Refer to the CFSQP manual for details. |
| 48 | </pre> |
| 49 | <P>The input format for cm2hmmsearch is:</P> |
| 50 | <pre> |
| 51 | cm2hmmsearch <window len> <score threshold> <CM file name> <compact profile HMM file name> <expanded profile HMM file name> <sequence file> <run CM?> |
| 52 | <window len> : window length parameter for CM scan. |
| 53 | <score threshold> : hits below this threshold will be ignored (and likely filtered out by the profile HMMs). |
| 54 | <CM file name> : file name of a CM in Infernal format. |
| 55 | <compact profile HMM file name> : name of a profile HMM to do filtering, or "-" (a single dash) to not use this HMM. Although this HMM is presumed to be compact type, this is not enforced. |
| 56 | <expanded profile HMM file name> : similar idea to previous field, but for the expanded profile HMM. |
| 57 | <sequence file> : name of a sequence file in FASTA format. |
| 58 | <run CM?> : if "0" do NOT actually run the CM, just do the filtering and report the filtering fraction. If "1", run the CM to find hits. |
| 59 | </pre> |
| 60 | <P>Here's an example of creating both compact- and expanded-type HMMs for RF00095, |
| 61 | and scanning the <EM>Pyrococcus abyssi</EM> genome.</P> |
| 62 | <P>From infernal-x.xx/rigfilters/cm2hmm, enter the following commands (which each take a minute or so to complete):</P> |
| 63 | <tt> |
| 64 | <P>cm2hmm data/RF00095.cm data/RF00095_compact.hmm file data/Ecoli_0mm.mm |
| 65 | compact cfsqp 0 1</P> |
| 66 | <P>cm2hmm data/RF00095.cm data/RF00095_expanded.hmm file |
| 67 | data/Ecoli_0mm.mm expanded cfsqp 0 1</P> |
| 68 | <P>cm2hmmsearch 150 23.5 data/RF00095.cm data/RF00095_compact.hmm |
| 69 | data/RF00095_expanded.hmm data/AL096836.fna 1</P> |
| 70 | </tt> |
| 71 | <P>The first two commands create the HMMs given the CM in data/RF00095.cm. |
| 72 | They are both optimized based on a 0th-order Markov model of the <EM>E. coli</EM> |
| 73 | K-12 genome. The last command uses these HMMs to accelerate a search of |
| 74 | the <EM>Pyrococcus abyssi</EM> genome (data/AL096836.fna). The |
| 75 | search outputs the family members found in basically the same format as |
| 76 | Infernal. An important new piece of information is the 'frac let thru so |
| 77 | far', which gives the filtering fraction measured on this genome. The |
| 78 | reported filtering fraction is for the 2nd HMM, i.e. the expanded-type |
| 79 | one. (2d-fracLetsThru is a measure of the filtering fraction that |
| 80 | attempts to reflect the fact that the dynamic programming algorithm for CMs has |
| 81 | an extra dimension, so the filtering fraction is a somewhat pessimistic |
| 82 | estimate of the actual speed-up). |
| 83 | </P> |
| 84 | <H3>What 0th-order Markov model to use?</H3> |
| 85 | <P>The choice of Markov model in the infinite-length forward algorithm does not |
| 86 | usually affect the filtering fraction that much, but a good choice |
| 87 | can yield a modest improvement in filtering fraction (typically |
| 88 | around 10%). In general, it's best to use the 0th-order model of the |
| 89 | genome that has the highest (worst) filtering fraction. To estimate this, |
| 90 | create a compact-type HMM from any model, and run it on the <EM>Bordetella</EM>, |
| 91 | <EM>E. coli</EM> and <EM>S. aureus</EM> genomes.</P> |
| 92 | <H3>Using compact- or expanded-type HMMs, or both</H3> |
| 93 | <P>Once you've picked a 0th-order Markov model, the easiest thing to do is to |
| 94 | create both compact- and expanded-type HMMs, and run them on the three |
| 95 | genomes. This yields an estimate of the filtering fraction for the two |
| 96 | HMMs. If the filtering fraction of the compact-type HMMs is above 0.25, |
| 97 | it's probably not worth using it (this is based on a rule of thumb that the |
| 98 | expanded-type HMM runs 30% slower than the compact-type HMM, so if the |
| 99 | compact-type fraction is above 0.25, it's not worth using it). If the |
| 100 | compact-type HMM filtering fraction is low, there's no need to use the |
| 101 | expanded-type HMM, but it can't hurt.</P> |
| 102 | <P>The difference in speed between the CM and the HMMs is mainly dependent on the |
| 103 | window length W. The HMM is faster than the CM by a factor of usually a |
| 104 | bit over W. So, if the filtering fraction is significantly below 1/W, |
| 105 | then the search time is dominated by the HMM's search time, and there's no |
| 106 | point in getting a better filtering fraction.</P> |