length of snp vector should be 1 less than ncol(res$lbf_variable)
shannjiang opened this issue · 6 comments
Hi,
I bumped to this error when running susie on the attached test data:
** Examples
library(coloc)
data(coloc_test_data)
result=runsusie(coloc_test_data$D1)
running max iterations: 100
converged: TRUE
Error in annotate_susie(res, snp): length of snp vector should be 1 less than ncol(res$lbf_variable)
summary(result)
Error in summary(result): object 'result' not found
What is the ncol(res$lbf_variable) which should be greater than the length of snp vector specifically?
Thanks,
Shan
can you please download the latest version from github? This issue should be fixed.
Hi @chr1swallace ,
Thanks for figuring that out.
After I successfully run the command runsusie(), the command summary(result) didn't show anything informative:
result=runsusie(coloc_test_data$D1)
running max iterations: 100
converged: TRUE
> summary(result)
Mode FALSE
logical 1
And also if I run the runsusie() on the D3 in the test data I got the error 'LD' object not found:
result=runsusie(coloc_test_data$D3)
running max iterations: 100
converged: TRUE
Error in .susie_setld(res$sets$cs, LD) : object 'LD' not found
But I checked the structure of D3, LD is there:
str(coloc_test_data$D3)
List of 9
$ beta : num [1:500] 0.343 0.502 0.541 0.233 0.536 ...
$ varbeta : num [1:500] 0.02321 0.0073 0.00991 0.0205 0.00875 ...
$ N : int 1000
$ sdY : num 1.31
$ type : chr "quant"
$ MAF : num [1:500] 0.0405 0.149 0.0955 0.0485 0.11 0.073 0.0795 0.038 0.234 0.131 ...
$ LD : num [1:500, 1:500] 1 0.456 0.611 0.906 0.559 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:500] "s1" "s2" "s3" "s4" ...
.. ..$ : chr [1:500] "s1" "s2" "s3" "s4" ...
$ snp : chr [1:500] "s1" "s2" "s3" "s4" ...
$ position: int [1:500] 1 2 3 4 5 6 7 8 9 10 ...
And I tested on my own data which also prompted me 'LD' object not found but I am sure it's in my data.
Thanks,
Shan
@chr1swallace the aboved mentioned information is what I updated coloc:
library(coloc)
This is coloc version 5.2.3
data(coloc_test_data)
result=runsusie(coloc_test_data$D1)
running max iterations: 100
converged: TRUE
> summary(result)
Mode FALSE
logical 1
result=runsusie(coloc_test_data$D3)
running max iterations: 100
converged: TRUE
Error in .susie_setld(res$sets$cs, LD) : object 'LD' not found