Repository 'hmmer'
hg clone https://toolshed.g2.bx.psu.edu/repos/edward-kirton/hmmer

Changeset 0:c16d8db9338a (2012-03-05)
Next changeset 1:66f8262e1686 (2012-03-05)
Commit message:
init repo
added:
hmmer.xml
hmmpress.xml
hmmpress_wrapper.pl
b
diff -r 000000000000 -r c16d8db9338a hmmer.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hmmer.xml Mon Mar 05 22:43:09 2012 -0800
[
b'@@ -0,0 +1,165 @@\n+<tool id="hmmer" name="hmmer" version="1.0.0">\n+<description>hmmscan/search seqs vs profiles</description>\n+<command>\n+$program\n+##--cpu 8\n+--tblout $tblout\n+--domtblout $domtblout\n+$acc\n+$noali\n+--notextw\n+#if $threshold.select == \'E\':\n+-E $threshold.profile\n+--domE $threshold.dom\n+#else:\n+-T $threshold.profile\n+--domT $threshold.dom\n+#end if\n+--incE $incE\n+--incdomE $incdomE\n+#if $acceleration.select == "1":\n+$acceleration.max\n+--F1 $acceleration.F1\n+--F2 $acceleration.F2\n+--F3 $acceleration.F3\n+$acceleration.nobias\n+#end if\n+#if $other.select == "1":\n+$other.nonull2\n+--seed $other.seed\n+#end if\n+-o $logfile\n+#if $hmmdb.select == \'db\':\n+$hmmdb.file\n+#else:\n+${hmmdb.file.extra_files_path}/hmm\n+#end if\n+$seqfile\n+</command>\n+<inputs>\n+    <param name="program" type="select" display="radio" label="Query">\n+        <option value="hmmscan">Sequence (i.e. hmmscan)</option>\n+        <option value="hmmsearch">Profile (i.e. hmmsearch)</option>\n+    </param>\n+\n+    <param name="seqfile" type="data" format="fasta" label="Sequences" /> <!-- NYI embl, genbank -->\n+\n+    <conditional name="hmmdb">\n+        <param name="select" type="select" label="HMM Db">\n+          <option value="db" selected="True">Precompiled HMM Database</option>\n+          <option value="user">HMM Database in your History</option>\n+        </param>\n+        <when value="db">\n+            <param name="file" type="select" label="Precompiled HMM database">\n+                <options from_file="hmmdb.loc">\n+                    <column name="name" index="1"/>\n+                    <column name="value" index="2"/>\n+                </options>\n+            </param>\n+        </when>\n+        <when value="user">\n+            <param name="file" type="data" format="hmmer" label="HMM database" />\n+        </when>\n+    </conditional>\n+\n+    <param name="acc" type="boolean" truevalue="--acc" falsevalue="" checked="false" label="[--acc] Prefer accessions over names in output" />\n+    <param name="noali" type="boolean" truevalue="--noali" falsevalue="" checked="false" label="[--noali] Omit the alignment section from the main output" help="This can greatly reduce the output volume" />\n+\n+    <!-- OPTIONS FOR REPORTING THRESHOLDS -->\n+    <conditional name="threshold">\n+        <param name="select" type="select" label="Select reporting threshold to control which hits are reported in output files">\n+            <option value="E">Using E-value thresholds</option>\n+            <option value="T">Using bit score thresholds</option>\n+        </param>\n+        <when value="E">\n+            <param name="profile" type="float" value="10.0" label="[-E] Report target profiles with an E-value of &lt;= this value" help="The default is 10.0, meaning that on average, about 10 false positives will be reported per query, so you can see the top of the noise and decide for yourself if it is really noise." />\n+            <param name="dom" type="float" value="10.0" label="[--domE] In the per-domain output, for target profiles that have already satisfied the per-profile reporting threshold, report individual domains with a conditional E-value of &lt;= this value" help="The default value is 10.0.  A conditional E-value means the expected number of additional false positive domains in the smaller search space of those comparisons that already satisfied the per-profile reporting threshold (and thus must have at least one homologous domain already)." />\n+        </when>\n+        <when value="T">\n+            <param name="profile" type="integer" value="100" label="[-T] Report target profiles with a bit score of &gt;= this value" />\n+            <param name="dom" type="integer" value="100" label="[--domT] Report domains with a bit score &gt;= this value" />\n+        </when>\n+    </conditional>\n+\n+    <!-- OPTIONS FOR INCLUSION THRESHOLDS; incT & incdomT WERE DELIBERATELY EXCLUDED SINCE THEY ARE NOT RECOMMENDED -->\n+    <param name="incE" type="float" value="0.01" label="[--incE] Use an E-value '..b'   <when value="1">\n+            <param name="max" type="boolean" truevalue="--max" falsevalue="" label="[--max] Turn off all filters, including the bias filter, and run full Forward/Backward postprocessing on every target." help="This increases sensitivity somewhat, at a large cost in speed" />\n+            <param name="F1" type="float" value="0.02" label="[--F1] Set the P-value threshold for the MSV filter step." help="The default is 0.02, meaning that roughly 2% of the highest scoring nonhomologous targets are expected to pass the filter" />\n+            <param name="F2" type="float" value="0.001" label="[--F2] Set the P-value threshold for the Viterbi filter step." />\n+            <param name="F3" type="float" value="0.00001" label="[--F3] Set the P-value threshold for the Forward filter step." />\n+            <param name="nobias" type="boolean" truevalue="--nobias" falsevalue="" label="[--nobias] Turn off the bias filter." help="This increases sensitivity somewhat, but can come at a high cost in speed, especially if the query has biased residue composition (such as a repetitive sequence region, or if it is a membrane protein with large regions of hydrophobicity). Without the bias filter, too many sequences may pass the filter with biased queries, leading to slower than expected performance as the computationally intensive Forward/Backward algorithms shoulder an abnormally heavy load." />\n+        </when>\n+    </conditional>\n+\n+    <!-- OTHER OPTIONS -->\n+    <conditional name="other">\n+        <param name="select" type="select" label="Other options">\n+            <option value="0">Use defaults</option>\n+            <option value="1">Define options</option>\n+        </param>\n+        <when value="0">\n+        </when>\n+        <when value="1">\n+            <param name="nonull2" type="boolean" truevalue="--nonull2" falsevalue="" label="[--nonull2] Turn off the null2 score corrections for biased composition." />\n+            <!-- NYI: Z, domZ -->\n+            <param name="seed" type="integer" value="42" label="[--seed] Set the random number seed" help="Some steps in postprocessing require Monte Carlo simulation. The default is to use a fixed seed (42), so that results are exactly reproducible. Any other positive integer will give different (but also reproducible) results. A choice of 0 uses an arbitrarily chosen seed." />\n+        </when>\n+    </conditional>\n+</inputs>\n+<outputs>\n+    <data name="logfile" format="txt" />\n+    <data name="tblout" format="tabular" label="${tool.name} on $on_string: Per-sequence hits" />\n+    <data name="domtblout" format="tabular" label="${tool.name} on $on_string: Per-domain hits" />\n+</outputs>\n+<requirements>\n+    <requirement type="binary">hmmscan</requirement>\n+    <requirement type="binary">hmmsearch</requirement>\n+</requirements>\n+<tests>\n+</tests>\n+<help>\n+.. class:: warningmark\n+\n+**Note**. Hidden Markov Model (HMM) searches take a substantial amount of time.\n+For large input datasets it is advisable to allow overnight processing.  \n+\n+-----\n+\n+**What it does**\n+\n+hmmscan is used to search sequences against collections of profiles. For each sequence in seqfile,\n+use that query sequence to search the target database of profiles in hmmdb, and output ranked lists of\n+the profiles with the most significant matches to the sequence.\n+\n+hmmsearch is used to search one or more profiles against a sequence database.\n+For each profile in "hmmfile", use that query profile to search the target database of profiles in "seqdb", \n+and output ranked lists of the sequences with the most significant matches to the profile.\n+\n+If using a user-supplied profile database, it needs to be pressed using hmmpress before it can be searched with hmmscan.\n+\n+**Author**\n+\n+Sean Eddy, Howard Hughes Medical Institute and Dept. of Genetics, Washington University School of Medicine\n+\n+http://www.genetics.wustl.edu/eddy/\n+\n+**Manual**\n+\n+ftp://selab.janelia.org/pub/software/hmmer/CURRENT/Userguide.pdf\n+</help>\n+</tool>\n'
b
diff -r 000000000000 -r c16d8db9338a hmmpress.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hmmpress.xml Mon Mar 05 22:43:09 2012 -0800
b
@@ -0,0 +1,17 @@
+<tool id="hmmpress" name="hmmpress" version="1.0.0">
+<description>Compress profile db</description>
+<command interpreter="perl">hmmpress_wrapper.pl $infile $outfile $outfile.extra_files_path</command>
+<inputs>
+    <param name="infile" type="data" format="hmm" label="HMM profile Db" help="Created by hmmbuild" />
+</inputs>
+<outputs>
+    <data name="outfile" format="hmmpressed" />
+</outputs>
+<help>
+**What It Does**
+
+Starting from a profile database in standard HMMER3 format, construct binary compressed datafiles for hmmscan.
+
+The hmmpress step is required for hmmscan to work.
+</help>
+</tool>
b
diff -r 000000000000 -r c16d8db9338a hmmpress_wrapper.pl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hmmpress_wrapper.pl Mon Mar 05 22:43:09 2012 -0800
[
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+die("Infile, outfile, outdir required\n") unless @ARGV == 3;
+my ($infile, $outfile, $outdir)=@ARGV;
+
+# setup
+-d $outdir or mkdir($outdir) or die($!);
+symlink($infile,"$outdir/hmm");
+
+# create output header file
+open(IN, "<$infile") or die($!);
+open(OUT, ">$outfile") or die($!);
+my $ok=0;
+while (my $line=<IN>) {
+    if (!$ok) {
+        die("Invalid input file (HMMER3 format required)\n") unless $line =~ /^HMMER3/;
+        $ok=1;
+    } elsif ($line =~ /^HMM/) {
+        last;
+    } else {
+        print OUT $line;
+    }
+}
+close IN;
+close OUT;
+
+# hmmpress
+my $output=`hmmpress $outdir/hmm 2>&1`;
+if ($? != 0) {
+    $output="FAILED\n" unless $output;
+    die($output);
+}
+unlink("$outdir/hmm");
+my @output=split(/\n/, $output);
+print $output[1], "\n";
+exit;