/
test.py
51 lines (33 loc) · 1.12 KB
/
test.py
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
import json
import requests
import pandas as pd
url = "http://localhost:5001/matrixapi/colid"
# this function will return the colids
payload = {"id": "A1CF"}
response = requests.post(url, json=payload)
data = json.loads(response.text)
print(data)
url = "http://localhost:5001/matrixapi/col"
# this function will return the full column specified
payload = {"id": "A1CF"}
response = requests.post(url, json=payload)
data = json.loads(response.text)
print(data)
# extract sub matrix
payload = {"rowids": ["A1CF", "AAAS", "A2M"], "colids": ["ABHD1", "ABO", "doesnetexist"]}
response = requests.post("http://localhost:5001/matrixapi/slice", json=payload)
data = json.loads(response.text)
print(data)
url = "http://localhost:5001/matrixapi/coltop"
# this function will return the colids
payload = {"id": "A1CF", "count": 20}
response = requests.post(url, json=payload)
data = json.loads(response.text)
print(data)
url = "https://maayanlab.cloud/matrixapi/coltop"
data = ""
# this function will return the colids
payload = {"id": "SOX2", "count": 20}
response = requests.post(url, json=payload)
data = json.loads(response.text)
print(data)