""" Since BindingDB has its own monomer IDs, all IDs are converted to PubChem CIDs. For that, the list of all the identifier
mappings from monomer ID to PubChem IDs is downloaded from BindingDB webpage given below. That the file called monomer.txt
is used in the code. Thus, used need to download the updated list, then use it in our code.
(https://www.bindingdb.org/bind/chemsearch/marvin/SDFdownload.jsp?all_download=yes)"""

from bioservices.uniprot import UniProt
import requests
from xml.etree import ElementTree
u = UniProt()
 
res = u.search('(sphingolipid+OR+sphingomyelin+OR+glycosphingolipid)+AND+organism:9606 ', frmt='tab',columns='id')
identifiers = res.strip().split()[1:]
#hey = open("bindingdb.txt","w")
f=open("monomer.txt","r")
lines=f.readlines()

monoid = []
mono = []
sim= []
CID=[]
cid = []

""" All the monomerIDs and their equivalent CIDs are saved as separate arrays"""

for line in lines:
  monoid.append(line.split()[0])


for line in lines:
  cid.append(line.split()[1])