You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#'@description Get index of the clutering related to the given cluster.name.
1442
+
#'@param loom The loom file handler.
1443
+
#'@param cluster.name The name of the cluster.
1444
+
#'@return The index of the clustering in the clusterings metadata global attribute corresponding to the clustering where the given cluster.name is found.
1445
+
get_clustering_idx_by_cluster_name<-function(loom
1446
+
, cluster.name) {
1447
+
library(rlist)
1448
+
# Get global meta data
1449
+
md<-get_global_meta_data(loom=loom)
1450
+
# Unlist the nested meta data tree
1451
+
tmp<-list.flatten(md$clusterings)
1452
+
# Look for the given cluster.name
1453
+
idx= match(x=cluster.name, table=tmp)
1454
+
if(is.na(idx)) {
1455
+
return (idx)
1456
+
}
1457
+
# Reverse search from idx till the first key id is found
1458
+
for(iinidx:1) {
1459
+
if(names(tmp)[i] =="id") id<-tmp[[i]]; break
1460
+
}
1461
+
return (list.findi(.data=md$clusterings, id==id))
1462
+
}
1463
+
1464
+
#'@title get_cluster_info_by_cluster_name
1465
+
#'@description Get cluster information (Clustering ID, Clustering Name, Clustering Group, Cluster ID, Cluster Name) of the given cluster.name.
1466
+
#'@param loom The loom file handler.
1467
+
#'@param cluster.name The name of the cluster.
1468
+
#'@return The index of the clustering in the clusterings metadata global attribute corresponding to the clustering where the given cluster.name is found.
1469
+
#'@export
1470
+
get_cluster_info_by_cluster_name<-function(loom
1471
+
, cluster.name) {
1472
+
library(rlist)
1473
+
# Get global meta data
1474
+
md<-get_global_meta_data(loom=loom)
1475
+
# Get the index of the clustering in the meta data clusterings
#'@description Get a subset of the digital gene expression matrix containing only the cells in the cluster annotated by the given cluster.name.
1528
+
#'@param loom The loom file handler.
1529
+
#'@param cluster.name The name/description of the cluster.
1530
+
#'@return A N-by-M matrix containing the gene expression levels of the cells in the cluster annotated by the given cluster.name. N represents the genes and M the cells.
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
-
# SCopeLoomR v0.2.2
2
-
An R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ...
1
+
# SCopeLoomR v0.3.0
2
+
An R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ... The package can also be used to extract
You can find a tutorial on how to create .loom files [here](https://github.com/aertslab/SCopeLoomR/blob/master/vignettes/SCopeLoomR_tutorial.Rmd).
16
+
You can find a tutorial on how to create .loom files and extract data from them [here](https://github.com/aertslab/SCopeLoomR/blob/master/vignettes/SCopeLoomR_tutorial.Rmd).
16
17
17
18
## Version History
18
19
20
+
November 8, 2018
21
+
22
+
* Version 0.3.0
23
+
* Add feature to extract the gene expression matrix of a given cluster.
0 commit comments