ChAMP package:Error in cmdscale(d) : 'k' must be in {1, 2, .. n - 1}
1
0
Entering edit mode
@582b8f2e
Last seen 19 months ago
China

I selected two GSM samples.

when I use the “champ. QC” function of ChAMP package, a error appears:

> champ.QC(beta = myLoad$beta,pheno=myLoad$pd$type) 
[===========================]
[<<<<< ChAMP.QC START >>>>>>]
-----------------------------
champ.QC Results will be saved in ./CHAMP_QCimages/
[QC plots will be proceed with 411557 probes and 2 samples.]

<< Prepare Data Over. >>
Error in cmdscale(d) : 'k' must be in {1, 2, ..  n - 1}

The complete code is as follows:

pd10 <- data.frame(stringsAsFactors = FALSE,
                  Sample_Name = c("GSM1669564","GSM1669589"),
                  type = c("lung_NSCLC_adenocarcinoma"))
idat.name10 <- list.files("/home/shuangshuang/R/Rstudio/03.MethyICIBERSORT/dataset/LUAD", 
                         pattern = "*.idat") |> substr(1L,30L)
pd10$Sentrix_ID <- substr(idat.name10[seq(1,4,2)],12,21)
pd10$Sentrix_Position <- substr(idat.name10[seq(1,4,2)],23,28) 
pd10$Sample_Type <- ("tumor")
write.csv(pd10,file = "sample_type1.csv",row.names = F,quote = F)
myDir="/home/shuangshuang/R/Rstudio/03.MethyICIBERSORT/dataset/LUAD"
myLoad <- champ.load(myDir, arraytype="450K")
class(myLoad)
#[1] "list"
champ.QC(beta = myLoad$beta,pheno=myLoad$pd$type) 

So how to solve this problem? Thanks!

MethylationArrayData • 1.9k views
ADD COMMENT
0
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 1 day ago
France

I think it is because you have only two samples. In the mdsPlot (https://rdrr.io/bioc/minfi/src/R/plot.R) you first calculate the distance between samples, so you obtain a matrix of 1x1 containing the distance between sample1 and sample2. Then, by default mdsPlot calculates cmdscale() but the maximum dimension of the space is by default 2 whereas your distance matrix is of dimension 1 so the error stems from here.

You may create a custom code to make it work for two samples but you may also skip this step with : champ.QC(beta = myLoad$beta,pheno=myLoad$pd$type, mdsPlot=FALSE)

ADD COMMENT
0
Entering edit mode

OK, thanks!

ADD REPLY

Login before adding your answer.

Traffic: 992 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