问题描述
我不知道这是否可能。但我认为它应该是。由于我是新手,我将非常感谢任何帮助。
counts 是我从在线课程中获得的一个 S4 对象,我正在做微生物组分析。
enter code here>
str(counts)
Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
..@ i : int [1:10483] 4 12 18 19 23 36 44 64 76 77 ...
..@ p : int [1:156] 0 59 144 229 289 368 416 462 552 625 ...
..@ Dim : int [1:2] 201 155
..@ Dimnames:List of 2
.. ..$ : chr [1:201] "Methanobrevibacter_smithii" "Methanosphaera_stadtmanae" "Rothia_mucilaginosa" "Propionibacterium_freudenreichii" ...
.. ..$ : chr [1:155] "PRISM.7122" "PRISM.7147" "PRISM.7150" "PRISM.7153" ...
..@ x : num [1:10483] 0.0001 0.0099 0.0077 0.0005 0.3367 ...
..@ factors : list()
这是结构,您可以看到插槽的长度可变。我想要一个数据框,其中 Bacteria 名称作为我的行,在 counts@Dimnames[[1]] 下,counts@Dimnames[[2]] 作为我的列。并将 counts@x 中的值放入各自的位置 我可以看到我是否只是打印计数 看起来像这样。
Methanobrevibacter_smithii . . . . . . . . . .
Methanosphaera_stadtmanae . . . . . . . . . .
Rothia_mucilaginosa . 9.4e-06 . . . . 5e-04 1.0e-04 1e-04 .
Propionibacterium_freudenreichii . . 0.0018 . . . . . . .
Bifidobacterium_adolescentis 1e-04 . 0.0403 1e-04 . 1e-04 . . . 1e-04
提前致谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)