Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mol2_lines=q_mol2[1])
q_pdmol._df = q_pdmol.df[(q_pdmol.df['atom_type'] != 'H')]
cache[q_mol2[0]] = q_pdmol
atoms, charges = get_atom_matches(q_pdmol, d_pdmol)
dct_results['query'].append(q_mol2[0])
dct_results['dbase'].append(d_mol2[0])
dct_results['atoms'].append(atoms)
dct_results['charges'].append(charges)
"""
with open(output_file + '_charge.tsv', 'w') as f1,\
open(output_file + '_atomtype.tsv', 'w') as f2:
columns = PandasMol2().read_mol2(q_path).df['atom_name'].values
f1.write('dbase\tquery\t%s\n' % '\t'.join(columns))
f2.write('dbase\tquery\t%s\n' % '\t'.join(columns))
for i in range(len(dct_results['dbase'])):
s1 = '%s\t%s\t%s\n' % (dct_results['dbase'][i],
dct_results['query'][i],
'\t'.join(format(x, "1.2f")
for x in dct_results['charges'][i]))
f1.write(s1)
s2 = '%s\t%s\t%s\n' % (dct_results['dbase'][i],
dct_results['query'][i],
'\t'.join(dct_results['atoms'][i]))
f2.write(s2)
if verbose:
elapsed = time.time() - start
def data_processor_gz(mol2_gz):
pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2_gz[1],
mol2_code=mol2_gz[0])
match = mol2_gz[0].decode('utf-8')
for sub_sele in SELECTION:
if not pd.eval(sub_sele).any():
match = ''
break
return match
def data_processor_gz(mol2_gz):
pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2_gz[1],
mol2_code=mol2_gz[0])
coordinates = pdmol.df.loc[pd.eval(SELECTION[0]), ['x', 'y', 'z']].values
pdmol._df = pdmol._df[pd.eval(SELECTION[1])]
for xyz in coordinates:
distances = pdmol.distance(xyz)
match = ((distances.values >= DISTANCE[0]).any() and
(distances.values <= DISTANCE[1]).any())
if match:
return mol2_gz[0].decode('utf-8')
def data_processor(mol2s):
q_pdmol = PandasMol2()
d_pdmol = PandasMol2()
d_pdmol.read_mol2_from_list(mol2_code=mol2s[0][0],
mol2_lines=mol2s[0][1])
q_pdmol.read_mol2_from_list(mol2_code=mol2s[1][0],
mol2_lines=mol2s[1][1])
atoms, charges = get_atom_matches(q_pdmol, d_pdmol)
return mol2s[0][0], mol2s[1][0], atoms, charges
def data_processor(mol2):
pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2[1],
mol2_code=mol2[0])
coordinates = pdmol.df.loc[pd.eval(SELECTION[0]), ['x', 'y', 'z']].values
pdmol._df = pdmol._df[pd.eval(SELECTION[1])]
for xyz in coordinates:
distances = pdmol.distance(xyz)
match = ((distances.values >= DISTANCE[0]).any() and
(distances.values <= DISTANCE[1]).any())
if match:
return mol2[0]
def data_processor(mol2s):
q_pdmol = PandasMol2()
d_pdmol = PandasMol2()
d_pdmol.read_mol2_from_list(mol2_code=mol2s[0][0],
mol2_lines=mol2s[0][1])
q_pdmol.read_mol2_from_list(mol2_code=mol2s[1][0],
mol2_lines=mol2s[1][1])
atoms, charges = get_atom_matches(q_pdmol, d_pdmol)
return mol2s[0][0], mol2s[1][0], atoms, charges
def data_processor_gz(mol2s_gz):
q_pdmol = PandasMol2()
d_pdmol = PandasMol2()
d_pdmol.read_mol2_from_list(mol2_code=mol2s_gz[0][0],
mol2_lines=mol2s_gz[0][1])
q_pdmol.read_mol2_from_list(mol2_code=mol2s_gz[1][0],
mol2_lines=mol2s_gz[1][1])
atoms, charges = get_atom_matches(q_pdmol, d_pdmol)
return (mol2s_gz[0][0].decode('utf-8'),
mol2s_gz[1][0].decode('utf-8'),
atoms, charges)
def data_processor(mol2):
pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2[1],
mol2_code=mol2[0])
match = mol2[0]
for sub_sele in SELECTION:
if not pd.eval(sub_sele).any():
match = ''
break
return match
def data_processor_gz(mol2s_gz):
q_pdmol = PandasMol2()
d_pdmol = PandasMol2()
d_pdmol.read_mol2_from_list(mol2_code=mol2s_gz[0][0],
mol2_lines=mol2s_gz[0][1])
q_pdmol.read_mol2_from_list(mol2_code=mol2s_gz[1][0],
mol2_lines=mol2s_gz[1][1])
atoms, charges = get_atom_matches(q_pdmol, d_pdmol)
return (mol2s_gz[0][0].decode('utf-8'),
mol2s_gz[1][0].decode('utf-8'),
atoms, charges)