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

Data_imputation, the condition has length > 1报错 #7

Open
sysyangb opened this issue Sep 26, 2022 · 4 comments
Open

Data_imputation, the condition has length > 1报错 #7

sysyangb opened this issue Sep 26, 2022 · 4 comments

Comments

@sysyangb
Copy link

作者你好, 非常感谢你的工具, 我在使用的时候遇到如下报错

starting worker pid=71069 on localhost:11764 at 18:36:48.679
starting worker pid=71163 on localhost:11764 at 18:36:50.100
starting worker pid=71259 on localhost:11764 at 18:36:51.529
[1] "Genes were splited with 2 parts now it is calculating 1"
Error in if (!(grepl("matrix", class(x), ignore.case = TRUE))) { : 
  the condition has length > 1

不过我在我的Pc端运行相同的测试代码,能正常运行

[1] "Genes were splited with 2 parts now it is calculating 1"
Warning in if (!(grepl("matrix", class(x), ignore.case = TRUE))) { :
  条件的长度大于一,因此只能用其第一元素
27242 genes, 2825 cells
Running SAVER with 3 worker(s)
Calculating predictions for 13621 genes using 6713 genes and 2825 cells...

两个版本都是1.0. 请问这个报错如何解决呢?

@BinDuan
Copy link
Member

BinDuan commented Sep 28, 2022

看起来是运行SAVER的时候出了问题,建议试试运行之前加一行代码options(warn=-1),忽略警告信息试试

@sysyangb
Copy link
Author

sysyangb commented Sep 29, 2022

Reference in new

library(Seurat)

options(warn=-1)

expression_profile<-read.table("./crop_stimulated/expression_profile.txt",head=T,row.names=1,sep="\t")
perturb_information_df<-read.table("./crop_stimulated/perturb_information.txt",head=T,row.names=1,sep="\t")
perturb_information<-as.character(perturb_information_df[,1])
names(perturb_information)<-row.names(perturb_information_df)
# If you don't consider off-target effect, this file is not needed.
#sgRNA_information_df<-read.table("./crop_stimulated/sgRNA_information.txt",head=T,row.names=1,sep="\t")
#sgRNA_information<-as.character(sgRNA_information_df[,1])
#names(sgRNA_information)<-row.names(sgRNA_information_df)

# Have a look at expression_profile
dim(expression_profile)   

# For "data_format_example/crop_unstimulated.RData", this function integrates the input data and filters mitochondrial ribosomal protein(^MRP) and ribosomal protein(^RP).
crop_seq_list<-Input_preprocess(expression_profile,perturb_information)

# For data format like "perturb_GSM2396857" generated by 10X genomics, function "Input_preprocess_10X()" will be suitable. Users can also change this data format to the standard format like "data_format_example/crop_unstimulated.RData", then use function "Input_preprocess()" to process it.

#crop_seq_list<-Input_preprocess_10X("./perturb_GSM2396857")
# cell quality control
crop_seq_qc<-Cell_qc(crop_seq_list$expression_profile,crop_seq_list$perturb_information,species="Hs",plot=T)

# data imputation, it may take a little long time without parallel computation.
crop_seq_imputation<-Data_imputation(crop_seq_qc$expression_profile,crop_seq_qc$perturb_information,cpu_num=1)

谢谢您的回复, 但是Data_imputation()函数执行还是报如下错误, 是linux服务器使用网页Rstudio时出现的,我需要重装一下包吗?
[1] "Genes were splited with 2 parts now it is calculating 1"
Error in if (!(grepl("matrix", class(x), ignore.case = TRUE))) { :
the condition has length > 1

@BinDuan
Copy link
Member

BinDuan commented Sep 29, 2022

我自己跑了下,没有发现问题,你检查下你安装的SAVER版本,然后用crop_unstimulated.RData里的数据试试呢?

@sysyangb
Copy link
Author

sysyangb commented Oct 9, 2022

我自己跑了下,没有发现问题,你检查下你安装的SAVER版本,然后用crop_unstimulated.RData里的数据试试呢?

你好,确实是SAVER的原因, 我更新到最新的1.1.3解决了这个问题, 如果使用install.package()只能装到1.1.2. 谢谢了

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

2 participants