diff plink.xml @ 10:2c0ac05fe240 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/plink commit 6d29c051fe8a6564805da7a13668d067c31f0e86
author iuc
date Tue, 14 Nov 2023 17:51:25 +0000
parents 272aca44b3dd
children
line wrap: on
line diff
--- a/plink.xml	Sun Dec 19 15:53:35 2021 +0000
+++ b/plink.xml	Tue Nov 14 17:51:25 2023 +0000
@@ -1,7 +1,8 @@
 <tool id='plink' name='plink' version='@TOOL_VERSION@+galaxy@VERSION_SUFFIX@'>
+    <description>genome association analysis toolset</description>
     <macros>
         <token name='@TOOL_VERSION@'>1.90b6.21</token>
-        <token name='@VERSION_SUFFIX@'>0</token>
+        <token name='@VERSION_SUFFIX@'>1</token>
         <xml name='template_sanitizer'>
             <sanitizer>
                 <valid initial='default'>
@@ -50,6 +51,7 @@
     </xrefs>
     <requirements>
         <requirement type='package' version='@TOOL_VERSION@'>plink</requirement>
+        <requirement type='package' version='5.3.0'>gawk</requirement>
     </requirements>
     <command detect_errors='exit_code'><![CDATA[
 
@@ -62,17 +64,17 @@
     #if $functions.func == 'data_manage':
         #if $functions.bmerge.set == 'Yes':
             && mkdir bmerge_files
-            && ln -s '$functions.bmerge.bed.extra_files_path'/RgeneticsData.bed bmerge_files/bmerge_input.bed
-            && ln -s '$functions.bmerge.bed.extra_files_path'/RgeneticsData.bim bmerge_files/bmerge_input.bim
-            && ln -s '$functions.bmerge.bed.extra_files_path'/RgeneticsData.fam bmerge_files/bmerge_input.fam
+            && ln -s '$functions.bmerge.bed.extra_files_path/RgeneticsData.bed' 'bmerge_files/bmerge_input.bed'
+            && ln -s '$functions.bmerge.bed.extra_files_path/RgeneticsData.bim' 'bmerge_files/bmerge_input.bim'
+            && ln -s '$functions.bmerge.bed.extra_files_path/RgeneticsData.fam' 'bmerge_files/bmerge_input.fam'
         #end if
     #end if
 
 
     #if $inputs.inputs.filetype == 'bfile':
-        && ln -s '$inputs.inputs.bed.extra_files_path'/RgeneticsData.bed plink_input/plink_input.bed
-        && ln -s '$inputs.inputs.bed.extra_files_path'/RgeneticsData.bim plink_input/plink_input.bim
-        && ln -s '$inputs.inputs.bed.extra_files_path'/RgeneticsData.fam plink_input/plink_input.fam
+        && ln -s '$inputs.inputs.bed.extra_files_path/RgeneticsData.bed' 'plink_input/plink_input.bed'
+        && ln -s '$inputs.inputs.bed.extra_files_path/RgeneticsData.bim' 'plink_input/plink_input.bim'
+        && ln -s '$inputs.inputs.bed.extra_files_path/RgeneticsData.fam' 'plink_input/plink_input.fam'
         && plink --bfile plink_input/plink_input
     #elif $inputs.inputs.filetype == 'vcf':
         #if $inputs.inputs.input.is_of_type('bcf'):
@@ -84,7 +86,7 @@
 
     ## Plink commands by section
     #if $inputs.covar_input:
-            --covar '$inputs.covar_input'
+        --covar '$inputs.covar_input'
     #end if
     #if $inputs.set_pheno.set_pheno == 'Yes':
         --pheno $inputs.set_pheno.pheno $inputs.set_pheno.all_pheno
@@ -232,7 +234,6 @@
             #end if
 
     #elif $functions.func == 'data_manage':
-
         #if $functions.bmerge.set == 'Yes':
             --bmerge bmerge_files/bmerge_input
         #end if
@@ -285,8 +286,6 @@
                 #end if
             #end if
         #end if
-
-
     #elif $functions.func == 'link':
         #if $functions.set_indep.choice == 'Yes':
             --indep-pairwise $functions.set_indep.window $functions.set_indep.step $functions.set_indep.r2
@@ -382,8 +381,8 @@
             #end if
         #end if
 
-##    #elif $functions.func == 'scoring':
-##
+    #elif $functions.func == 'scoring':
+        --score '$functions.score_file' $functions.variant_id_i $functions.allel_codes_j $functions.scores_k $functions.header $functions.sum
 ##    #else:
 ##        --rerun $functions.logfile
 ##      
@@ -410,9 +409,12 @@
         #end if
     #end if
     && mkdir '$plink_out.extra_files_path'
-    && cp plink_output/plink_output.bed '$plink_out.extra_files_path'/RgeneticsData.bed
-    && cp plink_output/plink_output.bim '$plink_out.extra_files_path'/RgeneticsData.bim
-    && cp plink_output/plink_output.fam '$plink_out.extra_files_path'/RgeneticsData.fam
+    && cp plink_output/plink_output.bed '$plink_out.extra_files_path/RgeneticsData.bed'
+    && cp plink_output/plink_output.bim '$plink_out.extra_files_path/RgeneticsData.bim'
+    && cp plink_output/plink_output.fam '$plink_out.extra_files_path/RgeneticsData.fam'
+    #if $functions.func == 'scoring':
+        && awk -v OFS="\t" '{$1=$1; print}' plink_output/plink_output.profile > plink_output/plink_output.profile.tab
+    #end if
     ]]></command>
     <inputs>
         <section name='inputs' title='Data inputs' expanded='true'>
