pachterlab / sleuth

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

Running sleuth causes infinite data.table warning #252

Open tiagobrc opened 4 years ago

tiagobrc commented 4 years ago

Hi,

When running Sleuth_prep, a series of warnings are being shown on the screen, and previous scripts are not working anymore, as these warnings repeat for a long time. Do you have any clues about this?

Testes in different computers and R versions and got the same result.

Thanks!

so <- sleuth_prep(s2c.mln, 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))
.The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_tpm_df). In the next version, this warning will become an error.
tiagobrc commented 4 years ago

Reverting the data.table package to an older version solves the problem.

lmcewen commented 4 years ago

I also came across this issue too when I use gene_mode = TRUE and aggregation_column = 'ext_gene' (works if I do not use that, so for the transcript level). What version of data.table did you end up using? Although I think the error is pretty informative, the functions in bootstrap.R that have data.table::melt should be changed to reshape2::melt.

tiagobrc commented 3 years ago

Hi @lmcewen, this response is 1 year late, so sorry about that. I haven't tested all the data.table versions.

The command I use was:

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

And it gives me the output:

'gene_mode' is TRUE. Sleuth will do counts aggregation at the gene level for downstream normalization, transformation, and modeling steps, as well as for plotting and results.
It appears that you are running Sleuth from within Rstudio.
Because of concerns with forking processes from a GUI, 'num_cores' is being set to 1.
If you wish to take advantage of multiple cores, please consider running sleuth from the command line.reading in kallisto results
dropping unused factor levels
..................
normalizing est_counts
42216 targets passed the filter
normalizing tpm
merging in metadata
aggregating by column: ext_gene
19706 genes passed the filter
287 target_ids are missing annotations for the aggregation_column: ext_gene.
These target_ids will be dropped from the gene-level analysis.
If you did not expect this, check your 'target_mapping' table for missing values.summarizing bootstraps
.The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_tpm_df). In the next version, this warning will become an error.
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_df). In the next version, this warning will become an error.The dcast generic in data.table has been passed a data.frame and will attempt to redirect to the reshape2::dcast; please note that reshape2 is deprecated, and this redirection is now deprecated as well. Please do this redirection yourself like reshape2::dcast(scaled_bs). In the next version, this warning will become an error..
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_tpm_df). In the next version, this warning will become an error.
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_df). In the next version, this warning will become an error.The dcast generic in data.table has been passed a data.frame and will attempt to redirect to the reshape2::dcast; please note that reshape2 is deprecated, and this redirection is now deprecated as well. Please do this redirection yourself like reshape2::dcast(scaled_bs). In the next version, this warning will become an error..
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_tpm_df). In the next version, this warning will become an error.
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_df). In the next version, this warning will become an error.The dcast generic in data.table has been passed a data.frame and will attempt to redirect to the reshape2::dcast; please note that reshape2 is deprecated, and this redirection is now deprecated as well. Please do this redirection yourself like reshape2::dcast(scaled_bs). In the next version, this warning will become an error..
The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(bs_tpm_df). In the next version, this warning will become an error.

Here, sleuth keeps printing the same messages over and over again but eventually it finishes just fine. The data.table version does not matter as I previously thought. I think in the future, this might break the code.

lassancejm commented 1 year ago

Reviving this thread, as I am encountering the same error. Any update on whether this will be fixed? Or what is a suitable workaround? Thanks!