xihaoli / STAARpipeline-Tutorial

The tutorial for performing single-/multi-trait association analysis of whole-genome/whole-exome sequencing (WGS/WES) studies using FAVORannotator, STAARpipeline and STAARpipelineSummary
GNU General Public License v3.0
21 stars 17 forks source link

Question about Sliding_Window function #5

Closed alohasiqi closed 1 year ago

alohasiqi commented 1 year ago

Hello,

I'm trying to run Sliding_Window() with ~2k variants but everytime it returns "Error: $ operator is invalid for atomic vectors." This happened even when just given obj_nullmodel argument, like this Sliding_Window(chr="chr3",start_loc=11919,end_loc=1239497,sliding_window_length=6000,obj_nullmodel="gds/obj_nullmodel_GENESIS.Rdata"). Do you have any idea how this happened? Is it due to a misformatted obj_nullmodel? Thanks!

I have followed the tutorial to preparing this covar <- read.csv("covar.csv") obj_nullmodel_GENESIS <- fitNullModel(covar,outcome="rate",covars=c("PC1","PC2","PC3","PC4"),family="binomial", cov.mat = NULL,group.var = NULL)

obj_nullmodel <- genesis2staar_nullmodel(obj_nullmodel_GENESIS) save(obj_nullmodel,obj_nullmodel_GENESIS.Rdata")

xihaoli commented 1 year ago

Hi,

Thanks for reaching out. The input of obj_nullmodel should be a loaded R object instead of a file path. For example, it can be the object after running the following line:

obj_nullmodel <- get(load("/path_to_the_file/obj_nullmodel.Rdata"))

Best, Xihao