transPlotR icon indicating copy to clipboard operation
transPlotR copied to clipboard

关于trackVis的问题

Open Zh-MicroSat opened this issue 3 years ago • 6 comments

我在使用trackVis遇到了一定的问题,我的代码如下:

file <- list.files(pattern = '.bw') data <- loadBigWig(file) save(data,file = 'Data.rda') load('Data.rda') mybw <- data trackVis(bWData = mybw,chr = "Wnk4",region.min = 101167654,region.max = 101168235) 错误信息如下所示: Error in combine_vars(): ! Faceting variables must have at least one value Run rlang::last_error() to see where the error occurred. Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 详细展开错误信息如下: <error/rlang_error> Error in combine_vars(): ! Faceting variables must have at least one value


Backtrace: ▆

  1. ├─base (local) <fn>(x)
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─layout$setup(data, plot$data, plot$plot_env)
    
  6.   └─ggplot2 (local) f(..., self = self)
    
  7.     └─self$facet$compute_layout(data, self$facet_params)
    
  8.       └─ggplot2 (local) f(...)
    
  9.         ├─ggplot2:::unrowname(...)
    
  10.         │ └─base::is.data.frame(x)
    
  11.         └─**ggplot2::combine_vars(data, params$plot_env, vars, drop = params$drop)**
    
  12.           └─rlang::abort("Faceting variables must have at least one value")
    

粗体部分似乎为主要问题,期待您的回复

Zh-MicroSat avatar Sep 26 '22 12:09 Zh-MicroSat

chr参数传入的是染色体名称,不是基因名,请仔细阅读说明文档。

junjunlab avatar Sep 27 '22 01:09 junjunlab

我也遇到了同样的问题。 trackVis(bWData = mybw, gtf.file = gtf.v39, gene.name = 'TP53') Warning: no non-missing arguments to min; returning InfWarning: no non-missing arguments to max; returning -InfError in combine_vars(): ! Faceting variables must have at least one value Backtrace: 1. base (local) (x) 2. ggplot2:::print.ggplot(x) 4. ggplot2:::ggplot_build.ggplot(x) 5. layout$setup(data, plot$data, plot$plot_env) 6. ggplot2 (local) f(..., self = self) 7. self$facet$compute_layout(data, self$facet_params) 8. ggplot2 (local) f(...) 11. ggplot2::combine_vars(data, params$plot_env, vars, drop = params$drop) 感觉是在寻找gene的时候有问题。用refseq的gtf作为注释文件,画transcript没问题,但是用trackVis会有colname找不到的问题,函数应该是找gene_name,但是refseq默认该列为gene_id

Dongxu-Zheng avatar Dec 01 '22 14:12 Dongxu-Zheng

你可以尝试给自己的导入的gtf添加一列gene_name就行了

junjunlab avatar Dec 02 '22 03:12 junjunlab

你可以尝试给自己的导入的gtf添加一列gene_name就行了

我加了,但是画track的时候,输入基因名是不对的,显示如上我说的报错。谢谢回复

Dongxu-Zheng avatar Dec 02 '22 07:12 Dongxu-Zheng

那就不知道了

junjunlab avatar Dec 02 '22 08:12 junjunlab

那就不知道了

那我自己把函数修改修改看看能不能解决😅

Dongxu-Zheng avatar Dec 02 '22 08:12 Dongxu-Zheng