Open andrewrech opened 5 years ago
Additionally fixed use of data.table::dcast on data.frame (this function does not implicitly convert)
Hi @andrewrech,
Thank you for your work here! Two suggestions:
#' @importFrom utils head
statement to the documentation for sleuth_gene_table
(between lines 1092 and 1093 of sleuth.R here), as well as sleuth_to_matrix
(between lines 32 and 33 of matrix.R here). Once you've made the change, open an R session in the sleuth directory and use devtools::document()
to update the NAMESPACE file.reshape2
in the plot_transcript_heatmap
function in plots.R. If you convert those to data.table::dcast
and then add a line after the if statements to convert tab_df
to a data.frame
, we can remove a dependency to reshape2
altogether (just deleting it from the "depends" list in the DESCRIPTION file). You should also run devtools::document()
to make sure references to reshape2 are gone from the NAMESPACE file.In both cases, you can run devtools::check()
to see if there are any other issues.
Also, I've switched to the devel
branch for merging, as it allows us to combine this with other changes for the next stable release of sleuth.
@warrenmcg Thank you for your help
devtools::check
reshape2
callsreshape2
import from DESCRIPTIONthen add a line after the if statements to convert tab_df to a data.frame
data.table::dcast
returns a data frame if given a data frame; no need to convert back
data.table::dcast(test_df, time ~ variable, fun=mean) %>% str
'data.frame': 12 obs. of 2 variables:
$ time : num 0 2 4 6 8 10 12 14 16 18 ...
$ weight: num 41.1 49.2 60 74.3 91.2 ...
devtools::check
@warrenmcg see my note above
Hi @andrewrech, you are correct. Sorry about that! We will be reviewing everything next week to merge and hopefully have a new release soon! Thanks again for your help and effort! 👍
Replace reshape2::dcast with data.table::dcast for speed gain and to avoid issue with long sample names causing vector return error in reshape2 but not data.table:
Using reshape2:
But no error using data.table.
obj_norm to reproduce
Linux i-094bb338984186ac0 4.15.0-1031-aws #33-Ubuntu SMP Fri Dec 7 09:32:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux