我有以下课程,开头如下:
dataSeries <- R6Class("dataSeries",
public = list(
geoAccession = NULL,
species = NULL,
tissue = NULL,
seuratObjectPath = NULL,
markerType = NULL,
clusters = NULL,
clusterTable = NULL,
clusterSymbols = NULL,
clusterPVs = NULL,
clusterGIDs = NULL,
clusterKGs = NULL,
clusterKPs = NULL,
clusterKOs = NULL,
我有另一堂课,开头如下:
metaSeries <- R6Class("metaSeries",
public = list(
seriesList = NULL,
initialize = function(dataDir="Data/Data_Series/Current"){
browser()
if(!is.null(dataDir)){
toProcess = list.files(dataDir,full.names = T)
self$seriesList = vector("list", length(toProcess))
count = 1
for(file in toProcess){
series <- readRDS(file)
self$seriesList[[count]] <- series
count = count + 1
}
}
},
findMetaFeatures = function(feature="clusterKPs", rank=3, plot=TRUE){
在实践中,metaSeries$seriesList 将被初始化为 dataSeries 类型的列表。dataSeries$findMetaFeatures 必须能够调用 dataSeries$seriesList[[i]]$feature,其中 feature 位于 {clusterGIDs,clusterKGs,clusterKPs,clusterKOs} 中。默认情况下 findMetaFeatures 使用 feature="clusterKPs" 调用。在 metaSeries$findMetaFeatures 中,当检查位于 self$seriesList 中的一些 dataSeries 类型的对象时,我需要一种方法来匹配字符串“clusterKPs”与具有该名称的属性。