Mercurial > repos > greg > ideas
comparison ideas.xml @ 128:de93d8e8a096 draft
Uploaded
author | greg |
---|---|
date | Wed, 22 Nov 2017 08:37:10 -0500 |
parents | dcc642e255ec |
children | d064db60a06d |
comparison
equal
deleted
inserted
replaced
127:1c49e78e4ee7 | 128:de93d8e8a096 |
---|---|
24 cp '$gen_prep_input_config' $prep_input_config && | 24 cp '$gen_prep_input_config' $prep_input_config && |
25 prepMat | 25 prepMat |
26 $prep_input_config | 26 $prep_input_config |
27 #if str($specify_genomic_window) == "yes": | 27 #if str($specify_genomic_window) == "yes": |
28 -bed '$specify_genomic_window_cond.bed_input' | 28 -bed '$specify_genomic_window_cond.bed_input' |
29 #import collections | |
30 chroms = collections.OrderedDict() | |
29 #else: | 31 #else: |
30 -gsz '$chromInfo' | 32 -gsz '$chromInfo' |
31 -wsz $specify_genomic_window_cond.window_size | 33 -wsz $specify_genomic_window_cond.window_size |
32 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes | 34 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes |
33 #if str($restrict_chromosomes) == "yes": | 35 #if str($restrict_chromosomes) == "yes": |
51 ############################################## | 53 ############################################## |
52 && cut -d' ' $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) -d' ' > $prep_output_config | 56 && paste <(cat file1.txt) <(cat file2.txt) -d' ' > $prep_output_config |
55 ############################################## | 57 ############################################## |
56 ## If using a genomic window bed file, then | 58 ## If using a genomic window bed file, categorize |
57 ## generate a text file that categorizes the | 59 ## the window positions by chromosome to enable |
58 ## window positions by chromosome to enable | |
59 ## the IDEAS -inv option. | 60 ## the IDEAS -inv option. |
60 ############################################## | 61 ############################################## |
61 #if str($specify_genomic_window) == "yes": | 62 #if str($specify_genomic_window) == "yes": |
62 && python '$__tool_directory__/create_window_positions_by_chrom.py' | 63 $categorize_window_positions_by_chrom |
63 --input '$specify_genomic_window_cond.bed_input' | 64 #for chrom, tup in $chroms.items(): |
64 --output $window_positions_by_chrom | 65 && ideas |
65 #end if | 66 '$prep_output_config' |
66 ############################################## | 67 $ideas_options |
67 ## Run IDEAS | 68 #end for |
68 ############################################## | |
69 && ideas | |
70 '$prep_output_config' | |
71 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window | |
72 #if str($specify_genomic_window) == "yes": | |
73 '$specify_genomic_window_cond.bed_input' | |
74 -inv $window_positions_by_chrom | |
75 #else: | 69 #else: |
76 $tmp_dir/*.bed | 70 && ideas |
77 #end if | 71 '$prep_output_config' |
78 $hp | 72 $ideas_options |
79 #if str($log2) != "0.0": | 73 && mv ./*.cluster '$output_txt_dir' |
80 -log2 $log2 | 74 && mv ./*.para '$output_txt_dir' |
81 #end if | 75 && mv ./*.profile '$output_txt_dir' |
82 #if str($max_states) != "0.0": | 76 && mv ./*.state '$output_txt_dir' |
83 -G $max_states | 77 -o '$project_name' |
84 #end if | 78 #if str($save_ideas_log) == "yes": |
85 #if str($initial_states) != "0": | 79 > $output_log |
86 -C $initial_states | 80 #else: |
87 #end if | 81 > /dev/null |
88 #if str($max_position_classes) != "0": | 82 #end if |
89 -P $max_position_classes | 83 && Rscript '$__tool_directory__/create_heatmap.R' |
90 #end if | 84 -i '$output_txt_dir' |
91 #if str($max_cell_type_clusters) != "0": | 85 -o '$output_pdf_dir' |
92 -K $max_cell_type_clusters | 86 #end if |
93 #end if | |
94 #if str($prior_concentration) != "0.0": | |
95 -A $prior_concentration | |
96 #end if | |
97 -sample $burnin_num $mcmc_num | |
98 #if str($minerr) != "0.0": | |
99 -minerr $minerr | |
100 #end if | |
101 #if str($maxerr) != "0.0": | |
102 -maxerr $maxerr | |
103 #end if | |
104 -rseed $rseed | |
105 -thread \${GALAXY_SLOTS:-4} | |
106 -o '$project_name' | |
107 #if str($save_ideas_log) == "yes": | |
108 > $output_log | |
109 #else: | |
110 > /dev/null | |
111 #end if | |
112 && mv ./*.cluster '$output_txt_dir' | |
113 && mv ./*.para '$output_txt_dir' | |
114 && mv ./*.profile '$output_txt_dir' | |
115 && mv ./*.state '$output_txt_dir' | |
116 && Rscript '$__tool_directory__/create_heatmap.R' | |
117 -i '$output_txt_dir' | |
118 -o '$output_pdf_dir' | |
119 ]]></command> | 87 ]]></command> |
120 <configfiles> | 88 <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> | |
121 <configfile name="gen_prep_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": | 102 <configfile name="gen_prep_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": |
122 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions | 103 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions |
123 #for $i in $cell_type_epigenetic_factor_cond.input: | 104 #for $i in $cell_type_epigenetic_factor_cond.input: |
124 #set file_name_with_ext = $i.name | 105 #set file_name_with_ext = $i.name |
125 #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 | 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 |
136 #else: | 117 #else: |
137 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: | 118 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: |
138 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} | 119 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} |
139 #end for | 120 #end for |
140 #end if]]></configfile> | 121 #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> | |
141 </configfiles> | 155 </configfiles> |
142 <inputs> | 156 <inputs> |
143 <conditional name="cell_type_epigenetic_factor_cond"> | 157 <conditional name="cell_type_epigenetic_factor_cond"> |
144 <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> | 158 <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> |
145 <option value="extract" selected="true">extracting them from the selected input file names</option> | 159 <option value="extract" selected="true">extracting them from the selected input file names</option> |