error in champ.SVD
0
0
Entering edit mode
Giulia • 0
@fbbebaac
Last seen 12 months ago
Italy

Hello, when I run champ.SVD function I always obtain this kind of error, wthat is the problem?

Thank you!

Code should be placed in three backticks as shown below

library("ChAMP")
myLoad<-champ.load(directory="C:/Users/andre/methylation_CLL1", arraytype="EPIC")
champ.QC()
myNorm <- champ.norm(beta=myLoad$beta,arraytype="EPIC",cores=5)
QC.GUI(beta=myNorm,arraytype="EPIC")
champ.SVD(beta=myNorm,pd=myLoad$pd)

#> champ.SVD(beta=myNorm,pd=myLoad$pd)
[===========================]
[<<<<< ChAMP.SVD START >>>>>]
-----------------------------
champ.SVD Results will be saved in ./CHAMP_SVDimages/ .

Error in if (class(beta) == "data.frame") { : 
  the condition has length > 1
svd methylation champ • 738 views
ADD COMMENT
0
Entering edit mode

It is an ERROR in the champ code and will have to be fixed by the ChAMP maintainers. R introduced length > 1 conditional checks. If the results of class(beta) has multiple values from say extending a class than it will throw an error because the if statement will have a vector instead of a single value

ADD REPLY
0
Entering edit mode

dummy example:

> library(tibble)
> x = tibble()
> class(x)
[1] "tbl_df"     "tbl"        "data.frame"
> class(x) == "data.frame"
[1] FALSE FALSE  TRUE
> if(class(x) == "data.frame") { message("something")}
Error in if (class(x) == "data.frame") { : the condition has length > 1

They need to change the == likely to is() or surround in an any

> if(is(x,"data.frame")) { message("something")}
something
ADD REPLY

Login before adding your answer.

Traffic: 1086 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6