root/galaxy-central/scripts/api/README

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

import galaxy-central

行番号 
1This is not documentation.  These are hints and examples to get you started
2until the documentation is written.
3
4Set these options in universe_wsgi.ini and start the server:
5
6enable_api = True
7admin_users = you@example.org
8library_import_dir = /path/to/some/directory
9
10In the directory you specified for 'library_import_dir', create some
11subdirectories, and put (or symlink) files to import into Galaxy into those
12subdirectories.
13
14In Galaxy, create an account that matches the address you put in 'admin_users',
15then browse to that user's preferences and generate a new API Key.  Copy the
16key to your clipboard and then use these scripts:
17
18% ./display.py my_key http://localhost:4096/api/libraries
19Collection Members
20------------------
21
220 elements in collection
23
24% ./library_create_library.py my_key http://localhost:4096/api/libraries api_test 'API Test Library'
25Response
26--------
27/api/libraries/f3f73e481f432006
28  name: api_test
29  id: f3f73e481f432006
30
31% ./display.py my_key http://localhost:4096/api/libraries
32Collection 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
39Member Information
40------------------
41synopsis: None
42contents_url: /api/libraries/f3f73e481f432006/contents
43description: API Test Library
44name: api_test
45
46% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
47Collection 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'
55Response
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
62Response
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
72Collection 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
92Member Information
93------------------
94misc_blurb: 68 regions
95metadata_endCol: 3
96data_type: bed
97metadata_columns: 6
98metadata_nameCol: 4
99uploaded_by: nate@...
100metadata_strandCol: 6
101name: 2.bed
102genome_build: hg19
103metadata_comment_lines: None
104metadata_startCol: 2
105metadata_chromCol: 1
106file_size: 4272
107metadata_data_lines: 68
108message:
109metadata_dbkey: hg19
110misc_info: uploaded bed file
111date_uploaded: 2010-06-22T17:01:51.266119
112metadata_column_types: str, int, int, str, int, str
113
114Other parameters are valid when uploading, they are the same parameters as are
115used in the web form, like 'link_data_only' and etc.
116
117The request and response format should be considered alpha and are subject to change.
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。