Skip to content

Commit

Permalink
[visualize] moved some methods to unused_untested.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gph82 committed Mar 14, 2017
1 parent 4e43bc1 commit 50b7213
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 99 deletions.
101 changes: 100 additions & 1 deletion molpx/unused_untested.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,4 +523,103 @@ def _onclick(event):
axes_widget = _AxesWidget(ax)
axes_widget.connect_event('button_release_event', onclick)

return vmdpipe
return vmdpipe

# Do I really need this? Don't think so
def _fnamez(fname,
path_type='min_rmsd',
proj_type='TIC',
only_selection=True,
selection_label='within 1 sigma',
figsize=(10,10)
):

proj_name = _basename(fname)[:_basename(fname).find(proj_type)].strip('.')

data, selection, x, y, h, v_crd_1, v_crd_2 = _extract_visual_fnamez(fname, path_type)
data = data[:,[v_crd_1,v_crd_2]]

# Load geometry
geom = _md.load(fname.replace('.npz','.%s.pdb'%path_type))

# Create contourplot
_plt.figure(figsize=figsize)
_plt.contourf(x[:-1],y[:-1], h.T, alpha=.50)
#_plt.contourf(project_dict["h"].T, alpha=.50)
# This can be take care of in "visualize sample"
_plt.plot(data[:, v_crd_1],
data[:, v_crd_2],
alpha=.25, label=path_type)

if only_selection:
geom = geom[selection]
data = data[selection]
_plt.plot(data[:,0],data[:,1],'o', label=path_type+' '+selection_label)

_plt.legend(loc='best')
_plt.xlabel('%s %u'%(proj_type, v_crd_1))
_plt.ylabel('%s %u'%(proj_type, v_crd_2))
_plt.xlim(x[[0,-1]])
_plt.ylim(y[[0,-1]])
_plt.title('%s\n-np.log(counts)'%proj_name)

iwd = sample(data, geom, _plt.gca(), plot_path=False, clear_lines=False)

project_dict = {}
for key, value in _np.load(fname).items():
project_dict[key] = value

return iwd, project_dict

# Do I really need this? Don't think so
def _project_dict(project_dict,
path_type='min_rmsd',
proj_type='TIC',
only_compact_path=True,
selection_label='within 1 sigma',
figsize=(10,10),
project_name = None
):



# From dict to variables
if path_type == 'min_rmsd':
path = project_dict["Y_path_smpl"]
compact_path = project_dict["compact_path_sample"]
elif path_type == 'min_disp':
path = project_dict["Y_path"]
compact_path = project_dict["compact_path"]
v_crd_1 = project_dict["v_crd_1"]
v_crd_2 = project_dict["v_crd_2"]
path = path[:, [v_crd_1, v_crd_2]]
geom = project_dict["geom_"+path_type]
x = project_dict["x"]
y = project_dict["y"]
h = project_dict["h"]

# Create contourplot
_plt.figure(figsize=figsize)
_plt.contourf(x[:-1],y[:-1], h.T, alpha=.50) #ATTN h is already log(PDF)

# This can be taken care of in "visualize sample", but i'm doing it here
_plt.plot(path[:, 0],
path[:, 1],
alpha=.25, label=path_type)

if only_compact_path:
geom = geom[compact_path]
path = path[compact_path]
_plt.plot(path[:,0],path[:,1],'o', label=path_type+' '+selection_label)

_plt.legend(loc='best')
_plt.xlabel('%s %u'%(proj_type, v_crd_1))
_plt.ylabel('%s %u'%(proj_type, v_crd_2))
_plt.xlim(x[[0,-1]])
_plt.ylim(y[[0,-1]])
if project_name is not None:
_plt.title('-np.log(counts)\n%s'%project_name)

iwd = sample(path, geom, _plt.gca(), plot_path=False, clear_lines=False)

return iwd
98 changes: 0 additions & 98 deletions molpx/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,101 +340,3 @@ def sample(positions, geom, ax,

return iwd

# Do I really need this? Don't think so
def _fnamez(fname,
path_type='min_rmsd',
proj_type='TIC',
only_selection=True,
selection_label='within 1 sigma',
figsize=(10,10)
):

proj_name = _basename(fname)[:_basename(fname).find(proj_type)].strip('.')

data, selection, x, y, h, v_crd_1, v_crd_2 = _extract_visual_fnamez(fname, path_type)
data = data[:,[v_crd_1,v_crd_2]]

# Load geometry
geom = _md.load(fname.replace('.npz','.%s.pdb'%path_type))

# Create contourplot
_plt.figure(figsize=figsize)
_plt.contourf(x[:-1],y[:-1], h.T, alpha=.50)
#_plt.contourf(project_dict["h"].T, alpha=.50)
# This can be take care of in "visualize sample"
_plt.plot(data[:, v_crd_1],
data[:, v_crd_2],
alpha=.25, label=path_type)

if only_selection:
geom = geom[selection]
data = data[selection]
_plt.plot(data[:,0],data[:,1],'o', label=path_type+' '+selection_label)

_plt.legend(loc='best')
_plt.xlabel('%s %u'%(proj_type, v_crd_1))
_plt.ylabel('%s %u'%(proj_type, v_crd_2))
_plt.xlim(x[[0,-1]])
_plt.ylim(y[[0,-1]])
_plt.title('%s\n-np.log(counts)'%proj_name)

iwd = sample(data, geom, _plt.gca(), plot_path=False, clear_lines=False)

project_dict = {}
for key, value in _np.load(fname).items():
project_dict[key] = value

return iwd, project_dict

# Do I really need this? Don't think so
def _project_dict(project_dict,
path_type='min_rmsd',
proj_type='TIC',
only_compact_path=True,
selection_label='within 1 sigma',
figsize=(10,10),
project_name = None
):



# From dict to variables
if path_type == 'min_rmsd':
path = project_dict["Y_path_smpl"]
compact_path = project_dict["compact_path_sample"]
elif path_type == 'min_disp':
path = project_dict["Y_path"]
compact_path = project_dict["compact_path"]
v_crd_1 = project_dict["v_crd_1"]
v_crd_2 = project_dict["v_crd_2"]
path = path[:, [v_crd_1, v_crd_2]]
geom = project_dict["geom_"+path_type]
x = project_dict["x"]
y = project_dict["y"]
h = project_dict["h"]

# Create contourplot
_plt.figure(figsize=figsize)
_plt.contourf(x[:-1],y[:-1], h.T, alpha=.50) #ATTN h is already log(PDF)

# This can be taken care of in "visualize sample", but i'm doing it here
_plt.plot(path[:, 0],
path[:, 1],
alpha=.25, label=path_type)

if only_compact_path:
geom = geom[compact_path]
path = path[compact_path]
_plt.plot(path[:,0],path[:,1],'o', label=path_type+' '+selection_label)

_plt.legend(loc='best')
_plt.xlabel('%s %u'%(proj_type, v_crd_1))
_plt.ylabel('%s %u'%(proj_type, v_crd_2))
_plt.xlim(x[[0,-1]])
_plt.ylim(y[[0,-1]])
if project_name is not None:
_plt.title('-np.log(counts)\n%s'%project_name)

iwd = sample(path, geom, _plt.gca(), plot_path=False, clear_lines=False)

return iwd

0 comments on commit 50b7213

Please sign in to comment.