Skip to content

Commit

Permalink
Remove testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
AldovdN committed Jul 27, 2022
1 parent e73b10a commit 5313c8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/cport/modules/scannet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import logging
import re
import sys
import tempfile
import time

import mechanicalsoup as ms
import pandas as pd

from Bio import PDB

from cport.url import SCANNET_URL
Expand Down Expand Up @@ -61,7 +58,8 @@ def submit(self):
input_form.set(name="chain", value=self.chain_id)
browser.submit_selected()

processing_url = browser.links()[7]
browser.follow_link(browser.links()[7])
processing_url = browser.get_url()
log.debug(f"The url being looked at: {processing_url}")

return processing_url
Expand Down Expand Up @@ -112,7 +110,6 @@ def retrieve_prediction_link(self, url=None, page_text=None):

return url


def parse_prediction(self, url=None, test_file=None):
"""
Take the results extracts the active and passive residue predictions.
Expand All @@ -135,7 +132,9 @@ def parse_prediction(self, url=None, test_file=None):
browser = ms.StatefulBrowser()

browser.open(url)
pdb_string = re.findall(r"stringContainingTheWholePdbFile = (.*?);", str(browser.page), re.DOTALL)[0]
pdb_string = re.findall(
r"stringContainingTheWholePdbFile = (.*?);", str(browser.page), re.DOTALL
)[0]

structure = parser.get_structure("pdb", io.StringIO(pdb_string))
model = structure[0]
Expand Down Expand Up @@ -167,8 +166,8 @@ def run(self):
log.info("Running ScanNet")
log.info(f"Will try {self.tries} times waiting {self.wait}s between tries")

# submitted_url = self.submit()
# prediction_url = self.retrieve_prediction_link(url=result_url)
prediction_dict = self.parse_prediction(url=result_url)
submitted_url = self.submit()
prediction_url = self.retrieve_prediction_link(url=submitted_url)
prediction_dict = self.parse_prediction(url=prediction_url)

return prediction_dict
2 changes: 1 addition & 1 deletion src/cport/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def get_residue_range(result_dic):
active_reslist += [x for x in result_dic[pred]["active"]]

reslist = passive_reslist + active_reslist
absolute_range = list(range(min(reslist), max(reslist)+1))
absolute_range = list(range(min(reslist), max(reslist) + 1))
return absolute_range


Expand Down

0 comments on commit 5313c8d

Please sign in to comment.