1 | This is not documentation. These are hints and examples to get you started |
---|
2 | until the documentation is written. |
---|
3 | |
---|
4 | Set these options in universe_wsgi.ini and start the server: |
---|
5 | |
---|
6 | enable_api = True |
---|
7 | admin_users = you@example.org |
---|
8 | library_import_dir = /path/to/some/directory |
---|
9 | |
---|
10 | In the directory you specified for 'library_import_dir', create some |
---|
11 | subdirectories, and put (or symlink) files to import into Galaxy into those |
---|
12 | subdirectories. |
---|
13 | |
---|
14 | In Galaxy, create an account that matches the address you put in 'admin_users', |
---|
15 | then browse to that user's preferences and generate a new API Key. Copy the |
---|
16 | key to your clipboard and then use these scripts: |
---|
17 | |
---|
18 | % ./display.py my_key http://localhost:4096/api/libraries |
---|
19 | Collection Members |
---|
20 | ------------------ |
---|
21 | |
---|
22 | 0 elements in collection |
---|
23 | |
---|
24 | % ./library_create_library.py my_key http://localhost:4096/api/libraries api_test 'API Test Library' |
---|
25 | Response |
---|
26 | -------- |
---|
27 | /api/libraries/f3f73e481f432006 |
---|
28 | name: api_test |
---|
29 | id: f3f73e481f432006 |
---|
30 | |
---|
31 | % ./display.py my_key http://localhost:4096/api/libraries |
---|
32 | Collection Members |
---|
33 | ------------------ |
---|
34 | /api/libraries/f3f73e481f432006 |
---|
35 | name: api_test |
---|
36 | id: f3f73e481f432006 |
---|
37 | |
---|
38 | % ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006 |
---|
39 | Member Information |
---|
40 | ------------------ |
---|
41 | synopsis: None |
---|
42 | contents_url: /api/libraries/f3f73e481f432006/contents |
---|
43 | description: API Test Library |
---|
44 | name: api_test |
---|
45 | |
---|
46 | % ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents |
---|
47 | Collection Members |
---|
48 | ------------------ |
---|
49 | /api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670 |
---|
50 | name: / |
---|
51 | type: folder |
---|
52 | id: 28202595c0d2591f61ddda595d2c3670 |
---|
53 | |
---|
54 | % ./library_create_folder.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591f61ddda595d2c3670 api_test_folder1 'API Test Folder 1' |
---|
55 | Response |
---|
56 | -------- |
---|
57 | /api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89 |
---|
58 | name: api_test_folder1 |
---|
59 | id: 28202595c0d2591fa4f9089d2303fd89 |
---|
60 | |
---|
61 | % ./library_upload_from_import_dir.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591fa4f9089d2303fd89 bed bed hg19 |
---|
62 | Response |
---|
63 | -------- |
---|
64 | /api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b |
---|
65 | name: 2.bed |
---|
66 | id: e9ef7fdb2db87d7b |
---|
67 | /api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018 |
---|
68 | name: 3.bed |
---|
69 | id: 3b7f6a31f80a5018 |
---|
70 | |
---|
71 | % ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents |
---|
72 | Collection Members |
---|
73 | ------------------ |
---|
74 | /api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670 |
---|
75 | name: / |
---|
76 | type: folder |
---|
77 | id: 28202595c0d2591f61ddda595d2c3670 |
---|
78 | /api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89 |
---|
79 | name: /api_test_folder1 |
---|
80 | type: folder |
---|
81 | id: 28202595c0d2591fa4f9089d2303fd89 |
---|
82 | /api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b |
---|
83 | name: /api_test_folder1/2.bed |
---|
84 | type: file |
---|
85 | id: e9ef7fdb2db87d7b |
---|
86 | /api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018 |
---|
87 | name: /api_test_folder1/3.bed |
---|
88 | type: file |
---|
89 | id: 3b7f6a31f80a5018 |
---|
90 | |
---|
91 | % ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b |
---|
92 | Member Information |
---|
93 | ------------------ |
---|
94 | misc_blurb: 68 regions |
---|
95 | metadata_endCol: 3 |
---|
96 | data_type: bed |
---|
97 | metadata_columns: 6 |
---|
98 | metadata_nameCol: 4 |
---|
99 | uploaded_by: nate@... |
---|
100 | metadata_strandCol: 6 |
---|
101 | name: 2.bed |
---|
102 | genome_build: hg19 |
---|
103 | metadata_comment_lines: None |
---|
104 | metadata_startCol: 2 |
---|
105 | metadata_chromCol: 1 |
---|
106 | file_size: 4272 |
---|
107 | metadata_data_lines: 68 |
---|
108 | message: |
---|
109 | metadata_dbkey: hg19 |
---|
110 | misc_info: uploaded bed file |
---|
111 | date_uploaded: 2010-06-22T17:01:51.266119 |
---|
112 | metadata_column_types: str, int, int, str, int, str |
---|
113 | |
---|
114 | Other parameters are valid when uploading, they are the same parameters as are |
---|
115 | used in the web form, like 'link_data_only' and etc. |
---|
116 | |
---|
117 | The request and response format should be considered alpha and are subject to change. |
---|