Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate correlation and how to use it #41

Open
hookoop opened this issue Oct 3, 2024 · 1 comment
Open

Duplicate correlation and how to use it #41

hookoop opened this issue Oct 3, 2024 · 1 comment

Comments

@hookoop
Copy link

hookoop commented Oct 3, 2024

Hey,

I was wondering if you could provide some lines of code for how to do DuplicateCorrelation twice.
This would be useful to include in the tutorial also since most likely many users will be having several AOIs from the same patient, which effectively count as technical replicates.

Best,
Helka

@ningbioinfo
Copy link
Member

Hi @hookoop , the code of using dupcor is some thing like this:

say y is the dgeList object.

v <- voom(y, design)
dupcor <- duplicateCorrelation(v, design, block=y$samples$PATIENTS_ID) # first round
v = voom(v, design, block=y$samples$PATIENTS_ID, correlation =dupcor$consensus)
dupcor <- duplicateCorrelation(v, design, block=y$samples$PATIENTS_ID) # second round

fit <- lmFit(v, design,  block=y$samples$PATIENTS_ID, correlation =dupcor$consensus)
contrasts.fit(...)
eBayes(...)

This first round of estimate may not fully account for the variability in the data or may not capture the true correlation accurately. Hence doing a second round might improve the case, you might see the the correlation beging changed just tiny bit not a lot. You can also do multiple rounds, but at the end the correlation will be the same after multiple rounds. I recall in the book of limma/edgeR that it was suggested that we do at least two rounds to get a good estimate.

I might incorperate this into the tutorial later..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants