Skip to content

Commit 428559e

Browse files
author
Airistotal
committed
Merge branch 'Reports_newpage' of https://github.com/Airistotal/galaxy into Reports_newpage
2 parents 860c39b + 9ab2f65 commit 428559e

204 files changed

Lines changed: 8531 additions & 2103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/pep8_sources.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cron/parse_builds.py
22
lib/galaxy/auth
33
lib/galaxy/config.py
44
lib/galaxy/datatypes/{data,proteomics}.py
5+
lib/galaxy/datatypes/converters/{bedgraph_to_array_tree_converter,wiggle_to_array_tree_converter}.py
56
lib/galaxy/exceptions/error_codes.py
67
lib/galaxy/jobs/{__init__,error_level,manager,stock_rules}.py
78
lib/galaxy/main.py
@@ -16,6 +17,7 @@ lib/galaxy/queue_worker.py
1617
lib/galaxy/tags
1718
lib/galaxy/tools
1819
lib/galaxy/util/{__init__,json,permutations,plugin_config,properties,simplegraph,sockets,sleeper,streamball,submodules,xml_macros}.py
20+
lib/galaxy/visualization/data_providers/{__init__,genome,registry}.py
1921
lib/galaxy/web/{proxy,security}
2022
lib/galaxy/web/base/{__init__,interactive_environments}.py
2123
lib/galaxy/web/formatting.py

client/galaxy/scripts/libs/jquery.sparklines.js

Lines changed: 3054 additions & 0 deletions
Large diffs are not rendered by default.

client/galaxy/style/less/base.less

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,3 +1705,32 @@ div.toolTitleNoSection
17051705
#for_bears {
17061706
display: none;
17071707
}
1708+
1709+
// ============================================================================ Reports Webapp
1710+
1711+
.dir_arrow {
1712+
visibility: hidden
1713+
}
1714+
1715+
#spark_time_select {
1716+
display: inline-block;
1717+
}
1718+
1719+
#spark_select {
1720+
height: 23px;
1721+
width: 30px;
1722+
padding: 0;
1723+
border-radius: 2px;
1724+
}
1725+
1726+
.quarter_width {
1727+
width: 25%;
1728+
}
1729+
1730+
.third_width {
1731+
width: 30%;
1732+
}
1733+
1734+
.half_width {
1735+
width: 50%
1736+
}

config/object_store_conf.xml.sample

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323

2424
<!-- Sample S3 Object Store
2525
<object_store type="s3">
26-
<auth access_key="...." secret_key="....." />
27-
<bucket name="unique_bucket_name_all_lowercase" use_reduced_redundancy="False" />
28-
<cache path="database/files/" size="1000" />
26+
<auth access_key="...." secret_key="....." />
27+
<bucket name="unique_bucket_name_all_lowercase" use_reduced_redundancy="False" />
28+
<cache path="database/object_store_cache" size="1000" />
29+
<extra_dir type="job_work" path="database/job_working_directory_s3"/>
30+
<extra_dir type="temp" path="database/tmp_s3"/>
2931
</object_store>
3032
-->
3133

@@ -34,7 +36,9 @@
3436
<auth access_key="...." secret_key="....." />
3537
<bucket name="unique_bucket_name" use_reduced_redundancy="False" max_chunk_size="250"/>
3638
<connection host="" port="" is_secure="" conn_path="" multipart="True"/>
37-
<cache path="database/files/" size="1000" />
39+
<cache path="database/object_store_cache" size="1000" />
40+
<extra_dir type="job_work" path="database/job_working_directory_swift"/>
41+
<extra_dir type="temp" path="database/tmp_swift"/>
3842
</object_store>
3943
-->
4044

