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
306 stars 65 forks source link

Compatibility with Cellranger 5.x data no cdr1 #342

Open hjc0818 opened 1 year ago

hjc0818 commented 1 year ago

Hi,

I am testing this package with my VDJ data but I found that our output were from Cellranger 5.0, where it miss some columns (see https://github.com/scverse/scirpy/issues/279)

I get errors like below that I cannot bypass.

immdata.n <- repLoad("./DOE20227369-b1-TCR_QC_report_20220920/N220825_TCR/")
== Step 1/3: loading repertoire files... ==

Processing "./DOE20227369-b1-TCR_QC_report_20220920/N220825_TCR/" ...
  -- [1/11] Parsing "./DOE20227369-b1-TCR_QC_report_20220920/N220825_TCR//airr_rearrangement.tsv" -- airr
Error in `select()`:
! Can't subset columns that don't exist.
✖ Column `cdr1` doesn't exist.
Backtrace:
  1. immunarch::repLoad("./DOE20227369-b1-TCR_QC_report_20220920/N220825_TCR/")
  7. dplyr:::select_.data.frame(...)
  9. dplyr:::select.data.frame(.data, !!!dots)
 12. tidyselect::eval_select(expr(c(...)), .data)
 13. tidyselect:::eval_select_impl(...)
     ...
 25. tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
 26. tidyselect:::walk_data_tree(new, data_mask, context_mask)
 27. tidyselect:::as_indices_sel_impl(...)
 28. tidyselect:::as_indices_impl(x, vars, call = call, strict = strict)
 29. tidyselect:::chr_as_locations(x, vars, call = call)
 Error in select(.data, !!!dots) 

In your example data, I don't see cdr1 so it might not be necessary though. Only cdr3 is required.

Any ideas beside re-running Cellranger 6? Thanks.

Sincerely

Han.

Alexander230 commented 1 year ago

Hi, @hjc0818!

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

There is a fix for this problem, currently in dev branch of Immunarch. So, try to install Immunarch with these commands:

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

After that, files without that optional columns should load to Immunarch successfully.

Best regards, Aleksandr