diff ideas.xml @ 65:e29e083ebef7 draft

Uploaded
author greg
date Thu, 24 Aug 2017 07:57:30 -0400
parents 19112fe6e5bd
children dc5d5a08c370
line wrap: on
line diff
--- a/ideas.xml	Thu Aug 24 07:54:16 2017 -0400
+++ b/ideas.xml	Thu Aug 24 07:57:30 2017 -0400
@@ -9,27 +9,29 @@
         <requirement type="package" version="1.3.2">r-optparse</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-#set tmp_dir = "tmp"
-#set prep_output_config = "prep_output_config.txt"
+#import os
+#set tmp_dir = 'tmp'
+#set prep_output_config = 'prep_output_config.txt'
+##set ideas_input_dir = 'ideas_input'
+##set ideas_matrix_input_file = $os.path.join($ideas_input_dir, 'r_matrix.txt')
+##mkdir -p $ideas_input_dir &&
 ##############################################
 ## Create the config file and prepare the data
 ##############################################
 #set input_type = $input_type_cond.input_type
-#if str($input_type) == "datasets":
-    #set cell_type_epigenetic_factor_cond = $input_type_cond.cell_type_epigenetic_factor_cond
-    #set cell_type_epigenetic_factor = $cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor
+cp '$prep_input_config' 'prep_input_config.txt' &&
+prepMat
+#if str($input_type) == 'datasets':
+    '$prep_input_config'
     #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond
     #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window
-    cp '$gen_prep_input_config' "prep_input_config.txt" &&
-    prepMat
-    '$gen_prep_input_config'
-    #if str($specify_genomic_window) == "yes":
+    #if str($specify_genomic_window) == 'yes':
         -bed '$specify_genomic_window_cond.bed_input'
     #else:
         -gsz '$chromInfo'
         -wsz $specify_genomic_window_cond.window_size
         #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes
-        #if str($restrict_chromosomes) == "yes":
+        #if str($restrict_chromosomes) == 'yes':
             #set chroms = []
             #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat
             #for $i in $chrom_repeat.chrom
@@ -41,7 +43,7 @@
 #end if
 $bychr
 -c $reads_per_bp
-#if str($blacklist_input) not in ["None", ""]:
+#if str($blacklist_input) not in ['None', '']:
     -exclude '$blacklist_input'
 #end if
 $norm
@@ -49,7 +51,7 @@
 ## Coerce the prepMat config output to the
 ## format expected by the R matrix builder.
 ##############################################
-&& cut -d' ' '$gen_prep_input_config' -f1,2 > file1.txt
+&& cut -d' ' $prep_input_config -f1,2 > file1.txt
 && ls tmp/*.bed.gz > file2.txt
 && paste <(cat file1.txt) <(cat file2.txt) > $prep_output_config
 ##############################################
@@ -64,10 +66,10 @@
 ##############################################
 && ideas
 '$prep_output_config'
-#if str($input_type) == "datasets":
+#if str($input_type) == 'datasets':
     #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond
     #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window
-    #if str($specify_genomic_window) == "yes":
+    #if str($specify_genomic_window) == 'yes':
         '$specify_genomic_window_cond.bed_input'
     #else:
         $tmp_dir/*.bed
@@ -76,29 +78,29 @@
     $tmp_dir/*.bed
 #end if
 $hp
-#if str($log2) != "0.0":
+#if str($log2) != '0.0':
     -log2 $log2
 #end if
-#if str($max_states) != "0.0":
+#if str($max_states) != '0.0':
     -G $max_states
 #end if
-#if str($initial_states) != "0":
+#if str($initial_states) != '0':
     -C $initial_states
 #end if
-#if str($max_position_classes) != "0":
+#if str($max_position_classes) != '0':
     -P $max_position_classes
 #end if
-#if str($max_cell_type_clusters) != "0":
+#if str($max_cell_type_clusters) != '0':
     -K $max_cell_type_clusters
 #end if
-#if str($prior_concentration) != "0.0":
+#if str($prior_concentration) != '0.0':
     -A $prior_concentration
 #end if
 -sample $burnin_num $mcmc_num
-#if str($minerr) != "0.0":
+#if str($minerr) != '0.0':
     -minerr $minerr
 #end if
-#if str($maxerr) != "0.0":
+#if str($maxerr) != '0.0':
     -maxerr $maxerr
 #end if
 -thread \${GALAXY_SLOTS:-4}
@@ -109,28 +111,9 @@
 && mv ./*.state $output_state
     ]]></command>
     <configfiles>
-        <configfile name="gen_prep_input_config"><![CDATA[
-#import os
-#if $input_type_cond.cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor == "manual":
-    #for $input_items in $input_type_cond.cell_type_epigenetic_factor_cond.input_repeat:
+        <configfile name="prep_input_config"><![CDATA[#for $input_items in $input_type_cond.input_repeat:
 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input}
-    #end for
-#else if $input_type_cond.cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor == "extract":
-    #set $cell_type_epigenetic_factor_cond = $input_type_cond.cell_type_epigenetic_factor_cond
-    #set $input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions
-    #for $i in $cell_type_epigenetic_factor_cond.input:
-        #set $file_name_with_ext = $os.path.basename($i)
-        #set $file_name = $file_name_with_ext.split(".")[0]
-        #if $input_name_positions == "cell_first":
-            #set $cell_type_name = $file_name.split("-")[0]
-            #set $epigenetic_factor_name = $file_name.split("-")[1]
-        #else:
-            #set $cell_type_name = $file_name.split("-")[1]
-            #set $epigenetic_factor_name = $file_name.split("-")[0]
-        #end if
-${cell_type_name} ${epigenetic_factor_name} ${i}
-    #end for
-#end if]]></configfile>
+#end for ]]></configfile>
     </configfiles>
     <inputs>
         <conditional name="input_type_cond">
@@ -139,36 +122,18 @@
                 <option value="data_matrix">Data matrix</option>
             </param>
             <when value="datasets">
-                <conditional name="cell_type_epigenetic_factor_cond">
-                    <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by">
-                        <option value="extract" selected="true">extracting them from the selected input file names</option>
-                        <option value="manual">manually setting them for each selected input</option>
+                <repeat name="input_repeat" title="Cell type, Epigenetic factor and Input" min="1">
+                    <param name="cell_type_name" type="text" value="" label="Cell type name">
+                        <validator type="empty_field"/>
                     </param>
-                    <when value="extract">
-                        <param name="input" type="data" format="bigwig,bam" multiple="True" label="BAM or BigWig file">
-                            <validator type="empty_field"/>
-                            <validator type="unspecified_build"/>
-                        </param>
-                        <param name="input_name_positions" type="select" display="radio" label="Selected input file name pattern is" help="A '-' character must separate cell type and epigenetic factor names within the selected input file names">
-                            <option value="cell_first" selected="true">Cell type name - Epigenetic factor name</option>
-                            <option value="cell_last">Epigenetic factor name - Cell type name</option>
-                        </param>
-                    </when>
-                    <when value="manual">
-                        <repeat name="input_repeat" title="Cell type, Epigenetic factor and Input" min="1">
-                            <param name="cell_type_name" type="text" value="" label="Cell type name">
-                                <validator type="empty_field"/>
-                            </param>
-                            <param name="epigenetic_factor_name" type="text" value="" label="Epigenetic factor name">
-                                <validator type="empty_field"/>
-                            </param>
-                            <param name="input" type="data" format="bigwig,bam" label="BAM or BigWig file">
-                                <validator type="empty_field"/>
-                                <validator type="unspecified_build"/>
-                            </param>
-                        </repeat>
-                    </when>
-                </conditional>
+                    <param name="epigenetic_factor_name" type="text" value="" label="Epigenetic factor name">
+                        <validator type="empty_field"/>
+                    </param>
+                    <param name="input" type="data" format="bigwig,bam" label="BAM or BigWig file">
+                        <validator type="empty_field"/>
+                        <validator type="unspecified_build"/>
+                    </param>
+                </repeat>
                 <conditional name="specify_genomic_window_cond">
                     <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data">
                         <option value="no" selected="true">No</option>