Mercurial > repos > saskia-hiltemann > cgatools_v17
changeset 5:64017ce705b6 draft
planemo upload for repository https://bitbucket.org/EMCbioinf/galaxy-tool-shed-tools commit c475b4222a15cdadc6085865f4d13426249fec25-dirty
author | yhoogstrate |
---|---|
date | Wed, 11 Nov 2015 03:51:05 -0500 |
parents | 418343b53afd |
children | 3b532dc3864b |
files | datatypes_conf.xml lib/galaxy/datatypes/completegenomics.py lib/galaxy/datatypes/completegenomics.pyc tools/cgatools17/listvariants_v17.xml tools/cgatools17/testvariants_v17.xml |
diffstat | 5 files changed, 132 insertions(+), 101 deletions(-) [+] |
line wrap: on
line diff
--- a/datatypes_conf.xml Tue Nov 10 11:18:20 2015 -0500 +++ b/datatypes_conf.xml Wed Nov 11 03:51:05 2015 -0500 @@ -12,6 +12,7 @@ <datatype extension="cg_var" type="galaxy.datatypes.completegenomics:CG_Var" display_in_upload="true" /> <datatype extension="cg_mastervar" type="galaxy.datatypes.completegenomics:CG_MasterVar" display_in_upload="true" /> <datatype extension="cg_gene" type="galaxy.datatypes.completegenomics:CG_Gene" display_in_upload="true" /> + <datatype extension="crr" type="galaxy.datatypes.completegenomics:CRR" display_in_upload="true" /> <!-- End Complete Genomics Datatypes --> <!-- End of copied section --> </registration>
--- a/lib/galaxy/datatypes/completegenomics.py Tue Nov 10 11:18:20 2015 -0500 +++ b/lib/galaxy/datatypes/completegenomics.py Wed Nov 11 03:51:05 2015 -0500 @@ -14,6 +14,7 @@ from galaxy.datatypes import tabular from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.tabular import Tabular +from galaxy.datatypes.binary import Binary import galaxy_utils.sequence.vcf from galaxy.datatypes.sniff import * @@ -69,3 +70,15 @@ def display_peek( self, dataset ): """Returns formated html of peek""" return Tabular.make_html_table( self, dataset, column_names=self.column_names ) + +class CRR( Binary ): + file_ext = "crr" + + def sniff( self, filename ): + try: + header = open( filename ).read(4) + if binascii.b2a_hex( header ) == binascii.hexlify( 'CRR\n' ): + return True + return False + except: + return False
--- a/tools/cgatools17/listvariants_v17.xml Tue Nov 10 11:18:20 2015 -0500 +++ b/tools/cgatools17/listvariants_v17.xml Wed Nov 11 03:51:05 2015 -0500 @@ -1,75 +1,92 @@ <tool id="cg_listvariant" name="ListVariants" version="1.7.1"> - <description>Lists all variants present in CG var or masterVar file</description> + <description>Lists all variants present in CG var or masterVar file</description> + + <requirements> + <requirement type="package" version="1">cgatools17</requirement> + </requirements> - <requirements> - <requirement type="package" version="1">cgatools17</requirement> - </requirements> + <version_command>cgatools | head -1</version_command> + + <command> <!--run executable--> + cgatools + listvariants + --beta - <command> <!--run executable--> - echo \$PATH; - cgatools | head -1; - cgatools listvariants - --beta - --reference ${crr.fields.crr_path} - --output $output - #if $include_list.listing == "yes" <!--only added when yes--> - --variant-listing $include_list.list - #end if - $longvar - --variants - #for $v in $file_types.varfiles <!--get each var/mastervar file--> - ${v.input} - #end for + #if $reference_gene_sets_source.source_select == "indexed_filtered" + ${reference_gene_sets_source.crr.fields.crr_path} + #else if $reference_gene_sets_source.source_select == "history" + ${reference_gene_sets_source.crr} + #end if + + --output $output + #if $include_list.listing == "yes" <!--only added when yes--> + --variant-listing $include_list.list + #end if + $longvar + --variants + #for $v in $file_types.varfiles <!--get each var/mastervar file--> + ${v.input} + #end for - - </command> - - <inputs> - <!--form field to select crr file--> - <param name="crr" type="select" label="Reference genome (.crr file)"> - <options from_data_table="cg_anno_files" /> - </param> + </command> - <conditional name="file_types"> - <param name="file_type" type="select" label="Select the input file type"> - <option value="var" selected="true">var files</option> - <option value="mastervar">mastervar files</option> - </param> - <when value="var"> - <repeat name="varfiles" title="Variant files" min="1"> - <param name="input" type="data" format="cg_var" label="Dataset"/> - </repeat> - </when> - <when value="mastervar"> - <repeat name="varfiles" title="Variant files" min="1"> - <param name="input" type="data" format="cg_mastervar" label="Dataset"/> - </repeat> - </when> - </conditional> + <inputs> + <!--form field to select crr file--> + <conditional name="reference_gene_sets_source"> + <param name="source_select" type="select" label="GFF/GTF Source"> + <option value="indexed_filtered">Use a built-in index (which fits your reference)</option> + <option value="history">Use reference from the history</option> + </param> + <when value="indexed_filtered"> + <param name="crr" type="select" label="Reference Build"> + <options from_data_table="cg_anno_files" /> + </param> + </when> + <when value="history"> + <param name="crr" format="crr" type="data" label="Reference build" help="In crr format (you can use fasta2crr for conversion)" /> + </when> + </conditional> - <param name="longvar" type="select" label="List long variants?"> - <option value="" selected="true">no</option> - <option value="--list-long-variants">yes</option> - </param> + <conditional name="file_types"> + <param name="file_type" type="select" label="Select the input file type"> + <option value="var" selected="true">var files</option> + <option value="mastervar">mastervar files</option> + </param> + <when value="var"> + <repeat name="varfiles" title="Variant files" min="1"> + <param name="input" type="data" format="cg_var" label="Dataset"/> + </repeat> + </when> + <when value="mastervar"> + <repeat name="varfiles" title="Variant files" min="1"> + <param name="input" type="data" format="cg_mastervar" label="Dataset"/> + </repeat> + </when> + </conditional> - <conditional name="include_list"> - <param name="listing" type="select" label="Include variant listing?"> - <option value="no" selected="true">no</option> - <option value="yes">yes</option> - </param> - <when value="yes"> - <param name="list" type="data" format="tabular" label="Variant listing"/> - </when> - </conditional> - <param name="fname" type="text" value="" label="Prefix for your output file" help="Optional"/> - </inputs> + <param name="longvar" type="select" label="List long variants?"> + <option value="" selected="true">no</option> + <option value="--list-long-variants">yes</option> + </param> + + <conditional name="include_list"> + <param name="listing" type="select" label="Include variant listing?"> + <option value="no" selected="true">no</option> + <option value="yes">yes</option> + </param> + <when value="yes"> + <param name="list" type="data" format="tabular" label="Variant listing"/> + </when> + </conditional> + <param name="fname" type="text" value="" label="Prefix for your output file" help="Optional"/> + </inputs> - <outputs> - <data format="tabular" name="output" label="$fname ${tool.name} on ${on_string}"/> - </outputs> + <outputs> + <data format="tabular" name="output" label="$fname ${tool.name} on ${on_string}"/> + </outputs> - <help> + <help> **What it does** This tool uses the cgatools listvariants to list all called variants present in the var or mastervar files. @@ -82,50 +99,50 @@ **Command line reference**:: - COMMAND NAME - listvariants - Lists the variants present in a variant file. + COMMAND NAME + listvariants - Lists the variants present in a variant file. - DESCRIPTION - Lists all called variants present in the specified variant files, in a - format suitable for processing by the testvariants command. The output is a - tab-delimited file consisting of the following columns: - - variantId Sequential id assigned to each variant. - chromosome The chromosome of the variant. - begin 0-based reference offset of the beginning of the variant. - end 0-based reference offset of the end of the variant. - varType The varType as extracted from the variant file. - reference The reference sequence. - alleleSeq The variant allele sequence as extracted from the variant - file. - xRef The xRef as extrated from the variant file. + DESCRIPTION + Lists all called variants present in the specified variant files, in a + format suitable for processing by the testvariants command. The output is a + tab-delimited file consisting of the following columns: + + variantId Sequential id assigned to each variant. + chromosome The chromosome of the variant. + begin 0-based reference offset of the beginning of the variant. + end 0-based reference offset of the end of the variant. + varType The varType as extracted from the variant file. + reference The reference sequence. + alleleSeq The variant allele sequence as extracted from the variant + file. + xRef The xRef as extrated from the variant file. - OPTIONS - -h [ --help ] - Print this help message. + OPTIONS + -h [ --help ] + Print this help message. - --beta - This is a beta command. To run this command, you must pass the --beta - flag. + --beta + This is a beta command. To run this command, you must pass the --beta + flag. - --reference arg - The reference crr file. + --reference arg + The reference crr file. - --output arg (=STDOUT) - The output file (may be omitted for stdout). + --output arg (=STDOUT) + The output file (may be omitted for stdout). - --variants arg - The input variant files (may be positional args). + --variants arg + The input variant files (may be positional args). - --variant-listing arg - The output of another listvariants run, to be merged in to produce the - output of this run. + --variant-listing arg + The output of another listvariants run, to be merged in to produce the + output of this run. - --list-long-variants - In addition to listing short variants, list longer variants as well - (10's of bases) by concatenating nearby calls. + --list-long-variants + In addition to listing short variants, list longer variants as well + (10's of bases) by concatenating nearby calls. - SUPPORTED FORMAT_VERSION - 0.3 or later - </help> + SUPPORTED FORMAT_VERSION + 0.3 or later + </help> </tool>
--- a/tools/cgatools17/testvariants_v17.xml Tue Nov 10 11:18:20 2015 -0500 +++ b/tools/cgatools17/testvariants_v17.xml Wed Nov 11 03:51:05 2015 -0500 @@ -11,7 +11,7 @@ cgatools testvariants --beta --reference - + #if $reference_gene_sets_source.source_select == "indexed_filtered" ${reference_gene_sets_source.crr.fields.crr_path} #else if $reference_gene_sets_source.source_select == "history" @@ -30,7 +30,7 @@ <!--form field to select crr file--> <conditional name="reference_gene_sets_source"> - <param name="source_select" type="select" label="Genome reference (in complete genomics CRR format)" help="Some indexes are available at ftp://ftp.completegenomics.com/ReferenceFiles/"> + <param name="source_select" type="select" label="GFF/GTF Source"> <option value="indexed_filtered">Use a built-in index (which fits your reference)</option> <option value="history">Use reference from the history</option> </param>