@@ -174,7 +174,7 @@ import matplotlib.pyplot as plt
174
174
import scipy.io as sio
175
175
import numpy as np
176
176
import pandas as pd
177
- from genomap.genoMOI import genoMOIvis, genoMOItraj
177
+ import genomap.genoMOI as gp
178
178
179
179
# Load five different pancreatic datasets
180
180
dx = sio.loadmat(' dataBaronX.mat' )
@@ -196,7 +196,7 @@ ybatch = np.squeeze(dx['batchLabel'])
196
196
197
197
# Apply genomap-based multi omic integration and visualize the integrated data with local structure for cluster analysis
198
198
# returns 2D visualization, cluster labels, and intgerated data
199
- resVis,cli,int_data= genoMOIvis(data, data2, data3, data4, data5, colNum = 12 , rowNum = 12 , n_dim = 32 , epoch = 10 , prealign_method = ' scanorama' )
199
+ resVis,cli,int_data= gp. genoMOIvis(data, data2, data3, data4, data5, colNum = 12 , rowNum = 12 , n_dim = 32 , epoch = 10 , prealign_method = ' scanorama' )
200
200
201
201
202
202
plt.figure(figsize = (15 , 10 ))
@@ -222,7 +222,7 @@ plt.show()
222
222
# Apply genomap-based multi omic integration and visualize the integrated data with global structure for trajectory analysis
223
223
224
224
# returns 2D embedding, cluster labels, and intgerated data
225
- resTraj,cli,int_data= genoMOItraj(data, data2, data3, data4, data5, colNum = 12 , rowNum = 12 , n_dim = 32 , epoch = 10 , prealign_method = ' scanorama' )
225
+ resTraj,cli,int_data= gp. genoMOItraj(data, data2, data3, data4, data5, colNum = 12 , rowNum = 12 , n_dim = 32 , epoch = 10 , prealign_method = ' scanorama' )
226
226
227
227
228
228
plt.figure(figsize = (15 , 10 ))
@@ -250,20 +250,22 @@ plt.show()
250
250
import scanpy as sc
251
251
import pandas as pd
252
252
import genomap.genoAnnotate as gp
253
+ import matplotlib.pyplot as plt
253
254
# Load the PBMC dataset
254
- adata = sc.read_10x_mtx(" pbmc3k_filtered_gene_bc_matrices/" )
255
+ adata = sc.read_10x_mtx(" ./ pbmc3k_filtered_gene_bc_matrices/" )
255
256
256
257
# Input: adata: annData containing the raw gene counts
257
258
# tissue type: e.g. Immune system,Pancreas,Liver,Eye,Kidney,Brain,Lung,Adrenal,Heart,Intestine,Muscle,Placenta,Spleen,Stomach,Thymus
258
259
259
- adataP = gp.genoAnnotate(adata,tissue_type = " Immune system" )
260
-
260
+ adataP= gp.genoAnnotate(adata,species = " human" , tissue_type = " Immune system" )
261
+ cell_annotations= adataP.obs[' cell_type' ].values # numpy array containing the
262
+ # cell annotations
261
263
262
- # Compute UMAP (requires neighborhood graph, see the previous code for Louvain clustering)
263
- sc.tl.umap (adataP)
264
- # Create a UMAP plot colored by cell type labels
264
+ # Compute t-SNE
265
+ sc.tl.tsne (adataP)
266
+ # Create a t-SNE plot colored by cell type labels
265
267
cell_annotations= adataP.obs[' cell_type' ]
266
- sc.pl.umap (adataP, color = ' cell_type' )
268
+ sc.pl.tsne (adataP, color = ' cell_type' )
267
269
```
268
270
269
271
### Example 7 - Try genoSig for finding gene signatures for cell/data classes
0 commit comments