Mercurial > repos > mzhuang > chess_preprocessor
comparison chess_preprocessor.xml @ 0:4d2a2268a17a draft
"planemo upload"
| author | mzhuang |
|---|---|
| date | Thu, 23 Sep 2021 21:00:48 +0000 |
| parents | |
| children | 0545899061d3 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4d2a2268a17a |
|---|---|
| 1 <tool id="chess_preprocessor" name="CHESS Pre-processing Tool" version="0.1.0"> | |
| 2 <description>for pre-processing raw data</description> | |
| 3 <requirements> | |
| 4 <requirement type="package" version="0.8.4">hexrd</requirement> | |
| 5 </requirements> | |
| 6 <command><![CDATA[ | |
| 7 #import os.path | |
| 8 | |
| 9 ##source ~/.bashrc;conda activate pulsar; | |
| 10 ##source ~/.bashrc; conda activate __hexrd@0.8.0; | |
| 11 mkdir -p output; | |
| 12 cd output; | |
| 13 #set $history_id=$__app__.security.encode_id($output.creating_job.history.id) | |
| 14 echo '$history_id' >> '$output'; | |
| 15 | |
| 16 #if $input_source_conditional.input_source == "input_source_history" | |
| 17 #set $input_type = $input_source_conditional.input_type_conditional.input_type | |
| 18 #if $input_type == "single" | |
| 19 #set $input_data = $input_source_conditional.input_type_conditional.fastq_input1 | |
| 20 #elif $input_type == "list_collection" | |
| 21 #set $input_data = $input_source_conditional.input_type_conditional.fastq_input | |
| 22 #end if# | |
| 23 | |
| 24 #set $var = "" | |
| 25 #for $f in $input_data# | |
| 26 #set $var += "${f}\n" | |
| 27 #end for# | |
| 28 #set files = '\\n'.join([str($file) for $file in $input_data]) | |
| 29 ##for $f in $input_data# | |
| 30 #if $output_as_list == "Yes" | |
| 31 ##printf "$files" >> '$output_list_log' 2>&1; | |
| 32 printf "$files" | xargs -n 1 -P \${GALAXY_SLOTS} -I{} python '$__tool_directory__/preprocess_dexela_h5_galaxy.py' {} -o '$ome_start' -s '$start_frame' -n '$num_frames' -e '$ome_end' -t '$threshold' >> '$output_list_log' 2>&1; | |
| 33 #elif $output_as_list == "No" | |
| 34 printf "$files" | xargs -n 1 -P \${GALAXY_SLOTS} -I{} python '$__tool_directory__/preprocess_dexela_h5_galaxy.py' {} -o '$ome_start' -s '$start_frame' -n '$num_frames' -e '$ome_end' -t '$threshold' >> '$output' 2>&1; | |
| 35 #end if# | |
| 36 ##end for# | |
| 37 #elif $input_source_conditional.input_source == "input_source_linux" | |
| 38 #set $scans = [i for a in [(int(j[0]),int(j[-1])+1) for j in [x.split(':') for x in $input_source_conditional.scan_numbers.split(',')]] for i in range(a[0],a[1])] | |
| 39 ##set $scanlist = '\n'.join($scans) | |
| 40 | |
| 41 #for $n in $scans# | |
| 42 #if $output_as_list == "Yes" | |
| 43 echo '$input_source_conditional.base_dir' >> '$output_list_log'; | |
| 44 python '$__tool_directory__/preprocess_dexela_h5_filesystem.py' '$input_source_conditional.base_dir' '$input_source_conditional.expt_name' '$input_source_conditional.samp_name' '$n' -o '$ome_start' -s '$start_frame' -n '$num_frames' -e '$ome_end' -t '$threshold' >> '$output_list_log' 2>&1; | |
| 45 #elif $output_as_list == "No" | |
| 46 echo '$input_source_conditional.base_dir' >> '$output'; | |
| 47 python '__tool_directory__/preprocess_dexela_h5_filesystem.py' '$input_source_conditional.base_dir' '$input_source_conditional.expt_name' '$input_source_conditional.samp_name' '$n' -o '$ome_start' -s '$start_frame' -n '$num_frames' -e '$ome_end' -t '$threshold' >> '$output' 2>&1; | |
| 48 #end if# | |
| 49 #end for# | |
| 50 #end if# | |
| 51 conda deactivate | |
| 52 ]]></command> | |
| 53 <inputs> | |
| 54 <!-- | |
| 55 <param name="infile_" type="data" multiple="true" label="Any file"/> | |
| 56 --> | |
| 57 <conditional name="input_source_conditional"> | |
| 58 <param name="input_source" type="select" label="Location of raw data"> | |
| 59 <option value="input_source_history" selected="true">Choose from History panel</option> | |
| 60 <option value="input_source_linux">Specify a directory in CHESS file system </option> | |
| 61 </param> | |
| 62 <when value="input_source_history"> | |
| 63 <conditional name="input_type_conditional"> | |
| 64 <param name="input_type" type="select" label="Input raw data as"> | |
| 65 <option value="list_collection" selected="true">List of Datasets</option> | |
| 66 <option value="single">Dataset(s)</option> | |
| 67 </param> | |
| 68 <when value="single"> | |
| 69 <param name="fastq_input1" type="data" multiple="true" label="Select (a) raw data file(s)" help="Specify (a) raw data file(s) for pre-processing"/> | |
| 70 </when> | |
| 71 <when value="list_collection"> | |
| 72 <param name="fastq_input" type="data_collection" collection_type="list" label="Select a list of raw data files" help="Specify a list of raw data files for pre-processing one by one"/> | |
| 73 </when> | |
| 74 </conditional> | |
| 75 </when> | |
| 76 <when value="input_source_linux"> | |
| 77 <param name="base_dir" type="text" label="Please specify the directory that contains raw data"> | |
| 78 <sanitizer> | |
| 79 <valid initial="string.ascii_letters,string.digits"> | |
| 80 <add value="#,/,*,@,.,_,-" /> | |
| 81 <add value="_" /> | |
| 82 </valid> | |
| 83 </sanitizer> | |
| 84 </param> | |
| 85 <param name="expt_name" type="text" label="Please specify the experiment name"/> | |
| 86 <param name="samp_name" type="text" label="Please specify the sample name"/> | |
| 87 <param name="scan_numbers" type="text" label="Please specify a scan number or scan numbers separated by comma (for example, 5,7,8,9,20,21,22,23,30 or 5,7:9,20:23,30)"/> | |
| 88 </when> | |
| 89 </conditional> | |
| 90 <!-- | |
| 91 <param name="which_cluster" type="select" label="Send your job to below cluster"> | |
| 92 <option value="SDSC" selected="true">SDSC</option> | |
| 93 <option value="Cornell" selected="true">Cornell CHESS</option> | |
| 94 </param> | |
| 95 --> | |
| 96 <!-- | |
| 97 <param name="output_dir" type="text" hidden="true"/> | |
| 98 --> | |
| 99 <param name="num_frames" type="integer" value="999" label="Number of frames to read"/> | |
| 100 <param name="start_frame" type="integer" value="0" label="Index of first data frame"/> | |
| 101 <param name="threshold" type="integer" value="50" label="Threshold for frame caches"/> | |
| 102 <param name="ome_start" type="float" value="-50.0" label="Start omega"/> | |
| 103 <param name="ome_end" type="float" value="49.9" label="End omega"/> | |
| 104 <param name="output_as_list" type="select" label="Would you like the tool to output result(s) as a list?"> | |
| 105 <option value="Yes" selected="true">Yes. Let the results be contained in a list.</option> | |
| 106 <option value="No" >No. Show them individually.</option> | |
| 107 </param> | |
| 108 </inputs> | |
| 109 <outputs> | |
| 110 <data format="txt" name="output_list_log" label="${tool.name} on ${on_string}"> | |
| 111 <!--filter>input_type_conditional['input_type'] == 'single'</filter--> | |
| 112 <filter>output_as_list == 'Yes'</filter> | |
| 113 </data> | |
| 114 <!-- | |
| 115 <collection name="output_list" type="list" label="${tool.name} on ${on_string}: processed_data" structured_like="fastq_input" format="npz"> | |
| 116 <collection name="output_list" type="list" label="${tool.name} on ${on_string}: processed_data" format="npz"> | |
| 117 --> | |
| 118 <collection name="output_list" type="list" label="${tool.name} on ${on_string}: processed_data"> | |
| 119 <!-- discover_datasets pattern="__name_and_ext__" directory="output" ext="npz" visible="false"/--> | |
| 120 <discover_datasets pattern="(?P<designation>.+)\.npz" ext="hexrd.npz" directory="output"/> | |
| 121 <!--discover_datasets pattern="(?P<designation>.+)\.npz" ext="npz" directory="output"/--> | |
| 122 <!--discover_datasets pattern="(?P<designation>.npz)" ext="hexrd.npz" directory="output"/--> | |
| 123 <!--filter>input_type_conditional['input_type'] == 'list_collection'</filter--> | |
| 124 <filter>output_as_list == 'Yes'</filter> | |
| 125 </collection> | |
| 126 <data format="txt" name="output" label="${tool.name} on ${on_string}"> | |
| 127 <discover_datasets pattern="(?P<designation>.+)\.npz" directory="output" ext="hexrd.npz" visible="true" /> | |
| 128 <filter>output_as_list == 'No'</filter> | |
| 129 </data> | |
| 130 <!--data format="txt" name="output_list" label="${tool.name} on ${on_string}: listfiles"> | |
| 131 <filter>input_type_conditional['input_type'] == 'list_collection'</filter> | |
| 132 </data --> | |
| 133 </outputs> | |
| 134 </tool> | |
| 135 |
