jennahamlin / tinselR

An Amazing Shiny App
Other
17 stars 4 forks source link

Debugging #6

Closed jennahamlin closed 3 years ago

jennahamlin commented 4 years ago

Error when using clade annotator in Tinsel on CDC server

This is not a problem on my mac

Error message from CDC log file:

Warning: Error in : Assigned data `values` must be compatible with existing data.
ℹ Error occurred for column `2013C-3134`.
✖ Can't convert <double> to <character>.
  362: <Anonymous>

This error appears like it might be associated with the vctrs package

Checking for reproducible error in Rstudio

install.packages("vctrs")
library(vctrs)

> vec_cast(1, integer())
[1] 1

> vec_cast(1, character())
Error: Can't convert <double> to <character>.
Run `rlang::last_error()` to see where the error occurred.
> rlang::last_error()
<error/vctrs_error_incompatible_type>
Can't convert <double> to <character>.
Backtrace:
 1. vctrs::vec_cast(1, character())
 2. vctrs::vec_default_cast(...)
 3. vctrs::stop_incompatible_cast(...)
 4. vctrs::stop_incompatible_type(...)
 5. vctrs:::stop_incompatible(...)
 6. vctrs:::stop_vctrs(...)
Run `rlang::last_trace()` to see the full context.

vec_cast(1, as.numeric(character()))
[1] 1
jennahamlin commented 4 years ago

or is it a problem with reader::redelim

potential alternative r scripting to input into tinsel module to check if it is an reader problem didn't get this to work in r shiny modules, yet

dataFile <- read.delim("/Users/jennahamlin/Desktop/Tinsel/data/example_1504MLEXH-1/1504MLEXH-1_geneticMatrix.tsv",
                       sep = "\t",
                       strip.white = T,
                       blank.lines.skip=T,
                       header = F,
                       stringsAsFactors = F
                       )

names(dataFile)<- dataFile[1,]
dataFile <- dataFile[-1,]                
dataFile <- Filter(function(x)!all(is.na(x)), dataFile)

metaFile<-read.delim("/Users/jennahamlin/Desktop/Tinsel/data/example_1504MLEXH-1/1504MLEXH-1_metaData.csv",
                     sep = ",",
                     strip.white = T,
                     blank.lines.skip=T,
                     header = F,
                     stringsAsFactors = F)

names(metaFile) <- metaFile[1,]
metaFile <- metaFile[-1,]

colnames(dataFile)[2:ncol(dataFile)] = metaFile$Display.labels[which(metaFile$Tip.labels %in% colnames(dataFile)[2:ncol(dataFile)])]
dataFile$. = metaFile$Display.labels[which(metaFile$Tip.labels %in% dataFile$.)]
jennahamlin commented 4 years ago

checked if file parsing error was problem for annotation function on cdc instance of tinse

I confirmed that there was an extra tab (\t) in one of the genetic distance test matrix files (1504..) and removed this by hand using text wrangling (show invisible), I used this file as the upload on the cdc server instance of tinsel and the same error occurred when using the annotation function.

I believe that trim_ws =T using reader should have removed this extra column due to the tab at the end of each line; however, it doesn't appear to be doing that. I will post as an issue on readr github.

Posted issue on readr github

jennahamlin commented 4 years ago

error on cdc server ("✖ Can't convert to .") - resolved

Was a result of a different package version for tibble. On my local machine, I was using. 2.1.3 and on the server 3.0.1 was installed. With tibble package version on cdc server now set to 2.1.3, the problem is resolved.

jennahamlin commented 3 years ago

[[: subscript out of bounds

The error occurs when downloading. The above error occurs if the user does this order of operations:

jennahamlin commented 3 years ago

Warning in df$parent == node : longer object length is not a multiple of shorter object length

The order of operations to result in the error is as so:

Screen Shot 2020-09-24 at 9 06 01 AM

jennahamlin commented 3 years ago

Error message - Error in if: missing value where TRUE/FALSE needed

Order of operations which produces an error that is uninformative for the user:

tree upload, genetic distance upload, add annotation is selected, then meta data is upload for tip label correction

When this happens, then the above error is produces