Question: error while using champ.svd() function
0
gravatar for sinha.puja
9 months ago by
sinha.puja0
sinha.puja0 wrote:

Hi,

I am trying to analyze Illumina EPIC methylation array data with Champ.

and getting the following error when run champ.svd() :

<< PhenoTypes.lv generated successfully. >>
Error in summary(lm(svd.o$v[, c] ~ PhenoTypes.lv[[f]]))$coeff[2, 4] : 
  subscript out of bounds

Any ideas or help is appreciated.

 

THANKS!

champ • 245 views
ADD COMMENTlink written 9 months ago by sinha.puja0

Can I have a look at your code? especially pheno parameter. I just tried to run it and seems working well.

I suspect your beta matrix and pheno are not matched with each other.

Best

Yuan Tian

ADD REPLYlink written 9 months ago by Yuan Tian110

My code is:

if (!requireNamespace("BiocManager", quietly=TRUE))
  install.packages("BiocManager")
BiocManager::install("ChAMP")
library(ChAMP)
baseDir2 <- "/C:/Users/sinha.puja/Desktop/idats"
myLoad <- champ.load(directory = getwd(),arraytype="EPIC")
champ.QC()
myNorm <- champ.norm(beta=myLoad$beta,rgSet=myLoad$rgSet,mset=myLoad$mset,resultsDir="./CHAMP_Normalization/",method="BMIQ",plotBMIQ=TRUE,arraytype="EPIC",cores=3)
champ.SVD(beta = myNorm,rgSet=myLoad$rgSet,pd=myLoad$pd,RGEffect=TRUE,PDFplot=TRUE,Rplot=TRUE,resultsDir="./CHAMP_SVDimages/")

but after running this I got an error:

champ.SVD Results will be saved in ./CHAMP_SVDimages/ .

[SVD analysis will be proceed with 760639 probes and 30 samples.]


[ champ.SVD() will only check the dimensions between data and pd, instead if checking if Sample_Names are correctly matched (because some user may have no Sample_Names in their pd file),thus please make sure your pd file is in accord with your data sets (beta) and (rgSet).]

<< Following Factors in your pd(sample_sheet.csv) will be analysised: >>
<Sample_Well>(character):A1, B1, C1, D1, E1, F1, G1, H1, A2, B2, C2, D2, E2, F2, G2, H2, A3, B3, C3, D3, E3, F3, G3, H3, A4, B4, C4, D4, E4, F4
<Sample_Group>(character):P, C
<Slide>(numeric):203021070021, 203021070022, 203021070073, 203021070013
<Array>(character):R01C01, R02C01, R03C01, R04C01, R05C01, R06C01, R07C01, R08C01
<Category>(character):Pain, Control
<Age>(integer):63, 61, 77, 81, 74, 56, 60, 83, 69, 70, 75, 66, 65, 67, 80, 79, 68, 78, 71
<Female_Recode_1>(integer):1, 0
[champ.SVD have automatically select ALL factors contain at least two different values from your pd(sample_sheet.csv), if you don't want to analysis some of them, please remove them manually from your pd variable then retry champ.SVD().]

<< Following Factors in your pd(sample_sheet.csv) will not be analysis: >>
<Sample_Name>
[Factors are ignored because they only indicate Name or Project, or they contain ONLY ONE value across all Samples.]
If you want to check Effect of Control Probes, you MUST provide rgSet parameter. Now champ.SVD can only analysis factors in pd.

<< PhenoTypes.lv generated successfully. >>
Error in summary(lm(svd.o$v[, c] ~ PhenoTypes.lv[[f]]))$coeff[2, 4] : 
  subscript out of bounds

Any help to troubleshoot this error will be greatly appreciated.

Thanks.

 
ADD REPLYlink written 9 months ago by sinha.puja0
Hi Puja: Please try use as.character function to reset your Slide column in pd. then retry It.The error could be triggered When your Slide column is numeric type. Best Yuan Tian
ADD REPLYlink written 9 months ago by Yuan Tian110

Hi Yuan, I tried using as.character function but again it gives me the same type of error as mentioned in the upper section.

ADD REPLYlink written 9 months ago by sinha.puja0

Um... Please try convert both Slide and Female_Recode into factor or character, then retry it. I believe they should be category right? But according to the above output, they will all be considered as a numeric variable.

ADD REPLYlink written 9 months ago by Yuan Tian110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 179 users visited in the last hour