Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于trackVis的问题 #4

Open
Zh-MicroSat opened this issue Sep 26, 2022 · 6 comments
Open

关于trackVis的问题 #4

Zh-MicroSat opened this issue Sep 26, 2022 · 6 comments

Comments

@Zh-MicroSat
Copy link

我在使用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")
    

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

@junjunlab
Copy link
Owner

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

@Dongxu-Zheng
Copy link

Dongxu-Zheng commented Dec 1, 2022

我也遇到了同样的问题。
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

@junjunlab
Copy link
Owner

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

@Dongxu-Zheng
Copy link

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

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

@junjunlab
Copy link
Owner

那就不知道了

@Dongxu-Zheng
Copy link

那就不知道了

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants