Mercurial > repos > iuc > isoformswitchanalyzer
comparison isoformswitchanalyzer.xml @ 7:d3377a16d881 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/isoformswitchanalyzer commit db7d80651213272678725ba877d95f5113378878
| author | iuc |
|---|---|
| date | Wed, 14 Jan 2026 09:30:42 +0000 |
| parents | b3f292d9f35d |
| children |
comparison
equal
deleted
inserted
replaced
| 6:298d81e5e138 | 7:d3377a16d881 |
|---|---|
| 58 #set $filename = 'quant.sf' | 58 #set $filename = 'quant.sf' |
| 59 #else | 59 #else |
| 60 #set $filename = 'abundance.tsv' | 60 #set $filename = 'abundance.tsv' |
| 61 #end if | 61 #end if |
| 62 | 62 |
| 63 ## read cofactor repeats and generate cofactor_map dictionary | |
| 64 ## cofactor_map structure: {file_path: {cofactor_name: cofactor_level_name, ...}, ...} | |
| 65 #set $cofactor_map = {} | |
| 66 #set $cofactor_names = [] | |
| 67 #for $cofactor_item in $functionMode.tool_source.cofactor: | |
| 68 #set $cofactor_name = str($cofactor_item.cofactor_name) | |
| 69 $cofactor_names.append($cofactor_name) | |
| 70 #for $level_item in $cofactor_item.cofactor_level: | |
| 71 #set $level_name = str($level_item.cofactor_level_name) | |
| 72 #for $level_file in $level_item.cofactor_level_files: | |
| 73 #set $file_path = str($level_file) | |
| 74 #if $file_path not in $cofactor_map: | |
| 75 #set $cofactor_map[$file_path] = {} | |
| 76 #end if | |
| 77 #set $cofactor_map[$file_path][$cofactor_name] = $level_name | |
| 78 #end for | |
| 79 #end for | |
| 80 #end for | |
| 81 | |
| 82 ## create file_to_sample_map dictionary | |
| 83 #set $file_to_sample_map = {} | |
| 84 | |
| 63 #for $index in range(len($functionMode.tool_source.first_factor.trans_counts)): | 85 #for $index in range(len($functionMode.tool_source.first_factor.trans_counts)): |
| 86 #set $sampleID = str($functionMode.tool_source.first_factor.factorLevel) + str($index) | |
| 87 #set $trans_file = $functionMode.tool_source.first_factor.trans_counts[$index] | |
| 88 #set $file_to_sample_map[$sampleID] = str($trans_file) | |
| 64 $conditions.append($functionMode.tool_source.first_factor.factorLevel) | 89 $conditions.append($functionMode.tool_source.first_factor.factorLevel) |
| 65 $sampleIDs.append(str($functionMode.tool_source.first_factor.factorLevel) + str($index)) | 90 $sampleIDs.append($sampleID) |
| 66 $replicates.append($index) | 91 $replicates.append($index) |
| 67 mkdir './input_files/${functionMode.tool_source.first_factor.factorLevel}${index}/' && | 92 mkdir './input_files/${functionMode.tool_source.first_factor.factorLevel}${index}/' && |
| 68 ln -s $functionMode.tool_source.first_factor.trans_counts[$index] './input_files/${functionMode.tool_source.first_factor.factorLevel}${index}/${filename}' && | 93 ln -s $trans_file './input_files/${functionMode.tool_source.first_factor.factorLevel}${index}/${filename}' && |
| 69 #end for | 94 #end for |
| 70 | 95 |
| 71 #for $index in range(len($functionMode.tool_source.second_factor.trans_counts)): | 96 #for $index in range(len($functionMode.tool_source.second_factor.trans_counts)): |
| 97 #set $sampleID = str($functionMode.tool_source.second_factor.factorLevel) + str($index) | |
| 98 #set $trans_file = $functionMode.tool_source.second_factor.trans_counts[$index] | |
| 99 #set $file_to_sample_map[$sampleID] = str($trans_file) | |
| 72 $conditions.append($functionMode.tool_source.second_factor.factorLevel) | 100 $conditions.append($functionMode.tool_source.second_factor.factorLevel) |
| 73 $sampleIDs.append(str($functionMode.tool_source.second_factor.factorLevel) + str($index)) | 101 $sampleIDs.append($sampleID) |
| 74 $replicates.append($index) | 102 $replicates.append($index) |
| 75 mkdir './input_files/${functionMode.tool_source.second_factor.factorLevel}${index}/' && | 103 mkdir './input_files/${functionMode.tool_source.second_factor.factorLevel}${index}/' && |
| 76 ln -s $functionMode.tool_source.second_factor.trans_counts[$index] './input_files/${functionMode.tool_source.second_factor.factorLevel}${index}/${filename}' && | 104 ln -s $trans_file './input_files/${functionMode.tool_source.second_factor.factorLevel}${index}/${filename}' && |
| 77 #end for | 105 #end for |
| 78 | 106 |
| 107 | |
| 79 Rscript '${__tool_directory__}/IsoformSwitchAnalyzeR.R' | 108 Rscript '${__tool_directory__}/IsoformSwitchAnalyzeR.R' |
| 80 #for $i, $condition in enumerate($conditions) | 109 #for $i, $condition in enumerate($conditions) |
| 81 --condition $condition | 110 --condition $condition |
| 82 --sampleID $sampleIDs[$i] | 111 --sampleID $sampleIDs[$i] |
| 83 --replicate $replicates[$i] | 112 --replicate $replicates[$i] |
| 113 #set $sample_file = $file_to_sample_map[$sampleIDs[$i]] | |
| 114 #if $sample_file in $cofactor_map | |
| 115 #set $cofactor_values = [] | |
| 116 #for $cofactor_name in $cofactor_names: | |
| 117 #if $cofactor_name in $cofactor_map[$sample_file] | |
| 118 #set $cofactor_value = $cofactor_map[$sample_file][$cofactor_name] | |
| 119 #silent $cofactor_values.append(str($cofactor_value)) | |
| 120 #end if | |
| 121 #end for | |
| 122 --cofactors $(','.join($cofactor_values)) | |
| 123 #end if | |
| 84 #end for | 124 #end for |
| 125 #if len($cofactor_names) > 0 | |
| 126 --cofactorNames $(','.join($cofactor_names)) | |
| 127 #end if | |
| 85 $functionMode.pairedSamples | 128 $functionMode.pairedSamples |
| 86 --modeSelector $functionMode.selector | 129 --modeSelector $functionMode.selector |
| 87 --parentDir './input_files' | 130 --parentDir './input_files' |
| 88 --annotation $annotation | 131 --annotation $annotation |
| 89 --transcriptome $transcriptome | 132 --transcriptome $transcriptome |
| 646 <assert_contents> | 689 <assert_contents> |
| 647 <has_size value="652170" delta="300"/> | 690 <has_size value="652170" delta="300"/> |
| 648 </assert_contents> | 691 </assert_contents> |
| 649 </output> | 692 </output> |
| 650 <output name="matrix_counts" file="test02_counts.tabular" ftype="tabular" lines_diff="6"/> | 693 <output name="matrix_counts" file="test02_counts.tabular" ftype="tabular" lines_diff="6"/> |
| 651 <output name="sample_annotation" file="test02_samples_annotation.tabular" ftype="tabular"/> | 694 <output name="sample_annotation"> |
| 695 <assert_contents> | |
| 696 <has_text_matching expression="sampleID\s+condition"/> | |
| 697 <has_text_matching expression="health0\s+health"/> | |
| 698 <has_text_matching expression="health1\s+health"/> | |
| 699 <has_text_matching expression="cancer0\s+cancer"/> | |
| 700 <has_text_matching expression="cancer1\s+cancer"/> | |
| 701 </assert_contents> | |
| 702 </output> | |
| 652 </test> | 703 </test> |
| 653 <!-- Test 03: Data import mode generate collection count files--> | 704 <!-- Test 03: Data import mode generate collection count files--> |
| 654 <test expect_num_outputs="3"> | 705 <test expect_num_outputs="3"> |
| 655 <conditional name="functionMode"> | 706 <conditional name="functionMode"> |
| 656 <param name="selector" value="data_import"/> | 707 <param name="selector" value="data_import"/> |
| 1113 <output name="switchList" ftype="rdata"> | 1164 <output name="switchList" ftype="rdata"> |
| 1114 <assert_contents> | 1165 <assert_contents> |
| 1115 <has_size value="652170" delta="300"/> | 1166 <has_size value="652170" delta="300"/> |
| 1116 </assert_contents> | 1167 </assert_contents> |
| 1117 </output> | 1168 </output> |
| 1118 <output name="sample_annotation" file="test10_samples_annotation.tabular" ftype="tabular"/> | 1169 <output name="sample_annotation"> |
| 1170 <assert_contents> | |
| 1171 <has_text_matching expression="sampleID\s+condition\s+replicate"/> | |
| 1172 <has_text_matching expression="health0\s+health\s+0"/> | |
| 1173 <has_text_matching expression="health1\s+health\s+1"/> | |
| 1174 <has_text_matching expression="cancer0\s+cancer\s+0"/> | |
| 1175 <has_text_matching expression="cancer1\s+cancer\s+1"/> | |
| 1176 </assert_contents> | |
| 1177 </output> | |
| 1178 </test> | |
| 1179 <!-- Test 11: Data import mode add cofactor--> | |
| 1180 <test expect_num_outputs="3"> | |
| 1181 <conditional name="functionMode"> | |
| 1182 <param name="selector" value="data_import"/> | |
| 1183 <param name="genomeAnnotation" value="gencode.hg19.chr10_1000.gtf.gz"/> | |
| 1184 <param name="transcriptome" value="transcriptome_stringtie.fasta.gz"/> | |
| 1185 <param name="countFiles" value="matrix"/> | |
| 1186 <conditional name="tool_source"> | |
| 1187 <param name="selector" value="stringtie"/> | |
| 1188 <conditional name="novoisoforms"> | |
| 1189 <param name="selector" value="novel"/> | |
| 1190 <param name="stringtieAnnotation" value="annotation_stringtie.gtf.gz"/> | |
| 1191 </conditional> | |
| 1192 <section name="first_factor"> | |
| 1193 <param name="factorLevel" value="EWS-FLI1"/> | |
| 1194 <param name="trans_counts" value="ASP14_1.tabular,ASP14_2.tabular,ASP14_3.tabular"/> | |
| 1195 </section> | |
| 1196 <section name="second_factor"> | |
| 1197 <param name="factorLevel" value="no-EWS-FLI1"/> | |
| 1198 <param name="trans_counts" value="ASP14_doxycycline_1.tabular,ASP14_doxycycline_2.tabular,ASP14_doxycycline_3.tabular"/> | |
| 1199 </section> | |
| 1200 <repeat name="cofactor"> | |
| 1201 <param name="cofactor_name" value="Batch"/> | |
| 1202 <repeat name="cofactor_level"> | |
| 1203 <param name="cofactor_level_name" value="batch1"/> | |
| 1204 <param name="cofactor_level_files" value="ASP14_1.tabular,ASP14_doxycycline_1.tabular"/> | |
| 1205 </repeat> | |
| 1206 <repeat name="cofactor_level"> | |
| 1207 <param name="cofactor_level_name" value="batch2"/> | |
| 1208 <param name="cofactor_level_files" value="ASP14_2.tabular,ASP14_doxycycline_2.tabular"/> | |
| 1209 </repeat> | |
| 1210 <repeat name="cofactor_level"> | |
| 1211 <param name="cofactor_level_name" value="batch3"/> | |
| 1212 <param name="cofactor_level_files" value="ASP14_3.tabular,ASP14_doxycycline_3.tabular"/> | |
| 1213 </repeat> | |
| 1214 </repeat> | |
| 1215 <repeat name="cofactor"> | |
| 1216 <param name="cofactor_name" value="Age"/> | |
| 1217 <repeat name="cofactor_level"> | |
| 1218 <param name="cofactor_level_name" value="20"/> | |
| 1219 <param name="cofactor_level_files" value="ASP14_1.tabular,ASP14_doxycycline_1.tabular,ASP14_2.tabular"/> | |
| 1220 </repeat> | |
| 1221 <repeat name="cofactor_level"> | |
| 1222 <param name="cofactor_level_name" value="60"/> | |
| 1223 <param name="cofactor_level_files" value="ASP14_doxycycline_2.tabular,ASP14_3.tabular,ASP14_doxycycline_3.tabular"/> | |
| 1224 </repeat> | |
| 1225 </repeat> | |
| 1226 </conditional> | |
| 1227 </conditional> | |
| 1228 <output name="switchList" ftype="rdata"> | |
| 1229 <assert_contents> | |
| 1230 <has_size value="374542" delta="300"/> | |
| 1231 </assert_contents> | |
| 1232 </output> | |
| 1233 <output name="matrix_counts" file="stringtie_counts.tabular" ftype="tabular" lines_diff="6"/> | |
| 1234 <output name="sample_annotation"> | |
| 1235 <assert_contents> | |
| 1236 <has_text_matching expression="sampleID\s+condition\s+Batch\s+Age"/> | |
| 1237 <has_text_matching expression="EWSXFLI10\s+EWSXFLI1\s+batch1\s+20"/> | |
| 1238 <has_text_matching expression="EWSXFLI11\s+EWSXFLI1\s+batch2\s+20"/> | |
| 1239 <has_text_matching expression="EWSXFLI12\s+EWSXFLI1\s+batch3\s+60"/> | |
| 1240 <has_text_matching expression="noXEWSXFLI10\s+noXEWSXFLI1\s+batch1\s+20"/> | |
| 1241 <has_text_matching expression="noXEWSXFLI11\s+noXEWSXFLI1\s+batch2\s+60"/> | |
| 1242 <has_text_matching expression="noXEWSXFLI12\s+noXEWSXFLI1\s+batch3\s+60"/> | |
| 1243 </assert_contents> | |
| 1244 </output> | |
| 1119 </test> | 1245 </test> |
| 1120 </tests> | 1246 </tests> |
| 1121 <help><