ChAMP data analysis
Entering edit mode
6 days ago
Afrin • 0

Hi All, I am analyzing my EPIC array methylation data using ChAMP package. Can I run ChAMP for 4 samples? While trying with 4 samples(2 cases and 2 controls), the following error occurred in SVD and Combat functions. Can someone help me rectify this error?

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

[ 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).]

[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.]

<< generated successfully. >> Error in summary(lm(svd.o$v[, c] ~[[f]]))$coeff[2, 4] : subscript out of bounds In addition: Warning messages: 1: In dir.create(resultsDir) : '.\CHAMP_SVDimages' already exists 2: In if (class(beta) == "data.frame") { : the condition has length > 1 and only the first element will be used

<< Start Correcting Slide >> ~Sample_Group

<environment: 0x000001fa25761fe0> Generate mod success. Started to run ComBat, which is quite slow... Found 1 genes with uniform expression within a single batch (all zeros); these will not be adjusted for batch. Found2batches Adjusting for1covariate(s) or covariate level(s) Error in ComBat(dat = beta, batch = batch, mod = mod, par.prior = TRUE) : The covariate is confounded with batch! Remove the covariate and rerun ComBat

ChAMP • 180 views
Entering edit mode

Could you provide the structure of your pd file ? str(myLoad$pd) or corresponding code

Entering edit mode
5 days ago
Bethan • 0

As Basti says, it's hard to fix the error if we can't see your code.

On the second issue: it’s not really an error, more just how the program works. It will occur if the covariate you’re trying to preserve is confounded with the batch effect you’re trying to correct.

For example, in a project I did a year ago:

combat_data <- champ.runCombat(beta=your_beta_file, pd=your_pd_file, variablename = “Grade”,  batchname="Sex”)

The above did not work, ComBat could not correct for batch effects from sex of patients while preserving variation from tumour grade of patients, because in my dataset Sex and Grade were confounded.

However the following did work and correct batch effects from sample slide:

combat_data <- champ.runCombat(beta=your_beta_file, pd=your_pd_file, variablename = "Grade", batchname="Slide")

Because the variables Slide and Grade were not confounded.

To fix this issue, you could either change the batch effect you’re trying to correct for or change/remove the optional variablename parameter.

Sometimes, if ComBat is unable to correct a batch effect you really need corrected, you can account for this by analysing the batches separately. E.g. in the above example, to account for variation from sex, it was possible to analyse samples from male and female patients separately later in the pipeline.

Still quite new to ChAMP (i.e. if anything here is inaccurate please comment!) but I hope this helps.

Entering edit mode

N.B: another issue you may run into is that ComBat can't correct for batches that only contain one sample.

For example when correcting for Slide, some slides only contained one sample each. These samples had to be removed from the dataset before ComBat would run.


Login before adding your answer.

Traffic: 1883 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6