-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis.py
33 lines (24 loc) · 990 Bytes
/
analysis.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
import pandas as pd
import requests
#import datetime
#from bs4 import BeautifulSoup as bs
#import collections
df = pd.read_excel("~/Documents/data/Phosphopeptide files/QE013961ECDM prot.xlsm")
columns = df.columns.values #list of column names
light = df.loc[:, "Abundances (Grouped): F1, Light"] #list of Descriptions
heavy = df.loc[:, "Abundances (Grouped): F1, Heavy"]
#with open('labels.txt', 'w') as f:
# for column in columns:
# f.write('%s\n'%column)
protein = "Q9NUU7"
if __name__ == "__main__":
url = "https://rest.uniprot.org/uniprotkb/search?query=" + protein
results = requests.get(url).json()["results"]
accession = results[0]["primaryAccession"]
name = results[0]["proteinDescription"]["recommendedName"]["fullName"]["value"]
seq = results[0]["sequence"]
#sp = bs(r.text, "xml")
#obj = r.text.split("{")
#order = collections.OrderedDict(r.json())
#keys = list(order)
print(results[0]["proteinDescription"])