Repository 'gemini_annotate'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/gemini_annotate

Changeset 6:0c8f7322f8fc (2019-01-18)
Previous changeset 5:08f57a8502e4 (2019-01-11) Next changeset 7:567837ca5f33 (2020-01-24)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/gemini commit 29750462f6e725177dc5617c14ba28bcaeed9794
modified:
gemini_annotate.xml
b
diff -r 08f57a8502e4 -r 0c8f7322f8fc gemini_annotate.xml
--- a/gemini_annotate.xml Fri Jan 11 17:41:39 2019 -0500
+++ b/gemini_annotate.xml Fri Jan 18 19:34:41 2019 -0500
[
b'@@ -1,8 +1,16 @@\n-<tool id="gemini_@BINARY@" name="GEMINI @BINARY@" version="@VERSION@">\n-    <description>adding your own custom annotations</description>\n+<tool id="gemini_@BINARY@" name="GEMINI @BINARY@" version="@VERSION@+galaxy1">\n+    <description>the variants in an existing GEMINI database with additional information</description>\n     <macros>\n         <import>gemini_macros.xml</import>\n         <token name="@BINARY@">annotate</token>\n+        <xml name="add_as">\n+            <param argument="-c" name="column_name" type="text" value=""\n+            label="Database column name to use for recording annotations"\n+            help="A column with the name provided here will be added to the variants table of the GEMINI database to store the annotations">\n+                <validator type="empty_field" />\n+                <validator type="expression" message="Only alphanumeric characters and the underscore can be used in column names">value.replace(\'_\', \'\').isalnum()</validator>\n+            </param>\n+        </xml>\n     </macros>\n     <expand macro="requirements" />\n     <expand macro="stdio" />\n@@ -18,73 +26,86 @@\n \n     gemini @BINARY@\n         -f \'$tabixed_file\'\n-        -c \'$column_name\'\n         -a $a.a_selector\n         #if $a.a_selector == \'extract\':\n-            -t $a.column_type\n-            -e \'$a.column_extracts\'\n-            -o $a.operation\n+            #set $types = []\n+            #set $elements = []\n+            #set $column_names = []\n+            #set $operations = []\n+            #for $action in $a.actions:\n+                $types.append(str($action.column_type))\n+                $elements.append(str($action.element_to_extract).strip())\n+                $column_names.append(str($action.column_name).strip())\n+                $operations.append(str($action.operation))\n+            #end for\n+\n+            -t #echo ",".join($types)\n+            -e \'#echo ",".join($elements)#\'\n+            -o #echo ",".join($operations)\n+            -c \'#echo ",".join($column_names)#\'\n+        #else:\n+            -c \'${a.column_name}\'\n         #end if\n-        $region_only\n+        #if str($annotate_source.ext) == "vcf":\n+            $region_only\n+        #end if\n         \'$outfile\'\n ]]>\n-\n     </command>\n     <inputs>\n         <expand macro="infile" />\n-        <param name="annotate_source" type="data" format="vcf,bed" label="File containing the annotations in BED/VCF format" help="(-f)"/>\n-\n-        <param name="column_name" type="text" value=""\n-            label="The name of the column to be added to the variant table" \n-            help="If the input file is a VCF, then this is the name of the info field to pull. (-c)">\n-            <sanitizer invalid_char=" ">\n-                <valid initial="string.letters,string.digits">\n-                    <add value="_" />\n-                </valid>\n-            </sanitizer>\n-        </param>\n+        <param argument="-f" name="annotate_source" type="data" format="vcf,bed"\n+        label="Dataset to use as the annotation source"\n+        help="The tool can use the information from a BED or VCF dataset to annotate the database variants."/>\n+        <param argument="--region-only" name="region_only" type="boolean" checked="true" truevalue="" falsevalue="--region-only"\n+        label="Strict variant-identity matching of database and annotation records (VCF format only)"\n+        help="The default is to consider VCF-formatted annotations only if a variant in the GEMINI database and a record in the annotation source describe the exact same nucleotide change at the same position in the genome. You can disable this option to make use of any annotation that overlaps with the position of a database variant. This setting is ignored for annotation sources in BED format, for which matching is always based on overlapping positions only." />\n         <conditional name="a">\n-            <param name="a_selector" type="select" label="How should the annotation file be used?" help="(-a)">\n-              '..b' the database, the average (**-o mean**) of the allele frequencies values from the VCF file will be used.\n-\n-At this point, one can query the database based on the values of the new other_allele_freq column (using **GEMINI query**).\n-\n-**-t TYPE - Specifying the column type(s) when using -a extract**\n-\n-The annotate tool will create three different types of columns via the **-t** option:\n-\n- 1) Floating point columns for annotations with decimal precision as above (-t float)\n- 2) Integer columns for integral annotations (-t integer)\n- 3) Text columns for string columns such as \xe2\x80\x9cvalid\xe2\x80\x9d, \xe2\x80\x9cyes\xe2\x80\x9d, etc. (-t text)\n-\n-  *The -t option is only valid when using the -a extract option.*\n-\n-**-o OPERATION - Specifying the summary operations when using -a extract**\n-\n-In the event of multiple overlaps between a variant and records in the annotation file, the annotate tool can summarize the values observed with multiple options:\n-\n-  - -o mean       Compute the average of the values. They must be numeric.\n-  - -o median     Compute the median of the values. They must be numeric.\n-  - -o min        Compute the minimum of the values. They must be numeric.\n-  - -o max        Compute the maximum of the values. They must be numeric.\n-  - -o mode       Compute the maximum of the values. They must be numeric.\n-  - -o first      Use the value from the first record in the annotation file.\n-  - -o last       Use the value from the last record in the annotation file.\n-  - -o list       Create a comma-separated list of the observed values.\n-  - -o uniq_list  Create a comma-separated list of the distinct observed values.\n-  - -o sum        Compute the sum of the values. They must be numeric.\n-\n-The -o option is only valid when using the -a extract option.\n-\n-**Annotating with VCF**\n-\n-Most of the examples to this point have pulled a column from a tabix indexed bed file. It is likewise possible to pull from the INFO field of a tabix index VCF. The syntax is identical but the **-e** operation will specify the names of fields in the INFO column to pull. By default, those names will be used, but that can still be specified with the **-c column**.\n-\n-To put a DP column in the db, set:\n-\n-  -o list, -e DP, -t integer\n-\n-... and name it \'depth\', set:\n-\n-  -o list, -e DP, -c depth, -t integer\n-\n-\n-Missing values are allowed since we expect that in some cases an annotation VCF will not have all INFO fields specified for all variants.\n-\n-*We recommend decomposing and normalizing variants before annotating. See Step 1. split, left-align, and trim variants for a detailed explanation of how to do this. To do that see the GEMINI* preprocessing_ *website.*\n-\n-**Extracting and populating multiple columns at once**\n-\n-One can also extract and populate multiple columns at once by providing comma-separated lists (no spaces) of column names (**-c**), types (**-t**), numbers (**-e**), and summary operations (**-o**). For example, recall that in the VCF example above, we created a *TABIX*\xe2\x80\x99ed BED file containg the allele frequency and depth values from the INFO field as the 4th and 5th columns in the BED, respectively.\n-\n-Instead of running the annotate tool twice (once for each column), we can run the tool once and load both columns in the same run. For example with settings:\n-\n-  - -a extract\n-  - -c other_allele_freq,other_depth\n-  - -t float,integer\n-  - -e 4,5\n-  - -o mean,max\n-\n-We can then use each of the new columns to filter variants with a *GEMINI query*:\n-\n-.. _preprocessing: https://gemini.readthedocs.org/en/latest/content/preprocessing.html#preprocess\n-\n+Given an existing GEMINI database and an annotation source in BED or VCF\n+format, the annotate tool will, for each variant in the variants table of the\n+database, screen for overlapping regions defined in the annotation source and\n+update one or more new columns of the variant record in the database based on\n+the result and the annotation found.\n     ]]></help>\n     <expand macro="citations"/>\n </tool>\n'