.format_tbl() in pdb.annotate() cannot handle "source" with no value

Issue #827 resolved
Emilio Xavier Esposito created an issue

Hi

Thank you @Xinqiu Yao for updating pdb.annotate() to accommodate the RCSB’s new API!

I found a bug related to querying the RCSB for multiple structures. When one of the structures has multiple chains but the number of “sources” does not match the number of chains an error is returned.

bio3d::pdb.annotate(unique=FALSE, ids=c("4os7", "4x0w"))
Error in `$<-.data.frame`(`*tmp*`, "source", value = c("Homo sapiens",  : 
  replacement has 3 rows, data has 4

I am using the most recent version of bio3d from Bitbucket.

install_bitbucket("Grantlab/bio3d", subdir = "ver_devel/bio3d/")
Skipping install of 'bio3d' from a bitbucket remote, the SHA1 (59a3a60d) has not changed since last install.
  Use `force = TRUE` to force installation

Will submit updated code and update issue with the pull request. The updated file is also attached.

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] devtools_2.4.2   usethis_2.0.1    cowplot_1.1.1    reshape2_1.4.4   bio3d_2.4-2.9000 vanddraabe_1.1.2 forcats_0.5.1    stringr_1.4.0    dplyr_1.0.6      purrr_0.3.4      readr_1.4.0      tidyr_1.1.3      tibble_3.1.2    
[14] ggplot2_3.3.4    tidyverse_1.3.1 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        lubridate_1.7.10  prettyunits_1.1.1 ps_1.6.0          rprojroot_2.0.2   assertthat_0.2.1  utf8_1.2.1        R6_2.5.0          cellranger_1.1.0  plyr_1.8.6        backports_1.2.1   reprex_2.0.0     
[13] httr_1.4.2        pillar_1.6.1      rlang_0.4.11      curl_4.3.1        readxl_1.3.1      rstudioapi_0.13   callr_3.7.0       desc_1.3.0        munsell_0.5.0     broom_0.7.7       compiler_4.0.3    modelr_0.1.8     
[25] pkgconfig_2.0.3   pkgbuild_1.2.0    tidyselect_1.1.1  fansi_0.5.0       crayon_1.4.1      dbplyr_2.1.1      withr_2.4.2       grid_4.0.3        jsonlite_1.7.2    gtable_0.3.0      lifecycle_1.0.0   DBI_1.1.1        
[37] magrittr_2.0.1    scales_1.1.1      zip_2.2.0         cli_2.5.0         stringi_1.6.2     cachem_1.0.5      remotes_2.4.0     fs_1.5.0          testthat_3.0.3    xml2_1.3.2        fastcluster_1.2.3 ellipsis_0.3.2   
[49] generics_0.1.0    vctrs_0.3.8       openxlsx_4.2.4    tools_4.0.3       glue_1.4.2        hms_1.1.0         pkgload_1.2.1     processx_3.5.2    parallel_4.0.3    fastmap_1.1.0     colorspace_2.0-1  sessioninfo_1.1.1
[61] rvest_1.0.0       memoise_2.0.0     haven_2.4.1      

Comments (6)

  1. Xinqiu Yao

    Emilio,

    Thanks for catching the bug and fixing it! We really appreciate it.

    Could you please re-create a pull request because the current request seems to be mixed with an earlier request that is still pending. When you create it, make sure branches are matching, i.e., ‘core’ to ‘core’ or ‘master’ to ‘master’. Thanks a lot!

  2. Emilio Xavier Esposito reporter

    You are very welcome!

    When trying to recreate the pull request Bitbucket indicates “There are no change. The source and destination are the same.”

    Any ideas?

  3. Xinqiu Yao

    I think you need to push the changes to a separate repo and then create the pull request. In your case, just push your local commit to the Bio3D repo would be the easiest. I think you have the write permission. Just make sure if you develop the changes in a local ‘master’ (or ‘core’) branch, push it to the same ‘master’ ('core') branch in the remote repo.

    Let me know if you have any questions.

  4. Emilio Xavier Esposito reporter

    Thank you for your help @Xinqiu Yao !

    The fix is commit af72a4d in master.

    Marking this issue as resolved.

  5. Log in to comment