Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as_tibble() and slice_sample() cannot handle a column named $cell #38

Closed
ttriche opened this issue Nov 16, 2021 · 4 comments · Fixed by #39
Closed

as_tibble() and slice_sample() cannot handle a column named $cell #38

ttriche opened this issue Nov 16, 2021 · 4 comments · Fixed by #39
Labels
enhancement New feature or request

Comments

@ttriche
Copy link

ttriche commented Nov 16, 2021

If you're dying to reproduce the whole thing, see https://github.com/VanAndelInstitute/ExpDesign2021/blob/main/vignettes/project2.md for gory details.

The bug:

R> as_tibble(tidybarnyard) %>% filter(method == "inDrops") %>% slice_sample()
Error: Can't transform a data frame with duplicate names.
Run `rlang::last_error()` to see where the error occurred.

Currently the fix is to rename that column. But that's a crappy fix!

R> names(colData(tidybarnyard))[4] <- "barcode"
R> as_tibble(tidybarnyard) %>% filter(method == "inDrops") %>% slice_sample()
# A tibble: 1 × 5
  cell                                        name    experiment method  barcode
  <chr>                                       <chr>   <chr>      <chr>   <chr>  
1 Mixture2.inDrops.ACCACAGA-AAGAGCGT-CTTGGTGT Mixtur… Mixture2   inDrops ACCACA…

Session info:

R> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 21.04

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] forcats_0.5.1                  readr_2.1.0                   
 [3] tidyverse_1.3.1                stringr_1.4.0                 
 [5] RcppML_0.5.2                   tidySingleCellExperiment_1.4.0
 [7] SingleCellExperiment_1.16.0    SummarizedExperiment_1.24.0   
 [9] Biobase_2.54.0                 GenomicRanges_1.46.0          
[11] GenomeInfoDb_1.30.0            IRanges_2.28.0                
[13] S4Vectors_0.32.2               BiocGenerics_0.40.0           
[15] MatrixGenerics_1.6.0           matrixStats_0.61.0            
[17] nvimcom_0.9-122                colorout_1.2-2                
[19] skeletor_1.0.4                 gtools_3.9.2                  
[21] useful_1.2.6                   knitr_1.36                    
[23] yardstick_0.0.8                workflowsets_0.1.0            
[25] workflows_0.2.4                tune_0.1.6                    
[27] tidyr_1.1.4                    tibble_3.1.6                  
[29] rsample_0.1.1                  recipes_0.1.17                
[31] purrr_0.3.4                    parsnip_0.1.7.9001            
[33] modeldata_0.1.1                infer_1.0.0                   
[35] ggplot2_3.3.5                  dplyr_1.0.7                   
[37] dials_0.0.10                   scales_1.1.1                  
[39] broom_0.7.10                   tidymodels_0.1.4              
[41] BiocManager_1.30.16           

loaded via a namespace (and not attached):
  [1] readxl_1.3.1           backports_1.3.0        RcppEigen_0.3.3.9.1   
  [4] plyr_1.8.6             lazyeval_0.2.2         splines_4.1.1         
  [7] listenv_0.8.0          usethis_2.1.3          digest_0.6.28         
 [10] foreach_1.5.1          htmltools_0.5.2        fansi_0.5.0           
 [13] magrittr_2.0.1         memoise_2.0.0.9000     tzdb_0.2.0            
 [16] remotes_2.4.1          globals_0.14.0         modelr_0.1.8          
 [19] gower_0.2.2            hardhat_0.1.6          prettyunits_1.1.1     
 [22] colorspace_2.0-2       rvest_1.0.2            haven_2.4.3           
 [25] xfun_0.28              tcltk_4.1.1            callr_3.7.0           
 [28] crayon_1.4.2           RCurl_1.98-1.5         jsonlite_1.7.2        
 [31] roxygen2_7.1.2         survival_3.2-13        iterators_1.0.13      
 [34] glue_1.5.0             gtable_0.3.0           ipred_0.9-12          
 [37] zlibbioc_1.40.0        XVector_0.34.0         DelayedArray_0.20.0   
 [40] pkgbuild_1.2.0         future.apply_1.8.1     DBI_1.1.1             
 [43] Rcpp_1.0.7             viridisLite_0.4.0      GPfit_1.0-8           
 [46] lava_1.6.10            prodlim_2019.11.13     htmlwidgets_1.5.4     
 [49] httr_1.4.2             ellipsis_0.3.2         pkgconfig_2.0.3       
 [52] nnet_7.3-16            dbplyr_2.1.1           utf8_1.2.2            
 [55] tidyselect_1.1.1       rlang_0.4.12           DiceDesign_1.9        
 [58] cellranger_1.1.0       munsell_0.5.0          tools_4.1.1           
 [61] cachem_1.0.6           cli_3.1.0              generics_0.1.1        
 [64] devtools_2.4.2         fastmap_1.1.0          processx_3.5.2        
 [67] fs_1.5.0               future_1.23.0          xml2_1.3.2            
 [70] compiler_4.1.1         rstudioapi_0.13        plotly_4.10.0         
 [73] testthat_3.1.0         reprex_2.0.1           lhs_1.1.3             
 [76] stringi_1.7.5          ps_1.6.0               desc_1.4.0            
 [79] lattice_0.20-45        Matrix_1.3-4           vctrs_0.3.8           
 [82] pillar_1.6.4           lifecycle_1.0.1        furrr_0.2.3           
 [85] data.table_1.14.2      bitops_1.0-7           R6_2.5.1              
 [88] KernSmooth_2.23-20     parallelly_1.28.1      sessioninfo_1.2.1     
 [91] codetools_0.2-18       MASS_7.3-54            assertthat_0.2.1      
 [94] pkgload_1.2.3          rprojroot_2.0.2        withr_2.4.2           
 [97] GenomeInfoDbData_1.2.7 hms_1.1.1              parallel_4.1.1        
[100] grid_4.1.1             rpart_4.1-15           timeDate_3043.102     
[103] class_7.3-19           pROC_1.18.0            lubridate_1.8.0   
@stemangiola
Copy link
Owner

stemangiola commented Nov 16, 2021

Thanks, @ttriche for the issue.

the plan is for to use .cell column name instead of cell so as to not have such issues. However, like to tidySummarizedExperiment the backwards-compatible conversion is tricky and requires some work (hard at the end of the year). But I will start it soon.

@stemangiola stemangiola added the enhancement New feature or request label Nov 16, 2021
@stemangiola stemangiola linked a pull request Nov 23, 2021 that will close this issue
@stemangiola
Copy link
Owner

stemangiola commented Nov 24, 2021

Hello @ttriche now the default cell column is .cell, with the old one deprecated but back compatible.

Could you please install the relative branch (linked above) and try your workflow? (github action fails for missing igraph in the virtual machine)

Thanks

@stemangiola
Copy link
Owner

Hello @ttriche, any news by any chance?

@stemangiola
Copy link
Owner

I close for inactivity, feel free to comment on if still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants