forked from ga4gh/ga4gh-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle_examples.py
More file actions
71 lines (63 loc) · 2.2 KB
/
google_examples.py
File metadata and controls
71 lines (63 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""
End-to-end tests that run against the Google server
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shlex
import utils
def getKey():
doc = utils.getAuthValues()
key = doc['google']['key']
return key
def runTests():
separator = "----------------------"
path = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'..', 'client_dev.py')
baseUrl = "https://www.googleapis.com/genomics/v1beta2"
key = getKey()
keyStr = "--key {0}".format(key)
workarounds = "--workarounds=google"
minimalOutput = "-O"
commands = [
"variants-search --variantSetIds 10473108253681171589 "
"--referenceName 22 --start 51005491 --end 51005492 --pageSize 1",
"references-list-bases --id EIaSo62VtfXT4AE --start 15000 "
"--end 15010",
"referencesets-get --id EMud_c37lKPXTQ",
"references-get --id EIaSo62VtfXT4AE",
"variantsets-search --datasetIds 10473108253681171589",
"referencesets-search --accessions GCA_000001405.15",
"references-search --md5checksums 1b22b98cdeb4a9304cb5d48026a85128",
"readgroupsets-search --datasetIds 10473108253681171589 "
"--name NA12878 --pageSize 1",
"callsets-search --variantSetIds 10473108253681171589 "
"--name HG00261 --pageSize 1",
"reads-search --start 51005353 --end 51005354 --readGroupIds "
"ChhDTXZuaHBLVEZoQ2JpT2J1enZtN25Pb0IQAA --referenceName "
"22 --pageSize 1",
]
for command in commands:
cmdStr = """
python {path} {keyStr} {minimalOutput} {workarounds}
{command} {baseUrl}
"""
cmdDict = {
"path": path,
"command": command,
"workarounds": workarounds,
"keyStr": keyStr,
"baseUrl": baseUrl,
"minimalOutput": minimalOutput,
}
cmd = cmdStr.format(**cmdDict)
splits = shlex.split(cmd)
cleanCmd = ' '.join(splits)
utils.log(separator)
utils.log(cleanCmd)
utils.log(separator)
utils.runCommandSplits(splits)
if __name__ == '__main__':
runTests()