Skip to content

calcWeidner issue #19

@Jennyyicong

Description

@Jennyyicong

I've been using the calcWeidner function and discovered a bug in the CpG extraction logic that causes incorrect clock calculations.

The current code uses:
DNAm[, na.omit(match(colnames(DNAm), Weidner_CpGs))]
This extracts the wrong CpGs. For example, when I check what's being extracted:

Weidner_CpGs
[1] "cg02228185" "cg25809905" "cg17861230"

colnames(Betas1)[na.omit(match(colnames(Betas1), Weidner_CpGs))]
[1] "cg25455143" "cg25324105" "cg25383568"

The function is using completely different CpGs instead of the three required Weidner clock CpGs.
Suggested Fix:

DNAm[, Weidner_CpGs]

This should be corrected in both calculation sections.

Even after fixing the CpG extraction bug, my friend and I are getting different results when running the same sample. We've verified that all three Weidner CpGs are present in both datasets (100% present) and we're using the same sample.

Could there be other factors affecting reproducibility that I should investigate?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions