Skip to content

Adding batch effect as part of the adjustment #1

@mxdeluca

Description

@mxdeluca

I am currently working with TCGA data with known batch effects within the methylation data, and was wondering if it would be possible/advisable from your perspective to add batch effect as part of the adjustment ? I would be very keen to see if there's any additional biological pathways emerging from your approach.

I would basically add batch as part of the clustering step:

model <- stepFlexmix(y2 ~ x + batch, k = 1:nmax, nrep = nrep, verbose = FALSE)

and subsequently also include it as part of the regression :

  b_vs_pur <- lapply(1:nmax, function(z) {
    if(z %in% cl) {
      # Include all batch columns in the regression
      lm(y[cl == z] ~ x[cl == z] + batch[cl == z, ])  # Use batch matrix as covariate
    } else { NA }
  })

  b_vs_1mp <- lapply(1:nmax, function(z) {
    if(z %in% cl) {
      # Include all batch columns in the regression
      lm(y[cl == z] ~ x2[cl == z] + batch[cl == z, ])  # Use batch matrix as covariate
    } else { NA }
  })

curious to hear your thoughts

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions