Very minor changes to elaborate in a few places

This commit is contained in:
Sidney Bell
2018-08-07 07:42:45 -07:00
parent 16d7fac88e
commit 12c52a55f7
+6 -6
View File
@@ -60,23 +60,23 @@ _For help with the scanpy engine_
### Scanpy ### Scanpy
To prepare you data you will need to format your data into AnnData format using scanpy and calculate PCA and nearest neighbors and save in h5ad format. To prepare your data you will need to format your data into AnnData format using scanpy and calculate PCA and nearest neighbors and save in h5ad format.
1. [Load data into scanpy](https://scanpy.readthedocs.io/en/latest/api/index.html#exporting) 1. [Load data into scanpy](https://scanpy.readthedocs.io/en/latest/api/index.html#reading)
- Ensure that `obs`'s index is the cell names - Ensure that `obs`'s index is the cell names: `print(data.obs_names)` should show your cell indices. If it shows gene names, you may need to just call `data.transpose()`.
2. Calculate PCA 2. Calculate PCA
sc.pp.pca(data) sc.pp.pca(data) ## sc is scanpy.api
3. Calculate nearest neighbors (depending on layout algorithm) 3. Calculate nearest neighbors (depending on layout algorithm)
``` ```
# For umap layout algorithm # For umap layout algorithm, you need to use the "umap" method for neighbors
sc.pp.neighbors(data, method="umap", metric="euclidean", use_rep="X_pca") sc.pp.neighbors(data, method="umap", metric="euclidean", use_rep="X_pca")
# For tsne layout algorithm # For tsne layout algorithm, you can use either "umap" or "gauss"; we recommend "gauss"
sc.pp.neighbors(data, method="gauss", metric="euclidean", use_rep="X_pca") sc.pp.neighbors(data, method="gauss", metric="euclidean", use_rep="X_pca")
``` ```