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

length of snp vector should be 1 less than ncol(res$lbf_variable) #127

Open
shannjiang opened this issue Aug 1, 2023 · 6 comments
Open

Comments

@shannjiang
Copy link

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

@chr1swallace
Copy link
Owner

can you please download the latest version from github? This issue should be fixed.

@shannjiang
Copy link
Author

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
Copy link
Owner

chr1swallace commented Aug 22, 2023 via email

@shannjiang
Copy link
Author

@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

@chr1swallace
Copy link
Owner

chr1swallace commented Aug 22, 2023 via email

@shannjiang
Copy link
Author

Hi @chr1swallace,

Thank you so much! It's working now.

Best,
Shan

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