data.table error in devel branch
Getting this error working with the devel branch when plotting a heatmap:
Error in
[.data.table(s2c, , annotation_cols, drop = FALSE) : j (the 2nd argument inside [...]) is a single symbol but column name 'annotation_cols' is not found. Perhaps you intended DT[,..annotation_cols] or DT[,annotation_cols,with=FALSE]. This difference to data.frame is deliberate and explained in FAQ 1.1. Calls: <Anonymous> ... eval -> plot_transcript_heatmap -> [ -> [.data.table
Should be with=F instead of drop=F?
Sorry for the delay. Are you still having this issue, @Retr0 ?
Thanks
I was not able to reproduce this error after installing the latest commit on the devel branch. Can you confirm if the error still occurs for you, @Retr0?
Yes, still occurs.
> so <- sleuth_prep(s2c_sub, ~1, target_mapping = t2g) reading in kallisto results dropping unused factor levels ................ normalizing est_counts 37592 targets passed the filter normalizing tpm merging in metadata summarizing bootstraps ................
> plot_transcript_heatmap(so, t2g[1:10, target_id]) Error in
[.data.table(s2c, , annotation_cols, drop = FALSE) : j (the 2nd argument inside [...]) is a single symbol but column name 'annotation_cols' is not found. Perhaps you intended DT[,..annotation_cols] or DT[,annotation_cols,with=FALSE]. This difference to data.frame is deliberate and explained in FAQ 1.1.
> sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 9 (stretch) Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.19.so locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] bindrcpp_0.2 data.table_1.10.4-3 sleuth_0.29.0
[4] dplyr_0.7.4 ggplot2_2.2.1
loaded via a namespace (and not attached): [1] Rcpp_0.12.15 bindr_0.1 magrittr_1.5 zlibbioc_1.24.0 [5] tidyselect_0.2.3 munsell_0.4.3 colorspace_1.3-2 R6_2.2.2
[9] rlang_0.1.6 stringr_1.2.0 plyr_1.8.4 tools_3.4.3
[13] parallel_3.4.3 grid_3.4.3 rhdf5_2.22.0 gtable_0.2.0
[17] digest_0.6.15 lazyeval_0.2.1 assertthat_0.2.0 tibble_1.4.2
[21] purrr_0.2.4 reshape2_1.4.3 tidyr_0.8.0 glue_1.2.0
[25] labeling_0.3 stringi_1.1.6 compiler_3.4.3 pillar_1.1.0
[29] scales_0.5.0 pkgconfig_2.0.1
EDIT: I think it's happening because the s2c object I pass to sleuth_prep is itself a data.table. The help does say that s2c should be a data frame. If that is the cause perhaps it could be checked for?
Hi @Retr0,
That is important information that helps us reproduce the error. The check used in sleuth_prep is is(sample_to_covariates, "data.frame") and this evaluates to TRUE both when s2c is a data frame and when s2c is a data.table (you can try it yourself), and this is why it was missed when you ran sleuth_prep.
This means we'll have to add a line to coerce the data.table object to a data frame to prevent this problem in the future.
Hi @Retr0,
I've made a patch for this issue in the currently open pull request. You can install it using the following command:
devtools::install_github('warrenmcg/sleuth', ref = 'patch4')
You need to rerun sleuth_prep. If you have further errors from using this, let us know!
@Retr0 have you had a chance to try this out?
thanks