doc/source/api_doc.rst

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
Galaxy API Documentation
2+
************************
3+
4+
Background
5+
==========
6+
In addition to being accessible through a web interface, Galaxy can also be
7+
accessed programmatically, through shell scripts and other programs. The web
8+
interface is appropriate for things like exploratory analysis, visualization,
9+
construction of workflows, and rerunning workflows on new datasets.
10+
11+
The web interface is less suitable for things like
12+
- Connecting a Galaxy instance directly to your sequencer and running
13+
workflows whenever data is ready.
14+
- Running a workflow against multiple datasets (which can be done with the
15+
web interface, but is tedious).
16+
- When the analysis involves complex control, such as looping and
17+
branching.
18+
19+
The Galaxy API addresses these and other situations by exposing Galaxy
20+
internals through an additional interface, known as an Application Programming
21+
Interface, or API.
22+
23+
Quickstart
24+
==========
25+
26+
Log in as your user, navigate to the API Keys page in the User menu, and
27+
generate a new API key. Make a note of the API key, and then pull up a
28+
terminal. Now we'll use the display.py script in your galaxy/scripts/api
29+
directory for a short example::
30+
31+
% ./display.py my_key http://localhost:4096/api/histories
32+
Collection Members
33+
------------------
34+
#1: /api/histories/8c49be448cfe29bc
35+
name: Unnamed history
36+
id: 8c49be448cfe29bc
37+
#2: /api/histories/33b43b4e7093c91f
38+
name: output test
39+
id: 33b43b4e7093c91f
40+
41+
The result is a Collection of the histories of the user specified by the API
42+
key (you). To look at the details of a particular history, say #1 above, do
43+
the following::
44+
45+
% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc
46+
Member Information
47+
------------------
48+
state_details: {'ok': 1, 'failed_metadata': 0, 'upload': 0, 'discarded': 0, 'running': 0, 'setting_metadata': 0, 'error': 0, 'new': 0, 'queued': 0, 'empty': 0}
49+
state: ok
50+
contents_url: /api/histories/8c49be448cfe29bc/contents
51+
id: 8c49be448cfe29bc
52+
name: Unnamed history
53+
54+
This gives detailed information about the specific member in question, in this
55+
case the History. To view history contents, do the following::
56+
57+
58+
% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents
59+
Collection Members
60+
------------------
61+
#1: /api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
62+
name: Pasted Entry
63+
type: file
64+
id: 6f91353f3eb0fa4a
65+
66+
What we have here is another Collection of items containing all of the datasets
67+
in this particular history. Finally, to view details of a particular dataset
68+
in this collection, execute the following::
69+
70+
% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
71+
Member Information
72+
------------------
73+
misc_blurb: 1 line
74+
name: Pasted Entry
75+
data_type: txt
76+
deleted: False
77+
file_name: /Users/yoplait/work/galaxy-stock/database/files/000/dataset_82.dat
78+
state: ok
79+
download_url: /datasets/6f91353f3eb0fa4a/display?to_ext=txt
80+
visible: True
81+
genome_build: ?
82+
model_class: HistoryDatasetAssociation
83+
file_size: 17
84+
metadata_data_lines: 1
85+
id: 6f91353f3eb0fa4a
86+
misc_info: uploaded txt file
87+
metadata_dbkey: ?
88+
89+
And now you've successfully used the API to request and select a history,
90+
browse the contents of that history, and then look at detailed information
91+
about a particular dataset.
92+
93+
For a more comprehensive Data Library example, set the following option in your
94+
galaxy.ini as well, and restart galaxy again::
95+
96+
admin_users = you@example.org
97+
library_import_dir = /path/to/some/directory
98+
99+
In the directory you specified for 'library_import_dir', create some
100+
subdirectories, and put (or symlink) files to import into Galaxy into those
101+
subdirectories.
102+
103+
In Galaxy, create an account that matches the address you put in 'admin_users',
104+
then browse to that user's preferences and generate a new API Key. Copy the
105+
key to your clipboard and then use these scripts::
106+
107+
% ./display.py my_key http://localhost:4096/api/libraries
108+
Collection Members
109+
------------------
110+
111+
0 elements in collection
112+
113+
% ./library_create_library.py my_key http://localhost:4096/api/libraries api_test 'API Test Library'
114+
Response
115+
--------
116+
/api/libraries/f3f73e481f432006
117+
name: api_test
118+
id: f3f73e481f432006
119+
120+
% ./display.py my_key http://localhost:4096/api/libraries
121+
Collection Members
122+
------------------
123+
/api/libraries/f3f73e481f432006
124+
name: api_test
125+
id: f3f73e481f432006
126+
127+
% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006
128+
Member Information
129+
------------------
130+
synopsis: None
131+
contents_url: /api/libraries/f3f73e481f432006/contents
132+
description: API Test Library
133+
name: api_test
134+
135+
% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
136+
Collection Members
137+
------------------
138+
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
139+
name: /
140+
type: folder
141+
id: 28202595c0d2591f61ddda595d2c3670
142+
143+
% ./library_create_folder.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591f61ddda595d2c3670 api_test_folder1 'API Test Folder 1'
144+
Response
145+
--------
146+
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
147+
name: api_test_folder1
148+
id: 28202595c0d2591fa4f9089d2303fd89
149+
150+
% ./library_upload_from_import_dir.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591fa4f9089d2303fd89 bed bed hg19
151+
Response
152+
--------
153+
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
154+
name: 2.bed
155+
id: e9ef7fdb2db87d7b
156+
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
157+
name: 3.bed
158+
id: 3b7f6a31f80a5018
159+
160+
% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
161+
Collection Members
162+
------------------
163+
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
164+
name: /
165+
type: folder
166+
id: 28202595c0d2591f61ddda595d2c3670
167+
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
168+
name: /api_test_folder1
169+
type: folder
170+
id: 28202595c0d2591fa4f9089d2303fd89
171+
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
172+
name: /api_test_folder1/2.bed
173+
type: file
174+
id: e9ef7fdb2db87d7b
175+
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
176+
name: /api_test_folder1/3.bed
177+
type: file
178+
id: 3b7f6a31f80a5018
179+
180+
% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
181+
Member Information
182+
------------------
183+
misc_blurb: 68 regions
184+
metadata_endCol: 3
185+
data_type: bed
186+
metadata_columns: 6
187+
metadata_nameCol: 4
188+
uploaded_by: nate@...
189+
metadata_strandCol: 6
190+
name: 2.bed
191+
genome_build: hg19
192+
metadata_comment_lines: None
193+
metadata_startCol: 2
194+
metadata_chromCol: 1
195+
file_size: 4272
196+
metadata_data_lines: 68
197+
message:
198+
metadata_dbkey: hg19
199+
misc_info: uploaded bed file
200+
date_uploaded: 2010-06-22T17:01:51.266119
201+
metadata_column_types: str, int, int, str, int, str
202+
203+
Other parameters are valid when uploading, they are the same parameters as are
204+
used in the web form, like 'link_data_only' and etc.
205+
206+
The request and response format should be considered alpha and are subject to change.
207+
208+
API Design Guidelines
209+
=====================
210+
211+
The following section outlines guidelines related to extending and/or modifing
212+
the Galaxy API. The Galaxy API has grown in an ad-hoc fashion over time by
213+
many contributors and so clients SHOULD NOT expect the API will conform to
214+
these guidelines - but developers contributing to the Galaxy API SHOULD follow
215+
these guidelines.
216+
217+
- API functionality should include docstring documentation for consumption
218+
by readthedocs.org.
219+
- Developers should familiarize themselves with the HTTP status code definitions
220+
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. The API responses
221+
should properly set the status code according to the result - in particular
222+
2XX responses should be used for successful requests, 4XX for various
223+
kinds of client errors, and 5XX for the errors on the server side.
224+
- If there is an error processing some part of request (one item in a list
225+
for instance), the status code should be set to reflect the error and the
226+
partial result may or may not be returned depending on the controller -
227+
this behavior should be documented.
228+
- API methods should throw a finite number of exceptions
229+
(defined in :doc:`galaxy.exceptions`) and these should subclass
230+
`MessageException` and not paste/wsgi HTTP exceptions. When possible,
231+
the framework itself should be responsible catching these exceptions,
232+
setting the status code, and building an error response.
233+
- Error responses should not consist of plain text strings - they should be
234+
dictionaries describing the error and containing the following::
235+
236+
{
237+
"status_code": 400,
238+
"err_code": 400007,
239+
"err_msg": "Request contained invalid parameter, action could not be completed.",
240+
"type": "error",
241+
"extra_error_info": "Extra information."
242+
}
243+
244+
Various error conditions (once a format has been chosen and framework to
245+
enforce it in place) should be spelled out in this document.
246+
- Backward compatibility is important and should be maintained when possible.
247+
If changing behavior in a non-backward compatibile way please ensure one
248+
of the following holds - there is a strong reason to believe no consumers
249+
depend on a behavior, the behavior is effectively broken, or the API
250+
method being modified has not been part of a tagged dist release.
251+
252+
The following bullet points represent good practices more than guidelines, please
253+
consider them when modifying the API.
254+
255+
- Functionality should not be copied and pasted between controllers -
256+
consider refactoring functionality into associated classes or short of
257+
that into Mixins (http://en.wikipedia.org/wiki/Composition_over_inheritance)
258+
or into Managers (:doc:`galaxy.managers`).
259+
- API additions are more permanent changes to Galaxy than many other potential
260+
changes and so a second opinion on API changes should be sought. (Consider a
261+
pull request!)
262+
- New API functionality should include functional tests. These functional
263+
tests should be implemented in Python and placed in
264+
`test/functional/api`. (Once such a framework is in place - it is not
265+
right now).
266+
- Changes to reflect modifications to the API should be pushed upstream to
267+
the BioBlend project if possible.
268+
269+
Longer term goals/notes.
270+
271+
- It would be advantageous to have a clearer separation of anonymous and
272+
admin handling functionality.
273+
- If at some point in the future, functionality needs to be added that
274+
breaks backward compatibility in a significant way to a component used by
275+
the community - a "dev" variant of the API will be established and
276+
the community should be alerted and given a timeframe for when the old
277+
behavior will be replaced with the new behavior.
278+
- Consistent standards for range-based requests, batch requests, filtered
279+
requests, etc... should be established and documented here.
280+
281+
282+
.. include:: lib/galaxy.webapps.galaxy.api.rst

doc/source/conf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
####### REQUIRED GALAXY INCLUDES
1818

1919
sys.path.append(os.path.join(os.getcwd(), '../../lib'))
20-
import galaxy
21-
from galaxy import eggs
2220

2321
#######
2422

@@ -103,7 +101,7 @@
103101

104102
# The theme to use for HTML and HTML Help pages. See the documentation for
105103
# a list of builtin themes.
106-
html_theme = 'default'
104+
html_theme = 'sphinx_rtd_theme'
107105

108106
# Theme options are theme-specific and customize the look and feel of a theme
109107
# further. For a list of options available for each theme, see the
@@ -274,6 +272,6 @@ def __getattr__(cls, name):
274272
return Mock()
275273

276274
# adding pbs_python, DRMAA_python, markupsafe, and drmaa here had no effect.
277-
MOCK_MODULES = ['tables', 'decorator', 'numpy']
275+
MOCK_MODULES = ['tables', 'decorator']
278276
for mod_name in MOCK_MODULES:
279277
sys.modules[mod_name] = Mock()

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Contents
4242
.. toctree::
4343
:maxdepth: 5
4444

45-
API Documentation <lib/galaxy.webapps.galaxy.api>
45+
API Documentation <api_doc>
4646

4747
Application Documentation <lib/modules>
4848

0 commit comments

Comments
 (0)