stephlj / slopey

Quantification of single-molecule FRET trajectories containing fast, non-instantaneous transitions
1 stars 0 forks source link

More than one slopey bit #1

Closed stephlj closed 8 years ago

stephlj commented 8 years ago

When I set num_slopey to 2 instead of 1 in real_data_template.py, and then run it, I get this (see below). Looks like just a plotting error?

In [1]: run scripts/real_data_template.py

accept proportion: 0.416

ValueError Traceback (most recent call last) /Users/Steph/Documents/UCSF/Narlikar lab/HMM analysis Slopey/slopey/scripts/real_data_template.py in () 60 61 # plot the results ---> 62 plot_samples(samples, z, T_cycle) 63 plt.show()

/Users/Steph/Documents/UCSF/Narlikar lab/HMM analysis Slopey/slopey/slopey/plotting.pyc in plot_samples(samples, z, T_cycle) 37 plt.axes(axs[1]) 38 for sampled_theta, sampled_u in samples[-1::-50]: ---> 39 plot_sample(sampled_theta, sampled_u, color='r', alpha=0.05)

/Users/Steph/Documents/UCSF/Narlikar lab/HMM analysis Slopey/slopey/slopey/plotting.pyc in plot_sample(theta, u, _kwargs) 27 28 def plot_sample(theta, u, _kwargs): ---> 29 plot_theta(theta, num_frames * T_cycle, u, **kwargs) 30 31 fig, axs = plt.subplots(2,1, figsize=(8,6))

/Users/Steph/Documents/UCSF/Narlikar lab/HMM analysis Slopey/slopey/slopey/plotting.pyc in plot_theta(theta, time_max, time_offset, _plot_kwargs) 18 plt.plot(xs, ys, _plot_kwargs) 19 plt.plot(times[::2], vals[::2], 'gx', _plot_kwargs) ---> 20 plt.plot(times[1::2], vals[1::2], 'bx', _plot_kwargs) 21 plt.ylim(0., np.max(ys) + 1.) 22 plt.xlim(0., time_max - time_offset)

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in plot(_args, _kwargs) 3152 ax.hold(hold) 3153 try: -> 3154 ret = ax.plot(_args, _kwargs) 3155 finally: 3156 ax.hold(washold)

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/init.pyc in inner(ax, _args, _kwargs) 1809 warnings.warn(msg % (label_namer, func.name), 1810 RuntimeWarning, stacklevel=2) -> 1811 return func(ax, _args, _kwargs) 1812 pre_doc = inner.doc 1813 if pre_doc is None:

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc in plot(self, _args, _kwargs) 1425 kwargs['color'] = c 1426 -> 1427 for line in self._get_lines(_args, _kwargs): 1428 self.add_line(line) 1429 lines.append(line)

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _grab_next_args(self, _args, *_kwargs) 384 return 385 if len(remaining) <= 3: --> 386 for seg in self._plot_args(remaining, kwargs): 387 yield seg 388 return

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _plot_args(self, tup, kwargs) 362 x, y = index_of(tup[-1]) 363 --> 364 x, y = self._xy_from_xy(x, y) 365 366 if self.command == 'plot':

/Users/Steph/miniconda/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _xy_from_xy(self, x, y) 221 y = _check_1d(y) 222 if x.shape[0] != y.shape[0]: --> 223 raise ValueError("x and y must have same first dimension") 224 if x.ndim > 2 or y.ndim > 2: 225 raise ValueError("x and y can be no greater than 2-D")

ValueError: x and y must have same first dimension

mattjj commented 8 years ago

Note the changes to real_data_template.py in that commit: I doubled the number of MH iterations and cut off what I think is the long prefix on the data.

mattjj commented 8 years ago

Here's what should come out:

issue1