-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Lines 63 to 69 in b61935a
| def embedDistanceMatrix(dmatDf, method='kpca', n_components=2, **kwargs): | |
| """Two-dimensional embedding of sequence distances in dmatDf, | |
| returning Nx2 x,y-coords: tsne, isomap, pca, mds, kpca, sklearn-tsne""" | |
| if isinstance(dmatDf, pd.DataFrame): | |
| dmat = dmatDf.values | |
| else: | |
| dmat = dmatDf |
Note that the upper portion of the function is meant to accomodate either numpy.array or pd.DataFrame passed to dmatDf, but if numpy array is supplied then L111 will raise an error:
Line 111 in b61935a
| xyDf = pd.DataFrame(xy[:, :n_components], index=dmatDf.index, columns=np.arange(n_components)) |
Example
embedDistanceMatrix(dmatDf = pd.DataFrame(tr.pw_beta[0:10,:][:,0:10]), method = "mds")👍
embedDistanceMatrix(dmatDf = tr.pw_beta[0:10,:][:,0:10], method = "mds")👎
AttributeError: 'numpy.ndarray' object has no attribute 'index'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels