pachterlab / sleuth

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

add support of strings as factors #197

Open antonkulaga opened 6 years ago

antonkulaga commented 6 years ago

It took me quite a lot to understand stopifnot(is(path, "character")) crashes caused by the following code:

base <- file.path("/home", "rstudio", "samples")
samples <- c("GSM1944768", "GSM1944769")
quant <- "transcripts_quant"
pathes <- map_chr(samples, function(s) str_c(base, "/", s, "/", quant, "/"))
prepare_fish_for_sleuth(pathes)
conditions <- c("one", "two")

s2c = data.frame(
  sample = samples,
  condition = conditions, 
  path = pathes 
#will not work until I will put stringsAsFactors=FALSE
)
so <- sleuth_prep(s2c, extra_bootstrap_summary = TRUE)

I suggest that it should work even if strings are factors in order not to confuse users