Last active
August 10, 2022 17:20
-
-
Save Jfortin1/3107cf2eda24da8a6dfd to your computer and use it in GitHub Desktop.
To remove sex chromosome probes from a 450k matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
makeAutosomal <- function(matrix){ | |
require(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
ann <- getAnnotation(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
good.probes <- rownames(ann)[-which(ann$chr=="chrX" | ann$chr=="chrY")] | |
matrix[rownames(matrix) %in% good.probes,] | |
} | |
makeX <- function(matrix){ | |
require(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
ann <- getAnnotation(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
good.probes <- rownames(ann)[ann$chr=="chrX"] | |
matrix[rownames(matrix) %in% good.probes,] | |
} | |
makeY <- function(matrix){ | |
require(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
ann <- getAnnotation(IlluminaHumanMethylation450kanno.ilmn12.hg19) | |
good.probes <- rownames(ann)[ann$chr=="chrY"] | |
matrix[rownames(matrix) %in% good.probes,] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment