comparison ideas.xml @ 65:e29e083ebef7 draft

Uploaded
author greg
date Thu, 24 Aug 2017 07:57:30 -0400
parents 19112fe6e5bd
children dc5d5a08c370
comparison
equal deleted inserted replaced
64:19112fe6e5bd 65:e29e083ebef7
7 <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement> 7 <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement>
8 <requirement type="package" version="1.2.0">ideas</requirement> 8 <requirement type="package" version="1.2.0">ideas</requirement>
9 <requirement type="package" version="1.3.2">r-optparse</requirement> 9 <requirement type="package" version="1.3.2">r-optparse</requirement>
10 </requirements> 10 </requirements>
11 <command detect_errors="exit_code"><![CDATA[ 11 <command detect_errors="exit_code"><![CDATA[
12 #set tmp_dir = "tmp" 12 #import os
13 #set prep_output_config = "prep_output_config.txt" 13 #set tmp_dir = 'tmp'
14 #set prep_output_config = 'prep_output_config.txt'
15 ##set ideas_input_dir = 'ideas_input'
16 ##set ideas_matrix_input_file = $os.path.join($ideas_input_dir, 'r_matrix.txt')
17 ##mkdir -p $ideas_input_dir &&
14 ############################################## 18 ##############################################
15 ## Create the config file and prepare the data 19 ## Create the config file and prepare the data
16 ############################################## 20 ##############################################
17 #set input_type = $input_type_cond.input_type 21 #set input_type = $input_type_cond.input_type
18 #if str($input_type) == "datasets": 22 cp '$prep_input_config' 'prep_input_config.txt' &&
19 #set cell_type_epigenetic_factor_cond = $input_type_cond.cell_type_epigenetic_factor_cond 23 prepMat
20 #set cell_type_epigenetic_factor = $cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor 24 #if str($input_type) == 'datasets':
25 '$prep_input_config'
21 #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond 26 #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond
22 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window 27 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window
23 cp '$gen_prep_input_config' "prep_input_config.txt" && 28 #if str($specify_genomic_window) == 'yes':
24 prepMat
25 '$gen_prep_input_config'
26 #if str($specify_genomic_window) == "yes":
27 -bed '$specify_genomic_window_cond.bed_input' 29 -bed '$specify_genomic_window_cond.bed_input'
28 #else: 30 #else:
29 -gsz '$chromInfo' 31 -gsz '$chromInfo'
30 -wsz $specify_genomic_window_cond.window_size 32 -wsz $specify_genomic_window_cond.window_size
31 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes 33 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes
32 #if str($restrict_chromosomes) == "yes": 34 #if str($restrict_chromosomes) == 'yes':
33 #set chroms = [] 35 #set chroms = []
34 #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat 36 #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat
35 #for $i in $chrom_repeat.chrom 37 #for $i in $chrom_repeat.chrom
36 $chroms.append($i) 38 $chroms.append($i)
37 #end for 39 #end for
39 #end if 41 #end if
40 #end if 42 #end if
41 #end if 43 #end if
42 $bychr 44 $bychr
43 -c $reads_per_bp 45 -c $reads_per_bp
44 #if str($blacklist_input) not in ["None", ""]: 46 #if str($blacklist_input) not in ['None', '']:
45 -exclude '$blacklist_input' 47 -exclude '$blacklist_input'
46 #end if 48 #end if
47 $norm 49 $norm
48 ############################################## 50 ##############################################
49 ## Coerce the prepMat config output to the 51 ## Coerce the prepMat config output to the
50 ## format expected by the R matrix builder. 52 ## format expected by the R matrix builder.
51 ############################################## 53 ##############################################
52 && cut -d' ' '$gen_prep_input_config' -f1,2 > file1.txt 54 && cut -d' ' $prep_input_config -f1,2 > file1.txt
53 && ls tmp/*.bed.gz > file2.txt 55 && ls tmp/*.bed.gz > file2.txt
54 && paste <(cat file1.txt) <(cat file2.txt) > $prep_output_config 56 && paste <(cat file1.txt) <(cat file2.txt) > $prep_output_config
55 ############################################## 57 ##############################################
56 ## Build the R matrix from the prepMat output 58 ## Build the R matrix from the prepMat output
57 ############################################## 59 ##############################################
62 ############################################## 64 ##############################################
63 ## Run IDEAS 65 ## Run IDEAS
64 ############################################## 66 ##############################################
65 && ideas 67 && ideas
66 '$prep_output_config' 68 '$prep_output_config'
67 #if str($input_type) == "datasets": 69 #if str($input_type) == 'datasets':
68 #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond 70 #set specify_genomic_window_cond = $input_type_cond.specify_genomic_window_cond
69 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window 71 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window
70 #if str($specify_genomic_window) == "yes": 72 #if str($specify_genomic_window) == 'yes':
71 '$specify_genomic_window_cond.bed_input' 73 '$specify_genomic_window_cond.bed_input'
72 #else: 74 #else:
73 $tmp_dir/*.bed 75 $tmp_dir/*.bed
74 #end if 76 #end if
75 #else: 77 #else:
76 $tmp_dir/*.bed 78 $tmp_dir/*.bed
77 #end if 79 #end if
78 $hp 80 $hp
79 #if str($log2) != "0.0": 81 #if str($log2) != '0.0':
80 -log2 $log2 82 -log2 $log2
81 #end if 83 #end if
82 #if str($max_states) != "0.0": 84 #if str($max_states) != '0.0':
83 -G $max_states 85 -G $max_states
84 #end if 86 #end if
85 #if str($initial_states) != "0": 87 #if str($initial_states) != '0':
86 -C $initial_states 88 -C $initial_states
87 #end if 89 #end if
88 #if str($max_position_classes) != "0": 90 #if str($max_position_classes) != '0':
89 -P $max_position_classes 91 -P $max_position_classes
90 #end if 92 #end if
91 #if str($max_cell_type_clusters) != "0": 93 #if str($max_cell_type_clusters) != '0':
92 -K $max_cell_type_clusters 94 -K $max_cell_type_clusters
93 #end if 95 #end if
94 #if str($prior_concentration) != "0.0": 96 #if str($prior_concentration) != '0.0':
95 -A $prior_concentration 97 -A $prior_concentration
96 #end if 98 #end if
97 -sample $burnin_num $mcmc_num 99 -sample $burnin_num $mcmc_num
98 #if str($minerr) != "0.0": 100 #if str($minerr) != '0.0':
99 -minerr $minerr 101 -minerr $minerr
100 #end if 102 #end if
101 #if str($maxerr) != "0.0": 103 #if str($maxerr) != '0.0':
102 -maxerr $maxerr 104 -maxerr $maxerr
103 #end if 105 #end if
104 -thread \${GALAXY_SLOTS:-4} 106 -thread \${GALAXY_SLOTS:-4}
105 > $output_log 107 > $output_log
106 && mv ./*.cluster $output_cluster 108 && mv ./*.cluster $output_cluster
107 && mv ./*.para $output_para 109 && mv ./*.para $output_para
108 && mv ./*.profile $output_profile 110 && mv ./*.profile $output_profile
109 && mv ./*.state $output_state 111 && mv ./*.state $output_state
110 ]]></command> 112 ]]></command>
111 <configfiles> 113 <configfiles>
112 <configfile name="gen_prep_input_config"><![CDATA[ 114 <configfile name="prep_input_config"><![CDATA[#for $input_items in $input_type_cond.input_repeat:
113 #import os
114 #if $input_type_cond.cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor == "manual":
115 #for $input_items in $input_type_cond.cell_type_epigenetic_factor_cond.input_repeat:
116 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} 115 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input}
117 #end for 116 #end for ]]></configfile>
118 #else if $input_type_cond.cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor == "extract":
119 #set $cell_type_epigenetic_factor_cond = $input_type_cond.cell_type_epigenetic_factor_cond
120 #set $input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions
121 #for $i in $cell_type_epigenetic_factor_cond.input:
122 #set $file_name_with_ext = $os.path.basename($i)
123 #set $file_name = $file_name_with_ext.split(".")[0]
124 #if $input_name_positions == "cell_first":
125 #set $cell_type_name = $file_name.split("-")[0]
126 #set $epigenetic_factor_name = $file_name.split("-")[1]
127 #else:
128 #set $cell_type_name = $file_name.split("-")[1]
129 #set $epigenetic_factor_name = $file_name.split("-")[0]
130 #end if
131 ${cell_type_name} ${epigenetic_factor_name} ${i}
132 #end for
133 #end if]]></configfile>
134 </configfiles> 117 </configfiles>
135 <inputs> 118 <inputs>
136 <conditional name="input_type_cond"> 119 <conditional name="input_type_cond">
137 <param name="input_type" type="select" label="Select input type"> 120 <param name="input_type" type="select" label="Select input type">
138 <option value="datasets" selected="true">Bam, BigWig files</option> 121 <option value="datasets" selected="true">Bam, BigWig files</option>
139 <option value="data_matrix">Data matrix</option> 122 <option value="data_matrix">Data matrix</option>
140 </param> 123 </param>
141 <when value="datasets"> 124 <when value="datasets">
142 <conditional name="cell_type_epigenetic_factor_cond"> 125 <repeat name="input_repeat" title="Cell type, Epigenetic factor and Input" min="1">
143 <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> 126 <param name="cell_type_name" type="text" value="" label="Cell type name">
144 <option value="extract" selected="true">extracting them from the selected input file names</option> 127 <validator type="empty_field"/>
145 <option value="manual">manually setting them for each selected input</option> 128 </param>
146 </param> 129 <param name="epigenetic_factor_name" type="text" value="" label="Epigenetic factor name">
147 <when value="extract"> 130 <validator type="empty_field"/>
148 <param name="input" type="data" format="bigwig,bam" multiple="True" label="BAM or BigWig file"> 131 </param>
149 <validator type="empty_field"/> 132 <param name="input" type="data" format="bigwig,bam" label="BAM or BigWig file">
150 <validator type="unspecified_build"/> 133 <validator type="empty_field"/>
151 </param> 134 <validator type="unspecified_build"/>
152 <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"> 135 </param>
153 <option value="cell_first" selected="true">Cell type name - Epigenetic factor name</option> 136 </repeat>
154 <option value="cell_last">Epigenetic factor name - Cell type name</option>
155 </param>
156 </when>
157 <when value="manual">
158 <repeat name="input_repeat" title="Cell type, Epigenetic factor and Input" min="1">
159 <param name="cell_type_name" type="text" value="" label="Cell type name">
160 <validator type="empty_field"/>
161 </param>
162 <param name="epigenetic_factor_name" type="text" value="" label="Epigenetic factor name">
163 <validator type="empty_field"/>
164 </param>
165 <param name="input" type="data" format="bigwig,bam" label="BAM or BigWig file">
166 <validator type="empty_field"/>
167 <validator type="unspecified_build"/>
168 </param>
169 </repeat>
170 </when>
171 </conditional>
172 <conditional name="specify_genomic_window_cond"> 137 <conditional name="specify_genomic_window_cond">
173 <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data"> 138 <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data">
174 <option value="no" selected="true">No</option> 139 <option value="no" selected="true">No</option>
175 <option value="yes">Yes</option> 140 <option value="yes">Yes</option>
176 </param> 141 </param>