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

repload error with TRUST4 data #351

Open albyrne0815 opened 1 year ago

albyrne0815 commented 1 year ago

Hi,

I used the repload command to load TRUST4 data using "immdata <- repLoad(directory to TRUST file)" And received this error (see below). There seems to be a column subset issue, 'cd1r_aa' . Do you have a recommended work around? I uploaded the package through github using these commands see below.

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

== Step 1/3: loading repertoire files... ==

Processing "/data/single_cell_tools/TRUST4/10X_DTC_P2_Immune/10X_DTC_P2_SingleCell/" ... -- [1/14] Parsing "/data/single_cell_tools/TRUST4/10X_DTC_P2_Immune/10X_DTC_P2_SingleCell//10X_DTC_P2_SingleCell_trust4_report.out" -- vdjtools -- [2/14] Parsing "/data/single_cell_tools/TRUST4/10X_DTC_P2_Immune/10X_DTC_P2_SingleCell//TRUST_10X_DTC_P2_Immune_LIB5461716_HITS5479242_R1_merge_airr.tsv" -- airr Error in select():
! Can't subset columns that don't exist. ✖ Column cdr1_aa doesn't exist. Run rlang::last_error() to see where the error occurred. Warning message: select_() was deprecated in dplyr 0.7.0. ℹ Please use select() instead. ℹ The deprecated feature was likely used in the immunarch package. Please report the issue at https://github.com/immunomind/immunarch/issues.

Here is the backtrace:

rlang::last_trace() <error/vctrs_error_subscript_oob> Error in select(): ! Can't subset columns that don't exist. ✖ Column cdr1_aa doesn't exist.

Backtrace: â–†

  1. ├─immunarch::repLoad("/data/single_cell_tools/TRUST4/10X_DTC_P2_Immune/10X_DTC_P2_SingleCell/")
  2. │ └─immunarch (local) .process_batch(batches[[batch_i]], .mode, .coding)
  3. │ └─immunarch (local) .read_repertoire(.filepath, .mode, .coding, ...)
  4. │ └─immunarch (local) parse_fun(.path, .mode, ...)
  5. │ └─df %<>% ...
  6. ├─dplyr::select_(...)
  7. ├─dplyr:::select_.data.frame(...)
  8. │ ├─dplyr::select(.data, !!!dots)
  9. │ └─dplyr:::select.data.frame(.data, !!!dots)
    1. │ └─tidyselect::eval_select(expr(c(...)), data = .data, error_call = error_call)
    2. │ └─tidyselect:::eval_select_impl(...)
    3. │ ├─tidyselect:::with_subscript_errors(...)
    4. │ │ └─rlang::try_fetch(...)
    5. │ │ └─base::withCallingHandlers(...)
    6. │ └─tidyselect:::vars_select_eval(...)
    7. │ └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
    8. │ └─tidyselect:::eval_c(expr, data_mask, context_mask)
    9. │ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
    10. │ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
    11. │ └─tidyselect:::as_indices_sel_impl(...)
    12. │ └─tidyselect:::as_indices_impl(...)
    13. │ └─tidyselect:::chr_as_locations(x, vars, call = call, arg = arg)
    14. │ └─vctrs::vec_as_location(...)
    15. └─vctrs (local) <fn>()
    16. └─vctrs:::stop_subscript_oob(...)
    17. └─vctrs:::stop_subscript(...)
    18. └─rlang::abort(...)
Alexander230 commented 1 year ago

Hi, @albyrne0815!

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