pachterlab / sleuth

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

sleuth_fit needs more informative error message when there are no replicates #219

Open Npbs8691 opened 5 years ago

Npbs8691 commented 5 years ago

Hi, I have only two bulk RNASeq fast file, one wildtype mouse and second knockout mouse. However when I try to fit using sleuth_fit, I get the following error message.

so <- sleuth_fit(so, ~genotype, 'full') fitting measurement error models shrinkage estimation Error in if (sum(valid) == 0) { : missing value where TRUE/FALSE needed

so <- sleuth_fit(so, ~genotype, "reduced") fitting measurement error models shrinkage estimation Error in if (sum(valid) == 0) { : missing value where TRUE/FALSE needed

However if I use the following code, it works so <- sleuth_fit(so, ~1, "reduced")

Link to R script https://www.dropbox.com/s/zy9qg7y5c7prcnu/RNASeq_analysis.R?dl=0

This is the code for my sleuth_prep - so <- sleuth_prep(metadata, target_mapping = ttg, aggregation_column = 'ens_gene', extra_bootstrap_summary = TRUE)

Mac OS Mojave version 10.14.3 R version 3.6.0 R studio version 1.1.456

Is it because I don't have any replicates? Am I using the right model? I have only two samples, each with different genotype. If I do not need to fit the model, how can I perform differential gene expression without fitting the model?

Thank you Nabin

warrenmcg commented 5 years ago

Hi Nabin (@Npbs8691),

I'm not sure why you're not getting a more informative error at the moment, but the reason you are getting the error is because sleuth is only able to run the fitting step with designs that have replicates. With the "reduced" model, sleuth_fit is treating both samples as replicates. You cannot do differential expression using sleuth without replicates. I'll leave this issue open so we know to create a more informative error message, but you can of course ask follow-up questions if you have any.

Best, Warren

warrenmcg commented 5 years ago
Npbs8691 commented 5 years ago

Thanks Warren. Right now, I don't have replicates. Is there some other package that I could possibly use? I am a newbie to RNASeq, so apologies for a really naive question.

Nabin