immunomind / immunarch

🧬 Immunarch: an R Package for Fast and Painless Exploration of Single-cell and Bulk T-cell/Antibody Immune Repertoires
https://immunarch.com
Apache License 2.0
312 stars 65 forks source link

repDiversity error #281

Closed paulatn240 closed 2 years ago

paulatn240 commented 2 years ago

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!

Alexander230 commented 2 years ago

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

joe-jhou2 commented 2 years ago

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.

Alexander230 commented 2 years ago

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

mksamur commented 2 years ago

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.

Alexander230 commented 2 years ago

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

mksamur commented 2 years ago

Thank you Aleksandr

paulatn240 commented 2 years ago

Thank you @Alexander230 :)