kkdey/Logolas

Error installing and running Logolas

Daread opened this issue · 4 comments

Daread commented

Hello,

I'm having an issue getting Logolas to install through BioManager.

I've run through the steps listed on the Github up until
install_github("kkdey/Logolas",build_vignettes = TRUE)

At that point, I get an error:

── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/Rtmp1uNlIR/remotes4e4a2ae9aa8a/kkdey-Logolas-d000007/DESCRIPTION’ ...
─ preparing ‘Logolas’:
✔ checking DESCRIPTION meta-information ...
─ installing the package to build vignettes
E creating vignettes (11.7s)
--- re-building ‘Logolas.Rmd’ using rmarkdown
Quitting from lines 90-91 (Logolas.Rmd)
Error: processing vignette 'Logolas.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building ‘Logolas.Rmd’

SUMMARY: processing the following file failed:
‘Logolas.Rmd’

Error: Vignette re-building failed.
Execution halted
Error: Failed to install 'Logolas' from GitHub:
! System command 'R' failed

Alternately, if I install without building vignettes it appears that Logolas installs correctly, but then fails (giving a similar error) when I run logomaker with character vector input:

Running
x <- c("NSTE","NFSW","NFSW","NFSW","NFSW","NFSW","NFSW","NSTE","NFSW","NFSW","NFSW","NFSW")
logomaker(x, type = "EDLogo")

I see:

using a background with equal probability for all symbols
Analyzing the positional frequency matrix
color_type not provided, so switching to per_row option for
color_type
Error in if (class(table) == "data.frame") { :
the condition has length > 1

Is there any suggestion for addressing this issue?

I had the same issue. I tried doing the logos from the given example datasets and the same error appeared. I think it was because of a recent change in the class output, and class(table) sometimes gives 2 variable outputs instead of 1.

I resolved it by copying the function nLogomaker and Logomaker and running it, but in nLogomaker, I just removed the if statement causing the error. It works for me

Hi YuEnoch,

I attempted your fix to nLogomaker, but I am still getting the errror. I did not see any changes to make in Logomaker. Any chance you could give more details on your fix?

Thank you in advance,
Martin (steff2j)

Sure, what I did was copy the code for 4 functions (logomaker, plogomaker, nlogomaker, getlogoheights) from the github repository. I edited them so any statement class(table) == "data.frame") is removed, and table <- as.matrix(table) runs by default. Afterwards, it works using EDlogo. It basically is creating a fixed logomaker function that bypasses the error, instead of calling the one from logolas.

Here's the R script, if you run it in the same environment in Rstudio then this logomaker function would be used, and it should be work
fix.zip

Hi YuEnoch,

Thanks very much! After I downloaded ic_computer.R, your fix worked well! Really appreciate your help!

Cheers,
Martin