Mercurial > repos > greg > ideas
comparison ideas.xml @ 129:d064db60a06d draft
Uploaded
| author | greg |
|---|---|
| date | Wed, 22 Nov 2017 10:24:04 -0500 |
| parents | de93d8e8a096 |
| children | d088f25661d9 |
comparison
equal
deleted
inserted
replaced
| 128:de93d8e8a096 | 129:d064db60a06d |
|---|---|
| 7 <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement> | 7 <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement> |
| 8 <requirement type="package" version="1.20">ideas</requirement> | 8 <requirement type="package" version="1.20">ideas</requirement> |
| 9 <requirement type="package" version="1.4.4">r-optparse</requirement> | 9 <requirement type="package" version="1.4.4">r-optparse</requirement> |
| 10 </requirements> | 10 </requirements> |
| 11 <command detect_errors="exit_code"><![CDATA[ | 11 <command detect_errors="exit_code"><![CDATA[ |
| 12 #set window_positions_by_chrom = "window.inv" | |
| 13 #set output_pdf_dir = "output_pdf_dir" | 12 #set output_pdf_dir = "output_pdf_dir" |
| 14 #set output_txt_dir = "output_txt_dir" | 13 #set output_txt_dir = "output_txt_dir" |
| 15 #set tmp_dir = "tmp" | 14 #set tmp_dir = "tmp" |
| 16 #set prep_input_config = "prep_input_config.txt" | 15 #set prep_input_config = "prep_input_config.txt" |
| 17 #set prep_output_config = "prep_output_config.txt" | 16 #set prep_output_config = "prep_output_config.txt" |
| 24 cp '$gen_prep_input_config' $prep_input_config && | 23 cp '$gen_prep_input_config' $prep_input_config && |
| 25 prepMat | 24 prepMat |
| 26 $prep_input_config | 25 $prep_input_config |
| 27 #if str($specify_genomic_window) == "yes": | 26 #if str($specify_genomic_window) == "yes": |
| 28 -bed '$specify_genomic_window_cond.bed_input' | 27 -bed '$specify_genomic_window_cond.bed_input' |
| 29 #import collections | |
| 30 chroms = collections.OrderedDict() | |
| 31 #else: | 28 #else: |
| 32 -gsz '$chromInfo' | 29 -gsz '$chromInfo' |
| 33 -wsz $specify_genomic_window_cond.window_size | 30 -wsz $specify_genomic_window_cond.window_size |
| 34 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes | 31 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes |
| 35 #if str($restrict_chromosomes) == "yes": | 32 #if str($restrict_chromosomes) == "yes": |
| 58 ## If using a genomic window bed file, categorize | 55 ## If using a genomic window bed file, categorize |
| 59 ## the window positions by chromosome to enable | 56 ## the window positions by chromosome to enable |
| 60 ## the IDEAS -inv option. | 57 ## the IDEAS -inv option. |
| 61 ############################################## | 58 ############################################## |
| 62 #if str($specify_genomic_window) == "yes": | 59 #if str($specify_genomic_window) == "yes": |
| 63 $categorize_window_positions_by_chrom | 60 #import collections |
| 64 #for chrom, tup in $chroms.items(): | 61 #set window_positions_by_chroms = collections.OrderedDict() |
| 62 #for count, line in enumerate(open($specify_genomic_window_cond.bed_input.file_name, 'r')): | |
| 63 #set $line = $line.strip() | |
| 64 #if not $line or $line.startswith('#'): | |
| 65 #continue | |
| 66 #end if | |
| 67 #set items = $line.split('\t') | |
| 68 #if $items[0] in $window_positions_by_chroms: | |
| 69 #set tup = $window_positions_by_chroms[$items[0]] | |
| 70 #set $tup[1] += 1 | |
| 71 #set $window_positions_by_chroms[$items[0]] = $tup | |
| 72 #else: | |
| 73 #set $window_positions_by_chroms[$items[0]] = [$count, $count+1] | |
| 74 #end if | |
| 75 #end for | |
| 76 #for chrom, tup in $window_positions_by_chroms.items(): | |
| 65 && ideas | 77 && ideas |
| 66 '$prep_output_config' | 78 '$prep_output_config' |
| 67 $ideas_options | 79 '$specify_genomic_window_cond.bed_input' |
| 80 $hp | |
| 81 -inv $tup[0] $tup[1] | |
| 82 #if str($log2) != "0.0": | |
| 83 -log2 $log2 | |
| 84 #end if | |
| 85 #if str($max_states) != "0.0": | |
| 86 -G $max_states | |
| 87 #end if | |
| 88 #if str($initial_states) != "0": | |
| 89 -C $initial_states | |
| 90 #end if | |
| 91 #if str($max_position_classes) != "0": | |
| 92 -P $max_position_classes | |
| 93 #end if | |
| 94 #if str($max_cell_type_clusters) != "0": | |
| 95 -K $max_cell_type_clusters | |
| 96 #end if | |
| 97 #if str($prior_concentration) != "0.0": | |
| 98 -A $prior_concentration | |
| 99 #end if | |
| 100 -sample $burnin_num $mcmc_num | |
| 101 #if str($minerr) != "0.0": | |
| 102 -minerr $minerr | |
| 103 #end if | |
| 104 #if str($maxerr) != "0.0": | |
| 105 -maxerr $maxerr | |
| 106 #end if | |
| 107 -rseed $rseed | |
| 108 -thread \${GALAXY_SLOTS:-4} | |
| 109 -o '$project_name.$chrom' | |
| 110 #if str($save_ideas_log) == "yes": | |
| 111 >> $output_log | |
| 112 #else: | |
| 113 > /dev/null | |
| 114 #end if | |
| 68 #end for | 115 #end for |
| 69 #else: | 116 #else: |
| 70 && ideas | 117 && ideas |
| 71 '$prep_output_config' | 118 '$prep_output_config' |
| 72 $ideas_options | 119 $tmp_dir/*.bed |
| 73 && mv ./*.cluster '$output_txt_dir' | 120 $hp |
| 74 && mv ./*.para '$output_txt_dir' | 121 #if str($log2) != "0.0": |
| 75 && mv ./*.profile '$output_txt_dir' | 122 -log2 $log2 |
| 76 && mv ./*.state '$output_txt_dir' | 123 #end if |
| 124 #if str($max_states) != "0.0": | |
| 125 -G $max_states | |
| 126 #end if | |
| 127 #if str($initial_states) != "0": | |
| 128 -C $initial_states | |
| 129 #end if | |
| 130 #if str($max_position_classes) != "0": | |
| 131 -P $max_position_classes | |
| 132 #end if | |
| 133 #if str($max_cell_type_clusters) != "0": | |
| 134 -K $max_cell_type_clusters | |
| 135 #end if | |
| 136 #if str($prior_concentration) != "0.0": | |
| 137 -A $prior_concentration | |
| 138 #end if | |
| 139 -sample $burnin_num $mcmc_num | |
| 140 #if str($minerr) != "0.0": | |
| 141 -minerr $minerr | |
| 142 #end if | |
| 143 #if str($maxerr) != "0.0": | |
| 144 -maxerr $maxerr | |
| 145 #end if | |
| 146 -rseed $rseed | |
| 147 -thread \${GALAXY_SLOTS:-4} | |
| 77 -o '$project_name' | 148 -o '$project_name' |
| 78 #if str($save_ideas_log) == "yes": | 149 #if str($save_ideas_log) == "yes": |
| 79 > $output_log | 150 > $output_log |
| 80 #else: | 151 #else: |
| 81 > /dev/null | 152 > /dev/null |
| 82 #end if | 153 #end if |
| 83 && Rscript '$__tool_directory__/create_heatmap.R' | |
| 84 -i '$output_txt_dir' | |
| 85 -o '$output_pdf_dir' | |
| 86 #end if | 154 #end if |
| 155 && mv ./*.cluster '$output_txt_dir' | |
| 156 && mv ./*.para '$output_txt_dir' | |
| 157 && mv ./*.profile '$output_txt_dir' | |
| 158 && mv ./*.state '$output_txt_dir' | |
| 159 && Rscript '$__tool_directory__/create_heatmap.R' | |
| 160 -i '$output_txt_dir' | |
| 161 -o '$output_pdf_dir' | |
| 87 ]]></command> | 162 ]]></command> |
| 88 <configfiles> | 163 <configfiles> |
| 89 <configfile name="categorize_window_positions_by_chrom"><![CDATA[#with #open($specify_genomic_window_cond.bed_input, 'r') as fh: | |
| 90 #for count, line in enumerate($fh): | |
| 91 $line = $line.strip() | |
| 92 #if not $line or $line.startswith('#'): | |
| 93 #continue | |
| 94 items = $line.split('\t') | |
| 95 chrom = $items[0] | |
| 96 #if $chrom in $chroms: | |
| 97 tup = $chroms[$chrom] | |
| 98 $tup[1] += 1 | |
| 99 $chroms[$chrom] = $tup | |
| 100 else: | |
| 101 $chroms[$chrom] = [$count, $count+1]]]></configfile> | |
| 102 <configfile name="gen_prep_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": | 164 <configfile name="gen_prep_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": |
| 103 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions | 165 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions |
| 104 #for $i in $cell_type_epigenetic_factor_cond.input: | 166 #for $i in $cell_type_epigenetic_factor_cond.input: |
| 105 #set file_name_with_ext = $i.name | 167 #set file_name_with_ext = $i.name |
| 106 #assert str($file_name_with_ext).find("-") >= 0, "The selected input '%s' is invalid because it does not include the '-' character which is required when setting cell type and epigenetic factor names by extracting them from the input file names." % $file_name_with_ext | 168 #assert str($file_name_with_ext).find("-") >= 0, "The selected input '%s' is invalid because it does not include the '-' character which is required when setting cell type and epigenetic factor names by extracting them from the input file names." % $file_name_with_ext |
| 117 #else: | 179 #else: |
| 118 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: | 180 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: |
| 119 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} | 181 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} |
| 120 #end for | 182 #end for |
| 121 #end if]]></configfile> | 183 #end if]]></configfile> |
| 122 <configfile name="ideas_options"><![CDATA[#if str($specify_genomic_window) == "yes": | |
| 123 '$specify_genomic_window_cond.bed_input' | |
| 124 #else: | |
| 125 $tmp_dir/*.bed | |
| 126 #end if | |
| 127 $hp | |
| 128 #if str($log2) != "0.0": | |
| 129 -log2 $log2 | |
| 130 #end if | |
| 131 #if str($max_states) != "0.0": | |
| 132 -G $max_states | |
| 133 #end if | |
| 134 #if str($initial_states) != "0": | |
| 135 -C $initial_states | |
| 136 #end if | |
| 137 #if str($max_position_classes) != "0": | |
| 138 -P $max_position_classes | |
| 139 #end if | |
| 140 #if str($max_cell_type_clusters) != "0": | |
| 141 -K $max_cell_type_clusters | |
| 142 #end if | |
| 143 #if str($prior_concentration) != "0.0": | |
| 144 -A $prior_concentration | |
| 145 #end if | |
| 146 -sample $burnin_num $mcmc_num | |
| 147 #if str($minerr) != "0.0": | |
| 148 -minerr $minerr | |
| 149 #end if | |
| 150 #if str($maxerr) != "0.0": | |
| 151 -maxerr $maxerr | |
| 152 #end if | |
| 153 -rseed $rseed | |
| 154 -thread \${GALAXY_SLOTS:-4}]]></configfile> | |
| 155 </configfiles> | 184 </configfiles> |
| 156 <inputs> | 185 <inputs> |
| 157 <conditional name="cell_type_epigenetic_factor_cond"> | 186 <conditional name="cell_type_epigenetic_factor_cond"> |
| 158 <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> | 187 <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> |
| 159 <option value="extract" selected="true">extracting them from the selected input file names</option> | 188 <option value="extract" selected="true">extracting them from the selected input file names</option> |
