changeset 5:ceb05c9e6d0a draft

planemo upload for repository https://github.com/CPGRZA/cpgr_ancestry commit 919e9937cdb568591f89a412e22a1124bbb56f77-dirty
author sanbi-uwc
date Mon, 17 Sep 2018 06:06:18 -0400
parents 39e075021957
children 9edc0fb317f7
files shapeit_phase.xml tool-data/shapeit_ref.loc.sample tool_data_table_conf.xml.sample
diffstat 3 files changed, 44 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/shapeit_phase.xml	Fri Sep 14 17:18:14 2018 -0400
+++ b/shapeit_phase.xml	Mon Sep 17 06:06:18 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="shapeit_phase" name="shapeit_phase" version="0.4.0">
+<tool id="shapeit_phase" name="shapeit_phase" version="0.5.0">
     <description>genomic data with or without reference panel</description>
 
     <requirements>
@@ -9,23 +9,49 @@
     </stdio>
 
     <command><![CDATA[
-        #if str($use_ref_panel) == "use_ref_panel_yes" and str($use_ref_panel.ref_panel_from_table) == "ref_panel_from_table_yes" and str($input_files.input_type_select) == 'plink_bed_bim_fam_list':
-          # this is all expecting 1000GP-style reference data
+        #if str($use_ref_panel.use_ref_panel_select) == "use_ref_panel_yes" and str($use_ref_panel.ref_panel_from_table.ref_panel_from_table_select) == "ref_panel_from_table_yes" and str($input_files.input_type_select) == 'plink_bed_bim_fam_list':
           PART=`head -1 myfile.bim | cut -f1` && 
-          REF_DIR='${use_genetic_map.map_from_table.fields.path}' &&
-          REF_PREFIX='${use_genetic_map.map_from_table.fields.reference_prefix}' &&
-          if [ -f "\${REF_DIR}/\${REF_PREFIX}_\${PART}.hap.gz" ] \; then
-            HAP="\${REF_DIR}/\${REF_PREFIX}_\${PART}.hap.gz" &&
-            LEGEND="\${REF_DIR}/\${REF_PREFIX}_\${PART}.legend.gz" &&
-            SAMPLE="\${REF_DIR}/\${REF_PREFIX}.sample" ;
+          echo "Working on PART: $PART" &&
+          REF_DIR='${use_genetic_map.genetic_map_from_table.map_from_table.fields.path}' &&
+          REF_PREFIX='${use_genetic_map.genetic_map_from_table.map_from_table.fields.reference_prefix}' &&
+          SAMPLE_PREFIX="\$REF_DIR/${use_genetic_map.genetic_map_from_table.map_from_table.fields.sample_prefix}" &&
+          SAMPLE=`ls \$SAMPLE_PREFIX*.sample` &&
+          if [ ! -f "\$SAMPLE" ] ; then
+            echo "Failed to find valid sample file at \$SAMPLE" >&2 && 
+            exit 1 ;
           fi &&
-          MAP_PREFIX='${use_genetic_map.map_from_table.fields.map_prefix}' &&
-          MAP=`ls \${REF_DIR}/\${MAP_PREFIX}_\${PART}_*` &&
+          HAP="\${REF_DIR}/\${REF_PREFIX}\${PART}.hap.gz" &&
+          if [ -f "\$HAP" ] ; then
+            echo "Failed to find valid .hap file at \$HAP" >&2 &&
+            exit 1 ;
+          fi &&
+          LEGEND="\${REF_DIR}/\${REF_PREFIX}\${PART}.legend.gz" &&
+          if [ -f "\$LEGEND ] ; then 
+            echo "Failed to find valid .legend file at \$LEGEND" >&2 &&
+            exit 1 ;
+          fi &&
+          MAP_PREFIX='${use_genetic_map.genetic_map_from_table.map_from_table.fields.map_prefix}' &&
+          MAP=`ls \${REF_DIR}/\${MAP_PREFIX}\${PART}_*` &&
           if [ ! -f "\${MAP}" ] ; then
             echo "Failed to find valid map file at \${MAP}" >&2 &&
             exit 1 ; 
           fi &&
         #end if
+        #if $input_files.input_type_select == "plink_bed_bim_fam_list":
+          echo "COLLECTION NAME:" ${input_files.plink_bed_etc_list.name} &&
+          #for $dat in $input_files.plink_bed_etc_list:
+             echo NAME '${dat.name}' &&
+          #end for
+          ln -s '${input_files.plink_bed_etc_list[0]}' input.plink_bed &&
+          ln -s '${input_files.plink_bed_etc_list[1]}' input.plink_bim && 
+          ln -s '${input_files.plink_bed_etc_list[2]}' input.plink_fam &&
+          echo "BED file" &&
+          ls -l input.plink_bed &&
+          echo "BIM file" &&
+          head -2 input.plink_bim && 
+          echo "FAM file" &&
+          head -2 input.plink_fam &&
+        #end if
 
         shapeit
 
@@ -39,7 +65,7 @@
         #else if $input_files.input_type_select == "plink_bed_bim_fam":
           --input-bed ${input_files.plink_bed} ${input_files.plink_bim} ${input_files.plink_fam}
         #else if $input_files.input_type_select == "plink_bed_bim_fam_list":
-          --input-bed '${input_files.plink_bed_etc_list}[0]' '${input_files.plink_bed_etc_list}[1]' '${input_files.plink_bed_etc_list}[2]'
+          --input-bed input.plink_bed input.plink_bim input.plink_fam
         #else if $input_files.inputy_type_select == "oxford_gen_sample":
           --input-gen ${input_files.oxford_gen} ${input_files.oxford_sample}
           #if $input_files.oxford_threshold != "0.9":
@@ -48,9 +74,9 @@
         #end if
 
         #if $use_genetic_map.use_genetic_map_select == "use_genetic_map_yes":
-          #if $use_genetic_map.genetic_map_from_table_select == "genetic_map_from_table_yes":
+          #if $use_genetic_map.genetic_map_from_table.genetic_map_from_table_select == "genetic_map_from_table_yes":
             --input-map \$MAP
-          else:
+          #else:
             --input-map $use_genetic_map.genetic_map
           #end if
         #else if $use_genetic_map.rho != "0.0004":
@@ -58,7 +84,7 @@
         #end if
 
         #if $use_ref_panel.use_ref_panel_select == "use_ref_panel_yes":
-          #if $use_ref_panel.ref_panel_from_table_select == "ref_panel_from_table_yes":
+          #if $use_ref_panel.ref_panel_from_table.ref_panel_from_table_select == "ref_panel_from_table_yes":
             --input-ref \$HAP \$LEGEND \$SAMPLE
           #else
             --input-ref $use_ref_panel.ref_panel_from_table.ref_panel_haps $use_ref_panel.ref_panel_from_table.ref_panel_legend $use_ref_panel.ref_panel_from_table.ref_panel_sample
--- a/tool-data/shapeit_ref.loc.sample	Fri Sep 14 17:18:14 2018 -0400
+++ b/tool-data/shapeit_ref.loc.sample	Mon Sep 17 06:06:18 2018 -0400
@@ -1,7 +1,7 @@
 #This file lists the locations of SHAPEIT reference data connections
 #
-#<value>	<description>		<path>	<reference_file_prefix> <map_file_prefix>
+#<value>	<description>	<path>	<reference_file_prefix>	<map_file_prefix>	<sample_file_prefix>
 #
 #For example
 #
-#1000G_Phase3	1000 Genomes project haplotypes		/path/to/shapeit_ref/1000G  1000GP_Phase3_  genetic_map_
+#1000G_Phase3	1000 Genomes project haplotypes	/path/to/shapeit_ref/1000G	1000GP_Phase3_chr	genetic_map_chr	1000GP_Phase3
--- a/tool_data_table_conf.xml.sample	Fri Sep 14 17:18:14 2018 -0400
+++ b/tool_data_table_conf.xml.sample	Mon Sep 17 06:06:18 2018 -0400
@@ -1,6 +1,6 @@
 <tables>
     <table name="shapeit_ref" comment_char="#">
-        <columns>value, name, path, reference_prefix, map_prefix</columns>
+        <columns>value, name, path, reference_prefix, map_prefix, sample_prefix</columns>
         <file path="tool-data/shapeit_ref.loc" />
     </table>
 </tables>
\ No newline at end of file