@@ -450,6 +452,7 @@
                 <option value='stratification'>Population stratification</option>
                 <option value='association'>Association analysis</option>
                 <option value='ibd'>Identity-by-descent</option>
+                <option value='scoring'>Apply a linear scoring system (--score)</option>
                 <!-- <option value='rerun'>Rerun</option> -->
             </param>
             <when value='filtering'>
@@ -970,8 +973,20 @@
                 </conditional>
                 <param name='lambda' type='float' label='Lambda value' optional='true'/>
             </when>
-            <!-- <when value='scoring'>
-            </when> -->
+            <when value='scoring'>
+                <!-- this implements a part of the -\-score parameter -->
+                <param name='score_file' format='tabular' type='data' label='Scoring system which should be applied to all samples'/>
+                <param name="variant_id_i" type="data_column" data_ref="score_file" label="Variant ID column"/>
+                <param name="allel_codes_j" type="data_column" data_ref="score_file" label="Allel column"/>
+                <param name="scores_k" type="data_column" data_ref="score_file" label="Score column"/>
+                <param name='header' type='boolean' truevalue='header' falsevalue='' checked='false' label='Is a header line present in the scores file?'/>
+
+                <param name="sum" type="select" label="How to combine the valid per-variant scores?" help="Average is the default, but it can be changed to sum.">
+                    <option value="">Final scores are averages of the valid per-variant scores</option>
+                    <option value="sum">Report sums (sum; can not be used with 'no-mean-imputation'; is automatically on with dosage data)</option>
+                    <option value="no-sum">Disable sum (no-sum)</option>
+                </param>
+            </when>
             <when value='ibd'>
                 <conditional name='genome'>
                     <param name='output_genome' type='select' help='Perform and return results of IBS/IBD computation'>
@@ -1060,6 +1075,11 @@
             <filter>functions['func'] == 'ibd' and functions['genome']['output_genome']</filter>
         </data>
         
+        <!--scores-->
+        <data name='scores' format='tabular' from_work_dir='plink_output/plink_output.profile.tab' label='${tool.name}: Scores'>
+            <filter>functions['func'] == 'scoring'</filter>
+        </data>
+
         <!--Stratifiction-->
         <data name='mds' format='txt' from_work_dir='plink_output/plink_output.mds' label='${tool.name}: MDS'>
             <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and functions['cluster']['mds']['mds_scaling'] == 'Yes'</filter>
@@ -1203,6 +1223,7 @@
             <expand macro="log_out_assert"/>
         </test>
 
+        
         <test expect_num_outputs='8'>
             <section name='inputs'>
                 <conditional name='inputs'>
@@ -1393,6 +1414,30 @@
             <expand macro="log_out_assert"/>
             <output name='genome' file='out.genome'/>
         </test>
+        <!-- scoring function test-->
+        <test expect_num_outputs='3'>
+            <section name='inputs'>
+                <conditional name='inputs'>
+                    <param name='filetype' value='bfile'/>
+                    <param name='bed' value='' ftype="pbed">
+                        <composite_data value="plink.bim"/>
+                        <composite_data value="plink.bed"/>
+                        <composite_data value="plink.fam"/>
+                    </param>
+                </conditional>
+            </section>
+            <conditional name='functions'>
+                <param name='func' value='scoring'/>
+                <param name='score_file' value='scores_file.tab'/>
+                <param name='variant_id_i' value='1'/>
+                <param name='allel_codes_j' value='2'/>
+                <param name='scores_k' value='3'/>
+                <param name='header' value='true'/>
+                <param name='sum' value='sum'/>
+            </conditional>
+            <expand macro="log_out_assert"/>
+            <output name='scores' file='scores_results.tab'/>
+        </test>
     </tests>
     <help><![CDATA[
         PLINK is a free, open-source whole genome association analysis toolset, designed to perform a range of basic, large-scale analyses in a computationally efficient manner.