pachterlab / sleuth

Differential analysis of RNA-Seq
http://pachterlab.github.io/sleuth
GNU General Public License v3.0
305 stars 95 forks source link

Shiny App Not allowing to plot bootstraps using ext_gene #209

Open tiagobrc opened 5 years ago

tiagobrc commented 5 years ago

Hi sleuth team,

Trying the gene viewer in the shiny app, it gives an error when using the ext_gene, it shows me the option but says that the object does not exist. The Ensembl_ID works normally in the Shiny. And I am able to plot it normally outside the shiny app, using the plot_bootstrap function.

Any suggestions? Am I doing something wrong?

I appreciate the help!

Thanks

t2g<-getBM(attributes=c('ensembl_transcript_id_version','ensembl_gene_id','external_gene_name'), mart = ensembl)

t2g <- dplyr::rename(t2g, target_id = ensembl_transcript_id_version,
                     ens_gene = ensembl_gene_id, ext_gene = external_gene_name

so <- sleuth_prep(s2c, target_mapping =  t2g,
                  aggregation_column = 'ext_gene', extra_bootstrap_summary = TRUE,
                  read_bootstrap_tpm = TRUE, max_bootstrap = 10, gene_mode=TRUE,
                  transform_fun_counts= function(x) log2(x + 0.5))

so <- sleuth_fit(so, ~Cell, 'full')
so <- sleuth_fit(so, ~1, 'reduced')
so <- sleuth_lrt(so, 'reduced', 'full')
sleuth_live(so)

Listening on http://127.0.0.1:42427
Warning: Error in eval: object 'ext_gene' not found
  [No stack trace available]
andrewrech commented 5 years ago

Writing to report I have this same issue on dev.

sleuth_object$targetmapping

'data.frame':   227492 obs. of  3 variables:
 $ ens_gene : chr  "ENSG00000284532" "ENSG00000238933" "ENSG00000275693" "ENSG00000275451" ...
 $ ext_gene : chr  "MIR4723" "RF00019" "RF02116" "MIR6085" ...
 $ target_id: chr  "ENST00000585070.1" "ENST00000459194.1" "ENST00000620386.1" "ENST00000618314.1" ...

so$kal_versions

[1] "0.45.0"

so$gene_mode

[1] TRUE

so$gene_column

"ext_gene"

Happy to upload object privately.

Thank you!

warrenmcg commented 5 years ago

Hey @andrewrech and @tiagobrc,

Just to clarify, when you attempted the devel, was this the pachterlab/sleuth devel branch or a different branch? The error coming from eval indicates to me that this is a but that was fixed by (5b4a3308d69254c0fab838b188cd0a6bb75da54c), which is included in my speedy_fit branch that is in pull request #213. If you were just using the stable release or the main devel branch, then I think the problem has been solved. If you have been testing with my speedy_fit branch and still see an error, that's where we will need to do some more troubleshooting.

andrewrech commented 5 years ago

@warrenmcg

Sorry Warren, I was using the master HEAD here - I didn't you you guys had a dev branch until recently.

tiagobrc commented 5 years ago

Thanks for clarifying. I will check that.

tiagobrc commented 5 years ago

I don't understand, it still does not work. Which version of sleuth am I supposed to use?

Screenshot 2019-05-13 19 14 07 Screenshot 2019-05-13 19 17 17

The error changed after I restarted R.

boryanakis commented 5 years ago

I am running into the same issue. My sleuth object seems fine:

> head(so$target_mapping)
#     target_id    fly_gene       ext_gene
# 1 FBtr0081624 FBgn0000003 7SLRNA:CR32864
# 2 FBtr0071763 FBgn0000008              a
# 3 FBtr0071764 FBgn0000008              a
# 4 FBtr0100521 FBgn0000008              a
# 5 FBtr0342981 FBgn0000008              a
# 6 FBtr0083387 FBgn0000014          abd-A

> so$kal_versions
# [1] "0.45.1"

> so$gene_mode
# [1] TRUE

> so$gene_column
# [1] "ext_gene"

Here is my session info:

> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/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] splines   stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] shiny_1.3.2     forcats_0.4.0   stringr_1.4.0   purrr_0.3.2     readr_1.3.1     tidyr_0.8.3     tibble_2.1.3    tidyverse_1.2.1 cowplot_0.9.4   ggplot2_3.1.1   sleuth_0.30.0   dplyr_0.8.1    
[13] usethis_1.5.0   devtools_2.0.2  biomaRt_2.38.0  rhdf5_2.26.2   

loaded via a namespace (and not attached):
 [1] nlme_3.1-140         matrixStats_0.54.0   bitops_1.0-6         fs_1.3.1             lubridate_1.7.4      bit64_0.9-7          RColorBrewer_1.1-2   progress_1.2.2       httr_1.4.0          
[10] rprojroot_1.3-2      tools_3.5.3          backports_1.1.4      utf8_1.1.4           R6_2.4.0             DBI_1.0.0            lazyeval_0.2.2       BiocGenerics_0.28.0  colorspace_1.4-1    
[19] withr_2.1.2          gridExtra_2.3        tidyselect_0.2.5     prettyunits_1.0.2    processx_3.3.1       bit_1.1-14           curl_3.3             compiler_3.5.3       cli_1.1.0           
[28] rvest_0.3.4          Biobase_2.42.0       xml2_1.2.0           desc_1.2.0           labeling_0.3         scales_1.0.0         callr_3.2.0          digest_0.6.19        htmltools_0.3.6     
[37] pkgconfig_2.0.2      sessioninfo_1.1.1    rlang_0.3.4          readxl_1.3.1         rstudioapi_0.10      RSQLite_2.1.1        generics_0.0.2       jsonlite_1.6         RCurl_1.95-4.12     
[46] magrittr_1.5         Rcpp_1.0.1           munsell_0.5.0        S4Vectors_0.20.1     Rhdf5lib_1.4.3       fansi_0.4.0          stringi_1.4.3        pkgbuild_1.0.3       plyr_1.8.4          
[55] grid_3.5.3           blob_1.1.1           promises_1.0.1       parallel_3.5.3       crayon_1.3.4         lattice_0.20-38      haven_2.1.0          hms_0.4.2            zeallot_0.1.0       
[64] ps_1.3.0             pillar_1.4.1         reshape2_1.4.3       stats4_3.5.3         pkgload_1.0.2        XML_3.98-1.20        glue_1.3.1           data.table_1.12.2    remotes_2.0.4       
[73] modelr_0.1.4         httpuv_1.5.1         vctrs_0.1.0          testthat_2.1.1       cellranger_1.1.0     gtable_0.3.0         assertthat_0.2.1     mime_0.6             xtable_1.8-4        
[82] broom_0.5.2          later_0.8.0          pheatmap_1.0.12      AnnotationDbi_1.44.0 memoise_1.1.0        IRanges_2.16.0