root/galaxy-central/templates/webapps/community/upload/upload.mako

リビジョン 2, 11.1 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1<%namespace file="/message.mako" import="render_msg" />
2
3<%!
4   def inherit(context):
5       if context.get('use_panels'):
6           return '/webapps/community/base_panels.mako'
7       else:
8           return '/base.mako'
9%>
10<%inherit file="${inherit(context)}"/>
11
12<%def name="javascripts()">
13    ${parent.javascripts()}
14    <script type="text/javascript">
15    $( function() {
16        $( "select[refresh_on_change='true']").change( function() {
17            $( "#upload_form" ).submit();
18        });
19    });
20    </script>
21</%def>
22
23<%def name="title()">
24    %if selected_upload_type == 'tool':
25        Upload a tool archive
26    %elif selected_upload_type == 'toolsuite':
27        Upload a tool suite archive
28    %endif
29</%def>
30
31<h2>
32    %if selected_upload_type == 'tool':
33        Upload a tool archive
34    %elif selected_upload_type == 'toolsuite':
35        Upload a tool suite archive
36    %endif
37</h2>
38
39%if message:
40    ${render_msg( message, status )}
41%endif
42
43<div class="toolForm">
44    %if selected_upload_type == 'tool':
45        <div class="toolFormTitle">Upload a single tool archive</div>
46    %else:
47        <div class="toolFormTitle">Upload a tool suite archive</div>
48    %endif
49    <div class="toolFormBody">
50    ## TODO: nginx
51    <form id="upload_form" name="upload_form" action="${h.url_for( controller='upload', action='upload' )}" enctype="multipart/form-data" method="post">
52    %if replace_id is not None:
53        <input type='hidden' name="replace_id" value="${replace_id}"/>
54    %endif
55    <div class="form-row">
56        <label>Upload Type</label>
57        <div class="form-row-input">
58            ${upload_type_select_list.get_html()}
59        </div>
60        <div class="toolParamHelp" style="clear: both;">
61            %if selected_upload_type == 'tool':
62                Need help creating a single tool archive?  See details below.
63            %elif selected_upload_type == 'toolsuite':
64                Need help creating a tool suite archive?  See details below.
65            %endif
66        </div>
67        <div style="clear: both"></div>
68    </div>
69    <div class="form-row">
70        <label>File:</label>
71        <div class="form-row-input"><input type="file" name="file_data"/></div>
72        <div style="clear: both"></div>
73    </div>
74    <div class="form-row">
75        <label>Category</label>
76        <div class="form-row-input">
77            <select name="category_id" multiple>
78                %for category in categories:
79                    %if category.id in selected_categories:
80                        <option value="${trans.security.encode_id( category.id )}" selected>${category.name}</option>
81                    %else:
82                        <option value="${trans.security.encode_id( category.id )}">${category.name}</option>
83                    %endif
84                %endfor
85            </select>
86        </div>
87        <div style="clear: both"></div>
88    </div>
89    <div class="form-row">
90        <label>URL:</label>
91        <div class="form-row-input"><input type="text" name="url" style="width: 100%;"/></div>
92        <div class="toolParamHelp" style="clear: both;">
93            Instead of uploading directly from your computer, you may instruct Galaxy to download the file from a Web or FTP address.
94        </div>
95        <div style="clear: both"></div>
96    </div>
97    <div class="form-row">
98        <input type="submit" class="primary-button" name="upload_button" value="Upload">
99    </div>
100    </form>
101    </div>
102</div>
103<p/>
104<div class="toolFormTitle">Creating an archive containing a tool or a suite of tools</div>
105<p>
106    A tool or tool suite archive is a tar-format file (bzipped or gzipped tar are valid)
107    containing all the files necessary to load the tool(s) into a Galaxy instance.
108</p>
109%if selected_upload_type == 'toolsuite':
110    <h3>Tool Suite Archive</h3>
111    <p>
112        A tools suite must include a file named <code>suite_config.xml</code> which provides information about the id, name,
113        version and description of the tool suite, as well as the id, name, version and description of each tool
114        in the suite.  Here is an example <code>suite_config.xml</code> file.
115    </p>
116    <p>
117<pre>
118    &lt;suite id="lastz_toolsuite" name="Suite of Lastz tools" version="1.0.0"&gt;
119        &lt;description&gt;This suite contains all of my Lastz tools for Galaxy&lt;/description&gt;
120        &lt;tool id="lastz_wrapper_2" name="Lastz" version="1.1.0"&gt;
121            &lt;description&gt; map short reads against reference sequence&lt;/description&gt;
122        &lt;/tool&gt;
123        &lt;tool id="lastz_paired_reads_wrapper" name="Lastz paired reads" version="1.0.0"&gt;
124            &lt;description&gt; map short paired reads against reference sequence&lt;/description&gt;
125        &lt;/tool&gt;
126    &lt;/suite&gt;
127</pre>
128    </p>
129    </p>
130    <p>
131        New versions of the suite can be uploaded, replacing an older version of the suite, but the version attribute
132        of the <suite> tag must be altered the same way that the version attribute of a single tool config must be altered
133        if uploading a new version of a tool.
134    </p>
135    <p>
136        The id, name and version attributes of each <tool> tag in the <code>suite_config.xml</code> file must exactly match the same
137        attributes in each associated tool config in the archive or you will not be allowed to upload the archive.
138    </p>
139    <p>
140        In addition to the <code>suite_config.xml</code> file, the archive must include all
141        <a href="http://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax" target="_blank">tool config files</a>,
142        executables, functional test data (if your tool config includes functional tests) and other files needed for each
143        of the tools in your suite to function within Galaxy.  See the information about single tool archives below for
144        additional hints to enable ease-of-use when others download your suite of tools.
145    </p>
146    <p>
147        For example, to package the above Lastz suite of tools:
148<pre>
149    user@host:~% tar jcvf ~/Desktop/galaxy_lastz_toolsuite.tar.bz2 lastzsuite
150    lastzsuite/
151    lastzsuite/README
152    lastzsuite/suite_config.xml
153    lastzsuite/lastz_paired_reads_wrapper.py
154    lastzsuite/lastz_paired_reads_wrapper.xml
155    lastzsuite/lastz_wrapper.py
156    lastzsuite/lastz_wrapper.xml
157    lastzsuite/lastz-distrib-1.02.00/
158    lastzsuite/lastz-distrib-1.02.00/src/
159    lastzsuite/lastz-distrib-1.02.00/src/Makefile
160    lastzsuite/lastz-distrib-1.02.00/src/version.mak
161    lastzsuite/lastz-distrib-1.02.00/src/lastz.c
162    lastzsuite/lastz-distrib-1.02.00/src/lastz.h
163    ...
164</pre>
165        ~/Desktop/galaxy_lastz_tool.tar.bz2 is now ready to be uploaded.
166    </p>
167%endif
168<h3>Single Tool Archive</h3>
169<p>
170    A single tool archive must include a
171    <a href="http://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax" target="_blank">tool config file</a>
172    and will probably also include a tool script.  If any steps are necessary to install your tool beyond the basic
173    instructions below, include a README file to provide details.  If the tool (or parts of it) are written in C,
174    the source code can be included (or put links to the source in the README).  Do not include pre-compiled binaries
175    without source since Galaxy is run on a wide variety of platforms.  Also, if you are only wrapping or providing a
176    Galaxy config for a tool that is not your own, be sure the license allows for redistribution before including any
177    part of that tool in the archive.
178</p>
179<p>
180    There are no requirements about the directory structure inside the archive, but for ease of use it's generally
181    a good idea to put everything inside a sub-directory, instead of directly at the top level.
182</p>
183<p>
184    For example, to package the Lastz tool's config file, Galaxy wrapper, and the C source:
185<pre>
186    user@host:~% tar jcvf ~/Desktop/galaxy_lastz_tool.tar.bz2 lastz
187    lastz/
188    lastz/README
189    lastz/lastz_wrapper.py
190    lastz/lastz_wrapper.xml
191    lastz/lastz-distrib-1.02.00/
192    lastz/lastz-distrib-1.02.00/src/
193    lastz/lastz-distrib-1.02.00/src/Makefile
194    lastz/lastz-distrib-1.02.00/src/version.mak
195    lastz/lastz-distrib-1.02.00/src/lastz.c
196    lastz/lastz-distrib-1.02.00/src/lastz.h
197    ...
198</pre>
199    ~/Desktop/galaxy_lastz_tool.tar.bz2 is now ready to be uploaded.
200</p>
201<h3>Editing Information, Categories, and Submitting For Approval</h3>
202<p>
203    Simply uploading a tool to the Galaxy too shed will not allow other users to find and download your tool.  It will
204    need to be approved by an administrator before it appears in the tool list.
205</p>
206<p>
207    After your archive has successfully uploaded, you will be redirected to the Edit Tool page.  Provide a detailed
208    description of what the tool does - this will be used by administrators to understand the tool before approving it
209    for display on the site.  Once approved, this information will be displayed to users who view your tool.  In addition,
210    the site administrators will have configured a number of categories with which you can associate your tool to make it
211    easy to find by users looking to solve specific problems.  Associate as many categories as are relevant to your tool.
212    You may change the description and associated categories as often as you'd like until you click the "<strong>Submit for
213    approval</strong>" button.  Once submitted, the tool will be approved or rejected by an administrator.  If the tool is
214    rejected, you will see information about why it was rejected, and you can make appropriate changes to the archive and
215    re-submit it for approval.  When it is approved, your archive will be visible to everyone.  At that point, the description
216    and associated categories can only be changed by an administrator.
217</p>
218<p>
219    When the tool has been approved or rejected, you may upload a new version by browsing to the tool's "View Tool" page,
220    clicking the "Tool actions" menu in the upper right corner of the page, and selecting "Upload a new version" from the
221    menu.
222</p>
223<hr/>
224<h3>Downloading and Installing Tools</h3>
225<p>
226    A tool's download link will send you the tool archive.  Once downloaded, unpack the tool on your local Galaxy instance's server:
227<pre>
228    user@host:~% tar xvf galaxy_lastz_tool.tar
229    ...
230    user@host:~% tar zxvf galaxy_lastz_tool.tar.gz
231    ...
232    user@host:~% tar jxvf galaxy_lastz_tool.tar.bz2
233    ...
234</pre>
235    If the archive includes a README file, consult it for installation instructions.  If not, follow these basic steps:
236    <ol>
237        <li>Create a directory under <code>galaxy_dist/tools/</code> to house downloaded tool(s).</li>
238        <li>In the new directory, place the XML and any script file(s) which were contained in the archive.</li>
239        <li>
240            If the tool includes binaries, you'll need to copy them to a directory on your <code>$PATH</code>.  If the tool depends on
241            C binaries but does not come with them (only source), you'll need to compile the source first.
242        </li>
243        <li>Add the tool to <code>galaxy_dist/tool_conf.xml</code>.</li>
244        <li>Restart your Galaxy server process.</li>
245    </ol>
246</p>
247<p>
248    In the near future, we plan to implement a more direct method to install tools via the Galaxy administrator user interface instead
249    of placing files on the filesystem and manually managing the <code>tool_conf.xml</code> file.
250</p>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。