将 MAF 文件转换为数据表时 data.table::fread 错误

发布于 2025-01-13 13:33:55 字数 1172 浏览 0 评论 0原文

我想将 50 个 MAF 文件与示例信息合并,以便我可以将其作为 data.table 读取并对其进行子集化。

library(maftools)

# Load MAF files
maf = system.file("extdata", list.files(path="mafs/"), package="maftools")

# Load sample information
si <- system.file("extdata", "sample-information.tsv", package="maftools")

d = read.maf(maf=maf, clinicalData=si)

追溯:

Error in data.table::fread(file = maf, sep = "\t", stringsAsFactors = FALSE,  : 
  File '' does not exist or is non-readable. getwd()=='C:/Users/User/Documents/VanAllen'

> traceback()
3: stop("File '", file, "' does not exist or is non-readable. getwd()=='", 
       getwd(), "'")
2: data.table::fread(file = maf, sep = "\t", stringsAsFactors = FALSE, 
       verbose = FALSE, data.table = TRUE, showProgress = TRUE, 
       header = TRUE, fill = TRUE, skip = "Hugo_Symbol", quote = "")
1: read.maf(maf = maf, clinicalData = si)
1: data.table::fread(input = maf)

Maftools 文档: https://www.bioconductor.org/packages/发布/bioc/manuals/maftools/man/maftools.pdf

I want to merge the 50 MAF files with the sample information so that I can read it as a data.table and subset it.

library(maftools)

# Load MAF files
maf = system.file("extdata", list.files(path="mafs/"), package="maftools")

# Load sample information
si <- system.file("extdata", "sample-information.tsv", package="maftools")

d = read.maf(maf=maf, clinicalData=si)

Traceback:

Error in data.table::fread(file = maf, sep = "\t", stringsAsFactors = FALSE,  : 
  File '' does not exist or is non-readable. getwd()=='C:/Users/User/Documents/VanAllen'

> traceback()
3: stop("File '", file, "' does not exist or is non-readable. getwd()=='", 
       getwd(), "'")
2: data.table::fread(file = maf, sep = "\t", stringsAsFactors = FALSE, 
       verbose = FALSE, data.table = TRUE, showProgress = TRUE, 
       header = TRUE, fill = TRUE, skip = "Hugo_Symbol", quote = "")
1: read.maf(maf = maf, clinicalData = si)
1: data.table::fread(input = maf)

Maftools documentation:
https://www.bioconductor.org/packages/release/bioc/manuals/maftools/man/maftools.pdf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城月光淡如水﹏ 2025-01-20 13:33:55

当我运行你的代码时,maf确实没有指向任何字符(“”),这当然不能被fread读取。但是,当我尝试时,

fread("R/x86_64-pc-linux-gnu-library/3.6/maftools/extdata/brca.maf.gz")

它会按预期工作。

When I run your code, maf indeed points to no character ( "" ), which of course cannot be read by fread. However when I try

fread("R/x86_64-pc-linux-gnu-library/3.6/maftools/extdata/brca.maf.gz")

it works as expected.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文