Mercurial > repos > iuc > hgvsparser
comparison hgvsparser.xml @ 0:c12a4d187121 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hgvsparser/ commit f9deb29cdbd2d2a5f2f4fbd470b1078431a36ae0
| author | iuc |
|---|---|
| date | Fri, 07 Jun 2024 15:21:07 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:c12a4d187121 |
|---|---|
| 1 <tool id="hgvsparser" name="hgvsParseR" version="@VERSION@+galaxy@GALAXY_VERSION@" profile="20.09" | |
| 2 license="GPL-3.0" > | |
| 3 <description>parsing and building variant descriptor strings compliant with the HGVS standard</description> | |
| 4 <macros> | |
| 5 <token name="@VERSION@">0.1.0</token> | |
| 6 <token name="@GALAXY_VERSION@">0</token> | |
| 7 </macros> | |
| 8 <requirements> | |
| 9 <requirement type="package" version="4.0">r-base</requirement> | |
| 10 </requirements> | |
| 11 <required_files> | |
| 12 <include path="parseHGVS.R" /> | |
| 13 <include path="buildHGVS.R" /> | |
| 14 </required_files> | |
| 15 <command detect_errors="exit_code"><![CDATA[ | |
| 16 Rscript '$configscript' > tmp_output.csv | |
| 17 ]]> | |
| 18 </command> | |
| 19 <configfiles> | |
| 20 <configfile name="configscript"><![CDATA[ | |
| 21 input_file <- '$action_choice.input_file' | |
| 22 input_data <- read.csv(input_file, stringsAsFactors = FALSE) | |
| 23 #if $action_choice.do == "parse": | |
| 24 source('$__tool_directory__/parseHGVS.R') | |
| 25 #if $variant_format == "vcf": | |
| 26 values <- paste0("p.", input_data$'$pos_col') | |
| 27 #else: | |
| 28 values <- input_data$'$pos_col' | |
| 29 #end if | |
| 30 out_data <- parseHGVS(values) | |
| 31 result <- data.frame( | |
| 32 hgvs = out_data$'hgvs', | |
| 33 subject = out_data$'subject', | |
| 34 type = out_data$'type', | |
| 35 start = out_data$'start', | |
| 36 ancestral = out_data$'ancestral', | |
| 37 variant = out_data$'variant' | |
| 38 ) | |
| 39 #else if $action_choice.do == "build": | |
| 40 source('$__tool_directory__/buildHGVS.R') | |
| 41 result <- data.frame() | |
| 42 for (i in 1:nrow(input_data)) { | |
| 43 startPos <- input_data$'$startPos'[i] | |
| 44 startAA <- input_data$'$startAA'[i] | |
| 45 endAA <- input_data$'$endAA'[i] | |
| 46 #if $variant_format == "vcf": | |
| 47 builder <- new.hgvs.builder.p(1) | |
| 48 result_build <- sub("^p\\.", "", with(builder, substitution(startPos, startAA, endAA))) | |
| 49 #else if $variant_format == "classic": | |
| 50 builder <- new.hgvs.builder.p(1) | |
| 51 result_build <- with(builder, substitution(startPos, startAA, endAA)) | |
| 52 #else: | |
| 53 builder <- new.hgvs.builder.p(3) | |
| 54 result_build <- with(builder, substitution(startPos, startAA, endAA)) | |
| 55 #end if | |
| 56 result_row <- cbind(input_data[i, ], result_build) | |
| 57 result <- rbind(result, result_row) | |
| 58 } | |
| 59 #end if | |
| 60 write.csv(result, file = "tmp_output.csv", row.names = FALSE, na="") | |
| 61 ]]> | |
| 62 </configfile> | |
| 63 </configfiles> | |
| 64 <inputs> | |
| 65 <conditional name="action_choice"> | |
| 66 <param name="do" type="select" label="Choose the action" > | |
| 67 <option value="parse" selected="true">parse</option> | |
| 68 <option value="build">build</option> | |
| 69 </param> | |
| 70 <when value="parse" > | |
| 71 <param name="input_file" type="data" format="csv" label="Input file" help="File containing column with variant descriptor strings" /> | |
| 72 <param name="pos_col" type="select" label="Variant descriptor column" help="The name of the column in the file that contains the variant descriptor, e.g. p.Glu214aAla (HGVS notation), p.A435D (classic notation), A435D (amino acid change descriptor format used in VCF)"> | |
| 73 <options> | |
| 74 <filter type="data_meta" ref="input_file" key="column_names"/> | |
| 75 </options> | |
| 76 </param> | |
| 77 </when> | |
| 78 <when value="build"> | |
| 79 <param name="input_file" type="data" format="csv" label="Input file" help="File containing columns with mutation position, ancestral amino acid, and variant amino acid" /> | |
| 80 <param name="startPos" type="select" label="Mutation position"> | |
| 81 <options> | |
| 82 <filter type="data_meta" ref="input_file" key="column_names"/> | |
| 83 </options> | |
| 84 </param> | |
| 85 <param name="startAA" type="select" label="Ancestral amino acid"> | |
| 86 <options> | |
| 87 <filter type="data_meta" ref="input_file" key="column_names"/> | |
| 88 </options> | |
| 89 </param> | |
| 90 <param name="endAA" type="select" label="Variant amino acid"> | |
| 91 <options> | |
| 92 <filter type="data_meta" ref="input_file" key="column_names"/> | |
| 93 </options> | |
| 94 </param> | |
| 95 </when> | |
| 96 </conditional> | |
| 97 <param name="variant_format" type="select" label="Variant descriptor format" help="For parsing: choose the format to parse. For building: choose the desired format for the result, regardless of the input format."> | |
| 98 <option value="hgvs" selected="true">HGVS (e.g., p.Glu214aAla)</option> | |
| 99 <option value="classic">classic (e.g., p.A435D)</option> | |
| 100 <option value="vcf">Amino Acid Change used in VCF (e.g., A435D)</option> | |
| 101 </param> | |
| 102 </inputs> | |
| 103 <outputs> | |
| 104 <data name="outfile_parsed" format="csv" from_work_dir="tmp_output.csv" label="parseHGVS result on ${on_string}"> | |
| 105 <filter>action_choice['do'] == 'parse'</filter> | |
| 106 </data> | |
| 107 <data name="outfile_built" format="csv" from_work_dir="tmp_output.csv" label="buildHGVS result on ${on_string}"> | |
| 108 <filter>action_choice['do'] == 'build'</filter> | |
| 109 </data> | |
| 110 </outputs> | |
| 111 <tests> | |
| 112 <test expect_num_outputs="1"> | |
| 113 <!--test 1: parse--> | |
| 114 <param name="variant_format" value="hgvs"/> | |
| 115 <conditional name="action_choice"> | |
| 116 <param name="do" value="parse"/> | |
| 117 <param name="input_file" value="inputParser.csv"/> | |
| 118 <param name="pos_col" value="hgvs_pro"/> | |
| 119 </conditional> | |
| 120 <output name="outfile_parsed" ftype="csv"> | |
| 121 <assert_contents> | |
| 122 <has_text text="ancestral"/> | |
| 123 </assert_contents> | |
| 124 </output> | |
| 125 </test> | |
| 126 <test expect_num_outputs="1"> | |
| 127 <!--test 2: build--> | |
| 128 <param name="variant_format" value="hgvs"/> | |
| 129 <conditional name="action_choice"> | |
| 130 <param name="do" value="build"/> | |
| 131 <param name="input_file" value="inputBuilder.csv"/> | |
| 132 <param name="startPos" value="start"/> | |
| 133 <param name="startAA" value="ancestral"/> | |
| 134 <param name="endAA" value="variant"/> | |
| 135 </conditional> | |
| 136 <output name="outfile_built" ftype="csv"> | |
| 137 <assert_contents> | |
| 138 <has_text text="build"/> | |
| 139 </assert_contents> | |
| 140 </output> | |
| 141 </test> | |
| 142 </tests> | |
| 143 <help><![CDATA[ | |
| 144 **What it does** | |
| 145 | |
| 146 This tool parses and builds variant descriptor strings compliant with the HGVS standard. | |
| 147 | |
| 148 ]]></help> | |
| 149 <citations> | |
| 150 <citation type="doi">10.1186/s13059-019-1845-6</citation> | |
| 151 </citations> | |
| 152 </tool> |
