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

Error in `select()`: ! <text>:1:7: unexpected symbol 1: Using an #320

Open Biojenifer opened 1 year ago

Biojenifer commented 1 year ago

Hi!

I am using repExplore() function and it is working ok, except when I try to do exp_len <- repExplore(allData$data, .method = "len"). In that case I get the following error:

Error in `select()`:
! <text>:1:7: unexpected symbol
1: Using an
          ^

If I do: rlang::last_error(), I get:

<simpleError in select(., seq_col): <text>:1:7: unexpected symbol
1: Using an
          ^>

I get a similar error when I try to visualize results from other similar functions, such as:

exp_vol <- repExplore(allData$data, .method = "volume")
p1 <- vis(exp_vol, .by = c("Group"), .meta = allData$meta)

Error in `select()`:
! <text>:1:7: unexpected symbol
1: Using an
          ^

rlang::last_error()
<simpleError in select(.metadata, .by): <text>:1:7: unexpected symbol
1: Using an
          ^>

I've checked the colnames of the dataframes and I didn't find any weird symbol.

allData was generated by allData<-repLoad('Data', .coding = F) and this is an example of a particular sample inside this object:


Clones | Proportion | CDR3.nt | CDR3.aa | V.name | D.name | J.name | V.end | D.start | D.end | J.start | VJ.ins | VD.ins | DJ.ins | Sequence | CDR1.nt | CDR1.aa | CDR2.nt | CDR2.aa
2 | 0.0465116279069767 | TGCATGCAAACTCTACAAACTTCCCCGATCATGCAGACTCGACAAATTTCCCCGATCATTTTC | CMQTLQTSPIMQTRQISPIIF | IGKV2-28, IGKV2D-28 | NA | IGKJ5 | 21 | NA | NA | 52 | 30 | NA | NA | TGCATGCAAACTCTACAAACTTCCCCGATCATGCAGACTCGACAAATTTCCCCGATCATTTTC | NA | NA | NA | NA
2 | 0.0465116279069767 | TGTGCCACCTGGGACGGGCTCTGGATTAATTATTATAAGAAACTCTTT | CATWDGLWINYYKKLF | TRGV2 | NA | TRGJ1, TRGJ2 | 19 | NA | NA | 27 | 7 | NA | NA | TGTGCCACCTGGGACGGGCTCTGGATTAATTATTATAAGAAACTCTTT | NA | NA | NA | NA
2 | 0.0465116279069767 | TGCCAGTCCTATGACAGCAGCCTGAGTGCCCTTTATGTCTTC | CQSYDSSLSALYVF | IGLV1-40 | NA | IGLJ1 | 28 | NA | NA | 32 | 3 | NA | NA | TGCCAGTCCTATGACAGCAGCCTGAGTGCCCTTTATGTCTTC | NA | NA | NA | NA

This is my session info:

R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252    LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                  
[5] LC_TIME=Spanish_Spain.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] immunarch_0.6.7   patchwork_1.1.1   data.table_1.14.2 dtplyr_1.2.1      dplyr_1.0.9       ggplot2_3.3.6    

loaded via a namespace (and not attached):
 [1] tidyr_1.2.0         bit64_4.0.5         vroom_1.5.7         jsonlite_1.8.0      carData_3.0-5       shiny_1.7.1        
 [7] assertthat_0.2.1    stats4_4.0.4        cellranger_1.1.0    robustbase_0.95-0   ggrepel_0.9.1       factoextra_1.0.7   
[13] pillar_1.7.0        backports_1.4.1     lattice_0.20-45     glue_1.6.2          digest_0.6.29       promises_1.2.0.1   
[19] RColorBrewer_1.1-3  ggsignif_0.6.3      colorspace_2.0-3    htmltools_0.5.2     httpuv_1.6.5        plyr_1.8.7         
[25] pkgconfig_2.0.3     pheatmap_1.0.12     broom_1.0.0         ggseqlogo_0.1       xtable_1.8-4        purrr_0.3.4        
[31] scales_1.2.0        ggalluvial_0.12.3   later_1.3.0         tzdb_0.3.0          tibble_3.1.7        generics_0.1.3     
[37] car_3.1-0           ellipsis_0.3.2      ggpubr_0.4.0        UpSetR_1.4.0        withr_2.5.0         nnet_7.3-15        
[43] cli_3.3.0           mime_0.12           magrittr_2.0.3      crayon_1.5.1        readxl_1.4.0        mclust_5.4.9       
[49] fansi_1.0.3         MASS_7.3-53         rstatix_0.7.0       class_7.3-18        tools_4.0.4         hms_1.1.1          
[55] GlobalOptions_0.1.2 lifecycle_1.0.1     stringr_1.4.0       kernlab_0.9-30      munsell_0.5.0       cluster_2.1.0      
[61] fpc_2.2-9           compiler_4.0.4      rlang_1.0.4         grid_4.0.4          rstudioapi_0.13     circlize_0.4.15    
[67] gtable_0.3.0        abind_1.4-5         flexmix_2.3-18      DBI_1.1.3           reshape2_1.4.4      R6_2.5.1           
[73] gridExtra_2.3       prabclus_2.3-2      bit_4.0.4           fastmap_1.1.0       utf8_1.2.2          shinythemes_1.2.0  
[79] shape_1.4.6         readr_2.1.2         modeltools_0.2-23   stringi_1.7.8       parallel_4.0.4      Rcpp_1.0.9         
[85] vctrs_0.4.1         DEoptimR_1.0-11     tidyselect_1.2.0    diptest_0.76-0 

Do you know how can I solve this?

QianhuiXu commented 1 year ago

Hello! I had similar errors.

p1 <- vis(exp_vol, .by = c("Position"), .meta = immhccdata_mixcr$meta) Error in select(): ! :1:7: unexpected symbol 1: Using an ^ Run rlang::last_error() to see where the error occurred.

However, it is ok when using two parameters

p2 <- vis(exp_vol, .by = c("Position", "Overall_Survial_Group"), .meta = immhccdata_mixcr$meta) Warning message: Ignoring unknown aesthetics: xmin, xmax, annotations, y_position

Have you solved this problem? I'm really at a loss as to how to proceed, and any guidance would be much appreciated! Thank you for your kind help!

Alexander230 commented 1 year ago

Hi, @Biojenifer and @QianhuiXu!

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

@Biojenifer, I've tried to reproduce the error with your example data: first saved it to the file example.zip

Then loaded it with commands:

immdata <- repLoad('example.tsv', .coding = F)
exp_len <- repExplore(immdata$data, .method = "len")

And these commands worked successfully. From your environment, it's visible that you are using an old version of immunarch package. Please update it and try again with the latest version. To install the latest release version, use the commands:

install.packages("immunarch")
library("immunarch")

And for the latest development version:

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

@QianhuiXu, if the bug still persists with the latest version of immunarch, can you, please, attach an example data for which the bug can be reproduced?

Best regards, Aleksandr