BumpyMatrix 1.5.0
的BumpyMatrix
Class是一个二维对象,其中每个条目包含一个常量类型/类但可变长度的非标量对象。这可以被认为是第三维度的粗糙,即“凹凸不平”。的BumpyMatrix
是为了表示复杂的数据,在单个数据点和每个特征/样本之间有0到多的映射,允许我们将其存储在Bioconductor的标准2维容器中,如SummarizedExperiment
.例如,为高度多路复用的FISH数据存储转录本坐标;的尺寸BumpyMatrix
可以表示基因和细胞,而每个条目是一个具有相关x/y坐标的数据帧。
各种各样的BumpyMatrix
实现了子类,但最有趣的可能是BumpyDataFrameMatrix
.这是一个S4矩阵类,其中每个元素都是aDataFrame
对象,即Bioconductor的包装data.frame
.为了演示,让我们为假设的FISH实验模拟一些数据:
库(S4Vectors) df <- DataFrame(x=rnorm(10000), y=rnorm(10000),基因=paste0("GENE_", sample(100,10000, replace=TRUE)),细胞=paste0("CELL_", sample(20,10000, replace=TRUE))) df
##数据帧与10000行和4列## y基因细胞## <数字> <数字> <字符> <字符> ## 1 1.262954 -1.2195513 GENE_81 CELL_9 ## 2 -0.326233 -1.2014602 GENE_10 CELL_14 ## 3 1.329799 -0.4960425 GENE_66 CELL_7 ## 4 1.272429 0.0669311 GENE_4 CELL_12 ## 5 0.414641 -0.0569491 GENE_74 CELL_5 ## ... ... ... ... ...1 . gene_85 cell_10000 -0.0556033 - 0.279099 gene_52 cell_5
然后我们使用splitAsBumpyMatrix ()
实用工具,轻松创建我们的BumpyDataFrameMatrix
根据x轴和y轴上的变量。在这里,每一行是一个基因,每一列是一个细胞,每个条目包含该基因/细胞组合的所有坐标。
库(BumpyMatrix) mat <- splitAsBumpyMatrix(df[,c("x", "y")], row=df$gene, column=df$cell) mat
## 100 x 20 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
垫[1]([1])
##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
我们也可以设置稀疏= TRUE
使用更有效的稀疏表示,避免显式存储空DataFrame
s.对于较大的数据集,这可能是必要的,因为每个数据集中有2147483647(非空)项的限制BumpyMatrix
.
select <- df[1:100,] smat <- splitAsBumpyMatrix(select [,c("x", "y")], row= selected $gene, column= selected $cell, sparse=TRUE) smat
## 67 x 20 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_97 GENE_99 ## colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:## 0行2列的数据帧
的BumpyMatrix
实现了许多标准矩阵操作,例如,nrow ()
,dimnames ()
、组合方法及换位。
暗(垫)
## [1] 100 20
dimnames(垫)
# # # #[1]([1])“GENE_1”“GENE_10”“GENE_100”“GENE_11”“GENE_12”“GENE_13”# #[7]“GENE_14”“GENE_15”“GENE_16”“GENE_17”“GENE_18”“GENE_19”# #[13]“GENE_2”“GENE_20”“GENE_21”“GENE_22”“GENE_23”“GENE_24”# #[19]“GENE_25”“GENE_26”“GENE_27”“GENE_28”“GENE_29”“GENE_3”# #[25]“GENE_30”“GENE_31”“GENE_32”“GENE_33”“GENE_34”“GENE_35”# #[31]“GENE_36”“GENE_37”“GENE_38”“GENE_39”“GENE_4”“GENE_40”# #[37]“GENE_41”“GENE_42”“GENE_43”“GENE_44”“GENE_45”“GENE_46”# #[43]“GENE_47”“GENE_49”“GENE_48 GENE_5”“GENE_50”“GENE_51”# #[49]“GENE_52”“GENE_53”“GENE_54”“GENE_55”“GENE_56”“GENE_57”# #[55]“GENE_58”“GENE_59”“GENE_6”“GENE_60”“GENE_61”“GENE_62”# #[61]“GENE_63”“GENE_64”“GENE_65”“GENE_66”“GENE_67”“GENE_68”# #[67]“GENE_69”“GENE_7”“GENE_70”“GENE_71”“GENE_72”“GENE_73”# #[73]“GENE_74”“GENE_75”“GENE_76”“GENE_77”“GENE_78”“GENE_79”# #[79]“GENE_8”“GENE_80”“GENE_81”“GENE_82”“GENE_83”“GENE_84”# #[85]“GENE_85”“GENE_86”“GENE_87”“GENE_89”“GENE_88 GENE_9“# #[91]“GENE_90”“GENE_91”“GENE_92”“GENE_93”“GENE_94”“GENE_95”# #[97]“GENE_96”“GENE_98”“GENE_97 GENE_99 " ## ## [[ 2]] # #[1]“CELL_1”“CELL_10”“CELL_11”“CELL_12”“CELL_13”“CELL_14”“CELL_15”# #[8]“CELL_16”“CELL_17”“CELL_18”“CELL_19”“CELL_2”“CELL_20”“CELL_3”# #[15]“CELL_4”“CELL_5”“CELL_6”“CELL_7”“CELL_8”“CELL_9”
rbind(垫,垫)
## 200 x 20 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
cbind(垫,垫)
## 100 x 40 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
t(垫)
## 20 x 100 BumpyDataFrameMatrix ## rownames: CELL_1 CELL_10…CELL_8 CELL_9 ## colnames: GENE_1 GENE_10…GENE_98 GENE_99 ##预览[1,1]:##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
子集将产生一个新的BumpyMatrix
与指定子矩阵对应的。如果返回的子矩阵的维数为1,并且= TRUE下降
,潜在的CompressedList
的值(在本例中,的列表DataFrame
S)返回。
垫(c(“GENE_2”、“GENE_20”),)
2 x 20 BumpyDataFrameMatrix ## rownames: GENE_2 GENE_20 ## colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与9行2列## x y ## <数字> <数字> ## 1 0.6006726 2.2264549 ## 2 0.5633180 -0.5785644 ## 3 -0.9858359 0.5030357 ## 4 1.9680003 1.8404334 ## 5 0.2817334 0.0957103 ## 6 -0.0787825 -1.1799429 ## 7 -1.5499071 -0.1132942 ## 8 0.3269564 0.2557983 ## 9 -0.5103373 -0.3180972
垫[1:5]
## 100 x 5 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 ## colnames: CELL_1 CELL_10 CELL_11 CELL_12 CELL_13 ##预览[1,1]:##数据帧与5行2列## x y ## <数字> <数字> ## 1 -0.456681 1.1802570 ## 2 2.260953 0.0664656 ## 3 1.589902 -0.5645328 ## 4 -0.932046 -0.9511974 ## 5 1.073516 0.8238178
垫(“GENE_10”)
# # SplitDataFrameList长度20 # # $ CELL_1 # # DataFrame 6行2列# # x y # # <数字> <数字> # # 1 # # 2 2.6989263 - 0.9616407 -0.4437397 - -1.1806866 0.0485278 - 0.3189288 -0.7392878 - 0.5467073 # # 3 # # 4 # 5 # -1.6825538 - 0.7924868 # 6 # CELL_10美元0.1882398 - 0.0267774 # # # # # # DataFrame 7行2列# # x y # # <数字> <数字> # # 1 # # 2 0.216737 - 0.690170 -0.294196 - 0.531934 -1.198632 - 0.866599 -0.603301 - -1.024468 # # 3 # # 4 # 5 # -1.160206 - 1.029362 # 6 # -0.996214 - -0.731540 # #7 -1.497422 -0.635969 ## ## $CELL_11 ## DataFrame with 3 rows and 2 columns ## x y ## ## 1 1.3397324 -0.8455987 ## 2 0.0355647 0.9836901 ## 3 -0.9233099 0.0480218 ## ## ... ## <17 more elements>
为BumpyDataFrameMatrix
对象,我们有一个额外的第三个索引,允许我们轻松地提取每个对象的单独列DataFrame
进入一个新的BumpyMatrix
.在下面的例子中,我们将x坐标提取到newBumpyNumericMatrix
:
出去了。x<- mat[,,"x"] out.x
## 100 x 20 BumpyNumericMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:## num [1:5] -0.457 2.261 1.59 -0.932 1.074
out.x [1]
##长度为100的数字列表## [["GENE_1"]] -0.456680962301832 2.26095325993182…1.07351568637374 ## [[" gene_10 "]] -0.443739703296155 2.69892631656385…0.188239840894589 ## [[" gene_100 "]] -0.0521083287975451 -0.959848960471883 -1.69849738722303 1.20187171507774 ## [[" gene_11 "]] 0.170720585504045 -0.632693519163165 0.0474731889735527 0.686758871296805 ## [[" gene_12 "]] -0.145945860989099…-0.75308908554855 ## [[" gene_13 "]]] -0.449876006420393 -0.491325515925785 -0.0800044195125232 1.47031802805851 ## [[" gene_14 "]]] 0.837394397366885 -1.09885654076545…0.0788476240211941 ## [[" gene_15 "]] -1.30967954169979 -1.07803449338206…1.10399748359464 ## [[" gene_16 "]] -0.299215117897316 -0.655378696153722…1.04146605380096 ## [[" gene_17 "]] 0.387769028629511 1.27455066651572 0.0634504926146246 -0.654969069758301 ##…## <90个以上的元素>
常见的算术和逻辑操作已经实现BumpyNumericMatrix
子类。几乎所有这些操作都将作用于输入对象的每个条目(或对应的条目,对于多个输入)并产生newBumpyMatrix
合适的类型。
Pos <- out。x> 0 pos[,1]
长度为100 # # # # LogicalList[[“GENE_1”]]假真的真的假的真# #[[“GENE_10”]]假真的假的真的假真# #[[“GENE_100”]]假假假真# #[[“GENE_11”]]真的假的真的真的# #[[“GENE_12”]]假假假假真假假真的真的假的真的假的# #[[“GENE_13”]]假假假真# #[[“GENE_14”]]真假假真假假真# #[[“GENE_15”]]假假真真正的假真# #[[“GENE_16”]]假假真假假真# #[[“GENE_17”]]真真假假##…## <90个以上的元素>
Shift <- 10 * out。X + 1 shift[,1]
##长度为100的数字列表## [["GENE_1"]] -3.56680962301832 23.6095325993182…11.7351568637374 ## [[" gene_10 "]] -3.43739703296155 27.9892631656385…2.88239840894589 ## [[" gene_100 "]] 0.478916712024549 -8.59848960471883 -15.9849738722303 13.0187171507774 ## [[" gene_11 "]] 2.70720585504045 -5.32693519163165 1.47473188973553 7.86758871296805 ## [[" gene_12 "]] -8.95342637599223 -0.459458609890994…-6.5308908554855 ## [[" gene_13 "]]] -3.49876006420393 -3.91325515925785 0.199955804874768 15.7031802805851 ## [[" gene_14 "]] 9.37394397366885 -9.98856540765453…1.78847624021194 ## [[" gene_15 "]] -12.0967954169979 -9.78034493382059…12.0399748359464 ## [[" gene_16 "]] -1.99215117897316 -5.55378696153722…11.4146605380095 ## [[" gene_17 "]]] 4.87769028629511 13.7455066651572 1.63450492614625 -5.54969069758301 ##…## <90个以上的元素>
出去了。Y <- mat[,," Y "]大于- out。X < out。大y [1]
长度为100 # # # # LogicalList[[“GENE_1”]]真的假假假假的# #[[“GENE_10”]]假假的真的真的真的假# #[[“GENE_100”]]真的真的真的假的# #[[“GENE_11”]]真真假假# #[[“GENE_12”]]真的假假真的真的真的真的假假假的真的假的# #[[“GENE_13”]]真的真的真的假的# #[[“GENE_14”]]真的假的真的假的真的真的真的# #[[“GENE_15”]]真真假假假真# #[[“GENE_16”]]真的真的假的真的假的假# #[[“GENE_17”]]真的##…## <90个以上的元素>
Diff <- out。Y - out。xdiff[,1]
##长度为100的数字列表[["GENE_1"]] 1.63693791572228 -2.19448769611817…-0.249697865694356 ## [[" gene_10 "]]] -0.736946857599669 -1.73728562932688…-0.161462478389356 ## [[" gene_100 "]] 0.385070842100422 0.830947088787695 1.28842673980641 -0.930637428293555 ## [[" gene_11 "]] 2.19924827461933 1.2939182751824 -0.73459027884472 -0.974124539123142 ## [[" gene_12 "]] 0.0112704909161504 -2.10310060588711…-0.902168554270107 ## [[" gene_13 "]]] 1.16478634799064 0.186402515479371 0.996944355639376 -0.116586294264194 ## [[" gene_14 "]] 0.157749191982352 -0.397552739170927…1.36241042737296 ## [[" gene_15 "]] 2.15036798366318 0.253710634937292…0.39941302358738 ## [[" gene_16 "]] 0.96817595171046 0.114756919804117…-2.01727368917211 ## [[" gene_17 "]]] 1.2806941035393 -2.78487321775219 0.152233191585686 1.9392696521926 ##…## <90个以上的元素>
当子集BumpyMatrix
我们可以再用一个BumpyMatrix
包含每个条目的索引信息。考虑下面的代码块:
I <- mat[,,'x'] > 0 & mat[,,'y'] > 0 I
## 100 x 20 BumpyLogicalMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:## logi [1:5] FALSE TRUE FALSE FALSE TRUE
我[1]
##长度为100的逻辑列表## [["GENE_10"]]假真假假假真## [["GENE_100"]]假真假假真## [["GENE_11"]]真假假假假假## [["GENE_12"]]假假假假假假假假假真假假假## [["GENE_13"]]]假假假假假假假假真## [["GENE_14"]]真假假假假假假假真## [["GENE_15"]]假假假假假假假真## [["GENE_16"]]假假假假假假假假假假##[[" gene_17 "]]]真假真假##…## <90个以上的元素>
Sub <- mat[i] Sub
## 100 x 20 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与2行2列## x y ## <数字> <数字> ## 1 2.26095 0.0664656 ## 2 1.07352 0.8238178
子[1]
# # 100 # # SplitDataFrameList长度GENE_1 # # DataFrame 2行2列# # x y # # <数字> <数字> 2.26095 - 0.0664656 # # 1 # # 2 GENE_10美元1.07352 - 0.8238178 # # # # # # DataFrame 3行2列# # x y # # <数字> <数字> # # 1 # # 2 0.0485278 - 0.3189288 2.6989263 - 0.9616407 0.1882398 - 0.0267774 # # 3 # # # # $ GENE_100 # # DataFrame 1行2列# # x y # # <数字> <数字> # # 1 1.20187 - 0.271234 ## ## ...## <97个元素>
在这里,我
是一个BumpyLogicalMatrix
每个元素都是一个逻辑向量。当我们这样做时x[我]
的对应项进行循环x
而且我
,使用后者来子集DataFrame
前者。这会产生一个新的BumpyDataFrameMatrix
在这种情况下,只包含x和y坐标为正的观测值。
为BumpyDataFrameMatrix
对象的基础列的类型,则将子集设置为第三维中的单个字段DataFrame
.这可以停止= FALSE下降
以保存BumpyDataFrameMatrix
输出:
垫(,“x”)
## 100 x 20 BumpyNumericMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:## num [1:5] -0.457 2.261 1.59 -0.932 1.074
垫(“x”,放弃= FALSE)
## 100 x 20 BumpyDataFrameMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:##数据帧与5行1列## x ## <数值> ## 1 -0.456681 ## 2 2.260953 ## 3 1.589902 ## 4 -0.932046 ## 5 1.073516
在希望删除第三个维度而不删除前两个维度(反之亦然)的情况下,我们使用.dropk
论点。设置.dropk = FALSE
将确保第三维度不掉落,如下图所示:
垫(1,1,“x”)
##长度为1的数字列表##[[1]]-0.456680962301832 2.26095325993182…1.07351568637374
垫(1,1,“x”,.dropk = FALSE)
## SplitDataFrameList长度为1 ##[[1]]## 5行1列的数据帧## x ## <数字> ## 1 -0.456681 ## 2 2.260953 ## 3 1.589902 ## 4 -0.932046 ## 5 1.073516
垫(1,1,“x”,放弃= FALSE)
## 1 x 1 BumpyDataFrameMatrix ## rownames: GENE_1 ## colnames: CELL_1 ## preview [1,1]: ## DataFrame与5行1列## x ## <数值> ## 1 -0.456681 ## 2 2.260953 ## 3 1.589902 ## 4 -0.932046 ## 5 1.073516
垫(1,1,“x”,.dropk = TRUE,下降= FALSE)
## 1 x 1 BumpyNumericMatrix ## rownames: GENE_1 ## colnames: CELL_1 ## preview [1,1]: ## num [1:5] -0.457 2.261 1.59 -0.932 1.074
也支持子集替换,这对于修改特定字段的操作最有用:
复制< -垫复制(,“x”)< -副本(,“x”)* 20(1)副本
# # 100 # # SplitDataFrameList长度GENE_1 # # DataFrame 5行2列# # x y # # <数字> <数字> # # 1 # # 2 45.21907 - 0.0664656 -9.13362 - 1.1802570 -18.64092 - -0.9511974 31.79805 - -0.5645328 # # 3 # # 4 # # 5 GENE_10美元21.47031 - 0.8238178 # # # # # # DataFrame 6行2列# # x y # # <数字> <数字> # # 1 # # 2 53.978526 - 0.9616407 -8.874794 - -1.1806866 0.970557 - 0.3189288 -14.785756 - 0.5467073 # # 3 # # 4 # 5 # -33.651075 - 0.7924868 # 6 # GENE_100美元3.764797 - 0.0267774 # # # # # #数据帧与4行2列## x y ## <数字> <数字> ## 1 -1.04217 0.332963 ## 2 -19.19698 -0.128902 ## 3 -33.96995 -0.410071 ## 4 24.03743 0.271234 ## ##…## <97个元素>
还实现了一些附加的统计操作,通常会生成一个普通的矩阵。的对应项计算出的统计量BumpyMatrix
.
Mean (out.x)[1:5,1:5] #矩阵
## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_10 0.01168545 -0.7904620 0.15066241 -0.8528919 0.43556752 ## gene_100 -0.37714574 -0.6514196 0.28494400 0.5962598 -0.03492945 ## gene_11 0.06806478 0.3087175 -0.49577063 0.1712767 -0.08399315 ## gene_12 -0.37907379 0.5438429 -0.7309794 0.26734736
Var (out.x)[1:5,1:5] #矩阵
## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 1.8423115 0.2797058 0.5265598 1.4911920 2.25707591 ## gene_10 2.1791223 0.3568664 1.2902758 0.6738425 2.1982677 0.1351770 0.58199316 ## gene_11 0.2949356 0.2208074 0.5296845 1.3845811 1.79176470 ## gene_12 0.9008503 0.8346523 0.7860442 1.2395604 1.48033310
例外情况是自然生成向量的操作,在这种情况下返回匹配的三维数组:
1:5,分位数(out.x) [1:5]
##,, 0% ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 -0.9320460 -0.4345906 -1.3222878 -1.97005386 -2.9048991 ## gene_10 -1.6825538 -1.4974221 -0.9233099 -0.8260650 0.09508173 -1.2458351 ## gene_11 -0.6326935 -0.3023776 -1.0103989 -0.95832412 -1.2367482 ## gene_12 -2.5432442 -1.0981897 -0.7845837 - 2.775826626 ## ##,,25% ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 -0.4566810 -0.09455929 -0.9413205 -1.3130549 -0.2176967 ## gene_10 -0.6654008 -1.17941890 -0.4438726 -1.1460665 0.3409732 ## gene_100 -1.1445111 -1.20769109 -0.5568366 0.4201514 -0.3004851 ## gene_11 -0.1225685 0.10848147 -0.7530848 -0.6162069 -1.0592760 gene_12 -0.8848881 0.26482573 -0.3850977 -1.5437361 -0.6038440 ## ##,,50% ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_10 -0.1976059 -0.9962139 0.03556469 -0.89716938 0.43556752 ## gene_100 -0.5059786 -0.8892505 -0.28760824 0.56051620 -0.04182030 ## gene_11 0.1090969 0.2021316 -0.49577063 -0.39927829 -0.82739620 ## gene_12 -0.3351033 0.8535404 -0.17140432 -0.46267392 -0.06859857 ## ##,,75% ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 1.5899023 0.57400451 0.01671434 0.66592781 0.4748549 ## gene_10 0.1533118 -0.44874893 0.68764857 -0.60399476 0.5301618 ## gene_100 0.2613867 0.04925645 0.84044849 0.91384869 0.3956748 ## gene_11 0.2997302 0.44607885 -0.23845649 0.94710292 1.0263022 ## gene_12 0.3423434 1.21512396 0.01259719 0.06282157 0.8025928 ## ##,,100% ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 2.2609533 0.7525662 0.58132266 0.8210081 2.6843208 ## gene_10 2.6989263 0.2167373 1.33973245 - 0.3321861 0.6247561 ## gene_100 1.2018717 0.5358361 1.96850521 0.9917012 0.9650991 ## gene_11 0.6867589 1.3118250 0.01885764 1.8947475 1.6771525 ## gene_12 0.8858188 1.2499268 1.93803165 0.7024325 1.9253492
范围(out.x)(1:5、1:5)
##,, 1 ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 -0.9320460 -0.4345906 -1.3222878 -1.97005386 -2.9048991 ## gene_10 -1.6825538 -1.4974221 -0.9233099 -0.8260650 0.09508173 -1.2458351 ## gene_11 -0.6326935 -0.3023776 -1.0103989 -0.95832412 -1.2367482 ## gene_12 -2.5432442 -1.0981897 -0.7845837 -2.77582663 -0.7187626 ## ##,,2 ## ## cell_1 cell_10 cell_11 cell_12 cell_13 ## gene_1 2.2609533 0.7525662 0.58132266 0.8210081 2.6843208 ## gene_10 2.6989263 0.2167373 1.33973245 - 0.3321861 0.6247561 ## gene_100 1.2018717 0.5358361 1.96850521 0.9917012 0.9650991 ## gene_11 0.6867589 1.3118250 0.01885764 1.8947475 1.6771525 ## gene_12 0.8858188 1.2499268 1.93803165 0.7024325 1.9253492
其他操作可能返回另一个操作BumpyMatrix
如果输出长度是可变的:
pmax(。x, out.y)
## 100 x 20 BumpyNumericMatrix ## rownames: GENE_1 GENE_10…GENE_98 GENE_99 colnames: CELL_1 CELL_10…CELL_8 CELL_9 ##预览[1,1]:## num [1:5] 1.18 2.261 1.59 -0.932 1.074
BumpyCharacterMatrix
对象也有自己的方法grep ()
,低()
等,以方便的方式操作字符串。
sessionInfo ()
## R版本4.2.0 RC (2022-04-21 r82226) ##平台:x86_64-pc-linux-gnu(64位)##运行在Ubuntu 20.04.4 LTS ## ##矩阵产品:默认## BLAS: /home/biocbuild/bbs-3.16-bioc/R/lib/libRblas。/home/biocbuild/bbs-3.16-bioc/R/lib/libRlapack。所以## ## locale: ## [1] LC_CTYPE=en_US。UTF-8 LC_NUMERIC= c# # [3] LC_TIME=en_GB LC_COLLATE= c# # [5] LC_MONETARY=en_US。utf - 8 LC_MESSAGES = en_US。UTF-8 ## [7] LC_PAPER=en_US。UTF-8 LC_NAME= c# # [9] LC_ADDRESS=C lc_phone = c# # [11] LC_MEASUREMENT=en_US。UTF-8 LC_IDENTIFICATION=C ## ##附加的基础包:## [1]stats4 stats graphics grDevices utils datasets methods ##[8]基础## ##其他附加包:## [1]BumpyMatrix_1.5.0 S4Vectors_0.35.0 BiocGenerics_0.43.0 ## [4] BiocStyle_2.25.0 ## ##通过命名空间加载(且未附加):## [7] fastmap_1.1.0 string_1 .4.0 tools_4.2.0 ## [10] grid_4.2.0 xfun_0.30 cli_3.3.0 ## [13] jquerylib_0.1.4 htmltools_0.5.2 yaml_2.3.5 ## [19] digest_0.6.29 bookdown_0.26 Matrix_1.4-1 ## [19] BiocManager_1.30.17 sass_0.4.1 evaluate_0.15 ## [22] rmarkdown_2.14 stringi_1.7.6 compiler_4.2.0 ## [25] bslib_0.3.1 jsonlite_1.8.0