R 新手。最近在 R 中完成 ATAC-seq工作展。
在我调用 makeGRangesFromDataFrame 函数的第 5.1 节中,我收到以下错误 -
> atac_esca.gr <- makeGRangesFromDataFrame(atac_esca,keep.extra.columns = T)
Error in makeGRangesFromDataFrame(atac_esca, keep.extra.columns = T) : could not find function "makeGRangesFromDataFrame"
我之前安装了 GenomicRanges 包,然后我又试了一次。没有喜悦。所以我附上了包裹require(GenomicRanges)
,现在当我去重复相同的呼叫时收到以下错误 -
> atac_esca.gr <- makeGRangesFromDataFrame(atac_esca,keep.extra.columns = T)
Error in inherits(object, class2) : 'what' must be a character vector
[编辑]:输入结果
> dput(head(atac_esca,10))
structure(list(seqnames = c("chr1", "chr1", "chr1", "chr1", "chr1",
"chr1", "chr1", "chr1", "chr1", "chr1"), start = c(1290095, 1291115,
1291753, 1440824, 1630188, 2030218, 2184484, 2185113, 2185905,
2186860), end = c(1290596, 1291616, 1292254, 1441325, 1630689,
2030719, 2184985, 2185614, 2186406, 2187361), name = c("ESCA_107",
"ESCA_108", "ESCA_109", "ESCA_160", "ESCA_179", "ESCA_341", "ESCA_539",
"ESCA_540", "ESCA_541", "ESCA_542"), score = c(2.46437811814343,
2.58792851900195, 7.57996223017863, 4.46727398384637, 20.6213237496952,
15.5725811237533, 19.2854359599157, 11.1907656456091, 22.2148888990001,
22.8844119795596), annotation = c("3' UTR", "3' UTR", "3' UTR",
"3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR"
), percentGC = c(0.676646706586826, 0.702594810379242, 0.63872255489022,
0.658682634730539, 0.728542914171657, 0.6187624750499, 0.578842315369261,
0.604790419161677, 0.63872255489022, 0.439121756487026), percentAT = c(0.323353293413174,
0.297405189620758, 0.36127744510978, 0.341317365269461, 0.271457085828343,
0.3812375249501, 0.421157684630739, 0.395209580838323, 0.36127744510978,
0.560878243512974)), spec = structure(list(cols = list(seqnames = structure(list(), class = c("collector_character",
"collector")), start = structure(list(), class = c("collector_double",
"collector")), end = structure(list(), class = c("collector_double",
"collector")), name = structure(list(), class = c("collector_character",
"collector")), score = structure(list(), class = c("collector_double",
"collector")), annotation = structure(list(), class = c("collector_character",
"collector")), percentGC = structure(list(), class = c("collector_double",
"collector")), percentAT = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"), row.names = c(NA,
10L), class = c("spec_tbl_df", "tbl_df", "tbl", "data.frame"))
> head (atac_esca)
seqnames start end name score annotation percentGC percentAT
1 chr1 1290095 1290596 ESCA_107 2.464378 3' UTR 0.6766467 0.3233533
2 chr1 1291115 1291616 ESCA_108 2.587929 3' UTR 0.7025948 0.2974052
3 chr1 1291753 1292254 ESCA_109 7.579962 3' UTR 0.6387226 0.3612774
4 chr1 1440824 1441325 ESCA_160 4.467274 3' UTR 0.6586826 0.3413174
5 chr1 1630188 1630689 ESCA_179 20.621324 3' UTR 0.7285429 0.2714571
6 chr1 2030218 2030719 ESCA_341 15.572581 3' UTR 0.6187625 0.3812375
> packageVersion("GenomicRanges")
[1] ‘1.38.0’
> class(atac_esca)
[1] "spec_tbl_df" "tbl_df" "tbl" "data.frame"
谁能告诉我我在这里做错了什么?
[使用 R Studio 1.2.5033 - R 3.6.3 - Windows 10]
提前致谢,
R。