君廷湖畔 2021-06-24 10:21 采纳率: 50%
浏览 1660
已结题

在为'head'函数选择方法时评估'x'参数出了错: 'x' must be atomic ?

RStudio: 

> filtered_seurat
An object of class Seurat 
37256 features across 14622 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

> split_seurat <- SplitObject(filtered_seurat, split.by = "orig.ident")[1:8]
> split_seurat
$lbm1
An object of class Seurat 
37256 features across 4610 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lbm2
An object of class Seurat 
37256 features across 1696 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lbm3
An object of class Seurat 
37256 features across 5890 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lbm4
An object of class Seurat 
37256 features across 982 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lc1
An object of class Seurat 
37256 features across 381 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lc2
An object of class Seurat 
37256 features across 351 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lc3
An object of class Seurat 
37256 features across 331 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

$lc4
An object of class Seurat 
37256 features across 381 samples within 1 assay 
Active assay: RNA (37256 features, 0 variable features)

> split_seurat <- lapply(X = split_seurat, FUN = SCTransform)

> split_seurat
$lbm1
An object of class Seurat 
48939 features across 4610 samples within 2 assays 
Active assay: SCT (11683 features, 3000 variable features)
 1 other assay present: RNA

$lbm2
An object of class Seurat 
49760 features across 1696 samples within 2 assays 
Active assay: SCT (12504 features, 3000 variable features)
 1 other assay present: RNA

$lbm3
An object of class Seurat 
47758 features across 5890 samples within 2 assays 
Active assay: SCT (10502 features, 3000 variable features)
 1 other assay present: RNA

$lbm4
An object of class Seurat 
48461 features across 982 samples within 2 assays 
Active assay: SCT (11205 features, 3000 variable features)
 1 other assay present: RNA

$lc1
An object of class Seurat 
55730 features across 381 samples within 2 assays 
Active assay: SCT (18474 features, 3000 variable features)
 1 other assay present: RNA

$lc2
An object of class Seurat 
55389 features across 351 samples within 2 assays 
Active assay: SCT (18133 features, 3000 variable features)
 1 other assay present: RNA

$lc3
An object of class Seurat 
56942 features across 331 samples within 2 assays 
Active assay: SCT (19686 features, 3000 variable features)
 1 other assay present: RNA

$lc4
An object of class Seurat 
56121 features across 381 samples within 2 assays 
Active assay: SCT (18865 features, 3000 variable features)
 1 other assay present: RNA

> features <- SelectIntegrationFeatures(split_seurat)
Error in h(simpleError(msg, call)) : 
  在为'head'函数选择方法时评估'x'参数出了错: 'x' must be atomic

如上,单细胞测序数据,出错之后,运行:

> is.atomic(split_seurat)
[1] FALSE
> is.list(split_seurat)
[1] TRUE

但是使用unlist(split_seurat)后,仍然出现:

> is.atomic(split_seurat)
[1] FALSE
> is.list(split_seurat)
[1] TRUE

运行SelectIntegrationFeatures() 还是报错。

接下来使用内置数据进行测试:

> devtools::install_github('satijalab/seurat-data')
> library(SeuratData)
> AvailableData()
> InstallData("panc8")
> data("panc8")
> panc8
An object of class Seurat 
34363 features across 14890 samples within 1 assay 
Active assay: RNA (34363 features, 0 variable features)

> pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]
> pancreas.list
$celseq
An object of class Seurat 
34363 features across 1004 samples within 1 assay 
Active assay: RNA (34363 features, 0 variable features)

$celseq2
An object of class Seurat 
34363 features across 2285 samples within 1 assay 
Active assay: RNA (34363 features, 0 variable features)

> pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)
> pancreas.list
$celseq
An object of class Seurat 
51110 features across 1004 samples within 2 assays 
Active assay: SCT (16747 features, 3000 variable features)
 1 other assay present: RNA

$celseq2
An object of class Seurat 
51501 features across 2285 samples within 2 assays 
Active assay: SCT (17138 features, 3000 variable features)
 1 other assay present: RNA

> features <- SelectIntegrationFeatures(pancreas.list)

以上测试数据集并没有报错,但是运行:

​
> is.atomic(pancreas.list)
[1] FALSE
> is.list(pancreas.list)
[1] TRUE

​

 is.atomic(pancreas.list) 竟然也是FALSE。

不解。。。

  • 写回答

2条回答 默认 最新

  • hbxncjs 2021-06-29 15:12
    关注

    看不懂

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP