Skip to content

Instantly share code, notes, and snippets.

@josejimenezluna
Created July 6, 2017 09:30
Show Gist options
  • Save josejimenezluna/e8e0622675f41aa99014daef392bfecb to your computer and use it in GitHub Desktop.
Save josejimenezluna/e8e0622675f41aa99014daef392bfecb to your computer and use it in GitHub Desktop.
xscore
def parse(process):
out = process.stdout.decode('utf8')
out = out.split('\n')
for line in out:
if line[:2] == 'HP':
hp = float(line.split('=')[1])
elif line[:2] == 'HM':
hm = float(line.split('=')[1])
elif line[:2] == 'HS':
hs = float(line.split('=')[1])
else:
continue
try:
return hp, hm, hs
except Exception as e:
print(e)
return 0.0, 0.0, 0.0
def runXscore(protein_file, ligand_file, base='/shared/lab/software/xscore/xscore_v1.2.1/c++'):
exec = './xscore'
os.chdir(base)
out = subprocess.run([exec, '-score', protein_file, ligand_file], stdout=subprocess.PIPE)
return parse(out)
@JonasLi-19
Copy link

Hi, I come up against trouble install xscore, the official website cannot be visited: http://sw16.im.med.umich.edu/software/xtool/

Could you please do me a favor to install it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment