pachterlab / sleuth

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

R (sleuth and shiny) ERROR: Text to be written must be a length-one character vector #238

Open umasstr opened 4 years ago

umasstr commented 4 years ago

Summary: Using the sleuth_prep function, I built a sleuth object (so) summarizing a large dataset. My latest dataset is not viewable using shiny, which lists the error: "Text to be written must be a length-one character vector."

Troubleshooting so far: A previously constructed sleuth object built in the same fashion (so2) does not produce this error. I verified that the objects are of the same class.

> class(so)
[1] "sleuth"
> class(so2)
[1] "sleuth"

The summaries look similar

> summary(so)
        sample reads_mapped reads_proc frac_mapped bootstraps_present bootstraps_used condition
1  FVB_liver_1     33816289   36697610      0.9215                100             100        WT
2  FVB_liver_2     36478533   38963302      0.9362                100             100        WT
3  FVB_liver_3     40626988   43364146      0.9369                100             100        WT
4  FVB_liver_4     35303810   37637905      0.9380                100             100        WT
5    WX6002_T1     38396582   62102743      0.6183                100             100    YAPoff
6    WX6002_T2     36351378   53109486      0.6845                100             100    YAPoff
7    WX6002_T3     40462819   61020949      0.6631                100             100    YAPoff
8    WX6002_T4     30090194   59349927      0.5070                100             100    YAPoff
9    WX6010_T1     41246285   75645277      0.5453                100             100     YAPon
10   WX6010_T2     39475401   64839546      0.6088                100             100     YAPon
11   WX6010_T3     35270771   57100780      0.6177                100             100     YAPon
12   WX6010_T4     36658193   56836101      0.6450                100             100     YAPon

> summary(so2)
     sample reads_mapped reads_proc frac_mapped bootstraps_present bootstraps_used condition
1 WX6002_T1     38396582   62102743      0.6183                100             100    YAPoff
2 WX6002_T2     36351378   53109486      0.6845                100             100    YAPoff
3 WX6002_T3     40462819   61020949      0.6631                100             100    YAPoff
4 WX6002_T4     30090194   59349927      0.5070                100             100    YAPoff
5 WX6010_T1     41246285   75645277      0.5453                100             100     YAPon
6 WX6010_T2     39475401   64839546      0.6088                100             100     YAPon
7 WX6010_T3     35270771   57100780      0.6177                100             100     YAPon
8 WX6010_T4     36658193   56836101      0.6450                100             100     YAPon

The metadata was constructed in the same fashion for both datasets

#so
> condition = c(rep.int("WT",4),rep.int("YAPoff",4),rep.int("YAPon",4)) 
> samples=c("FVB_liver_1","FVB_liver_2","FVB_liver_3","FVB_liver_4","WX6002_T1","WX6002_T2","WX6002_T3","WX6002_T4","WX6010_T1","WX6010_T2","WX6010_T3","WX6010_T4")
> kal_dirs <- file.path("bootstrap_WX", samples)
> 
> s2c <- data.frame(sample=samples, condition = condition,path=kal_dirs, stringsAsFactors=FALSE)
> s2c
        sample condition                     path
1  FVB_liver_1        WT bootstrap_WX/FVB_liver_1
2  FVB_liver_2        WT bootstrap_WX/FVB_liver_2
3  FVB_liver_3        WT bootstrap_WX/FVB_liver_3
4  FVB_liver_4        WT bootstrap_WX/FVB_liver_4
5    WX6002_T1    YAPoff   bootstrap_WX/WX6002_T1
6    WX6002_T2    YAPoff   bootstrap_WX/WX6002_T2
7    WX6002_T3    YAPoff   bootstrap_WX/WX6002_T3
8    WX6002_T4    YAPoff   bootstrap_WX/WX6002_T4
9    WX6010_T1     YAPon   bootstrap_WX/WX6010_T1
10   WX6010_T2     YAPon   bootstrap_WX/WX6010_T2
11   WX6010_T3     YAPon   bootstrap_WX/WX6010_T3
12   WX6010_T4     YAPon   bootstrap_WX/WX6010_T4

#so2
> condition = c(rep.int("YAPoff",4),rep.int("YAPon",4)) 
> samples=c("WX6002_T1","WX6002_T2","WX6002_T3","WX6002_T4","WX6010_T1","WX6010_T2","WX6010_T3","WX6010_T4")
> kal_dirs <- file.path("bootstrap_WX", samples)
> 
> s2c <- data.frame(sample=samples, condition = condition,path=kal_dirs, stringsAsFactors=FALSE)
> s2c
     sample condition                   path
1 WX6002_T1    YAPoff bootstrap_WX/WX6002_T1
2 WX6002_T2    YAPoff bootstrap_WX/WX6002_T2
3 WX6002_T3    YAPoff bootstrap_WX/WX6002_T3
4 WX6002_T4    YAPoff bootstrap_WX/WX6002_T4
5 WX6010_T1     YAPon bootstrap_WX/WX6010_T1
6 WX6010_T2     YAPon bootstrap_WX/WX6010_T2
7 WX6010_T3     YAPon bootstrap_WX/WX6010_T3
8 WX6010_T4     YAPon bootstrap_WX/WX6010_T4

I looked to the below answer to try to understand the root cause.

https://stackoverflow.com/questions/46341840/how-do-i-solve-the-following-errorinput-must-be-a-character-vector-of-any-lengt

Unfortunately, I am simply out of my depth. I am hoping that I can modify s2c or so (with tidytext?) to address this error. Any help would be much appreciated.