immunarch icon indicating copy to clipboard operation
immunarch copied to clipboard

repDiversity error

Open paulatn240 opened this issue 2 years ago • 1 comments

Hello,

I am trying to run the following code but I get this error:

imm_raref <- repDiversity(immdata$data, .method = "raref",.verbose = F)
Error in seq.default(.step, n, .step) : invalid '(to - from)/by'

I downloaded the latest version of Immunarch but the error keeps showing up. Could it be a problem with the dataset?

Thank you very much in advance!

paulatn240 avatar Aug 18 '22 17:08 paulatn240

Hello, @paulatn240!

I'm Aleksandr Popov, a developer of Immunarch package. Thank you for using our software!

I've tried to reproduce the issue with built-in immdata, but this command worked without errors. So this can be an issue either with Immunarch installation, or with dataset. The things you can do to fix the issue or find out what's happening:

  1. Run R --vanilla, install the latest version of Immunarch in that environment (install.packages("immunarch")) and try to repeat the command.
  2. If you use your own data, try with built-in Immunarch data: data(immdata), then repeat the command.
  3. If the issue happens with your data, but doesn't happen with Immunarch built-in data, try to do it with smaller subsets of your data. If you can attach a small reproducible example of data for which the error appears, it will help me to fix the issue.

Best regards, Aleksandr

Alexander230 avatar Aug 24 '22 15:08 Alexander230

2. data(immdata)

I ran into the same error with my data. bulit-in data works fine. My data set is not huge, run as a pilot test with 1000+ seqs. Error as this "Error in seq.default(.step, n, .step) : invalid '(to - from)/by'". No clue how to troubleshoot it.

joe-jhou2 avatar Nov 07 '22 18:11 joe-jhou2

Can you, please, send me an example file on which this bug appears? It will help me to reproduce and fix it.

Best regards, Aleksandr

Alexander230 avatar Nov 15 '22 16:11 Alexander230

Dear Aleksandr I had the same problem and I have been trying to trace it back. So the problem is that .step is 0 in some 10X datasets. and seq(0,n,0) throwing an error since it can't increase by 0.

mksamur avatar Nov 15 '22 21:11 mksamur

Hello, @mksamur, @mimisikai and @paulatn240!

I've made a branch diversity-fixes with a fix for this bug. Eventually it will be merged into dev, and then included into the next release of Immunarch.

You can install Immunarch version with this fix now with these commands:

install.packages(c("devtools", "pkgload"))
devtools::install_github("immunomind/immunarch", ref="diversity-fixes")
devtools::reload(pkgload::inst("immunarch"))

Best regards, Aleksandr

Alexander230 avatar Nov 16 '22 16:11 Alexander230

Thank you Aleksandr

mksamur avatar Nov 16 '22 16:11 mksamur

Thank you @Alexander230 :)

paulatn240 avatar Nov 17 '22 12:11 paulatn240