Skip to content

Commit

Permalink
Fix get.annotation function for EPIC v2 / Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
bariskalem committed Oct 5, 2023
1 parent ae92403 commit 572359f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion R/RnBeadRawSet-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ RnBeadRawSet<-function(
}


saveRDS(probes, "/Users/baris.kalem/Code/RnBeads/probes.RDS")
res<-match.probes2annotation(probes, target, assembly)
sites<-res[[1]]
site.ids<-res[[2]]
Expand Down
3 changes: 1 addition & 2 deletions R/annotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,7 @@ rnb.get.assemblies <- function() {
#' \donttest{
#' rnb.get.annotation("promoters")
#' }
rnb.get.annotation <- function(type = "CpG", assembly = "hg38") {
## TODO: Make it hg38 compatible
rnb.get.annotation <- function(type = "CpG", assembly = "hg19") {
if (!(is.character(type) && length(type) == 1 && (!is.na(type)))) {
stop("invalid value for type")
}
Expand Down
2 changes: 1 addition & 1 deletion R/controlPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ rnb.plot.control.boxplot <- function(
if(rnb.set@target=="probesEPIC"){
meta <- rnb.get.annotation("controlsEPIC")
}else if(rnb.set@target=="probesEPICv2"){
meta <- rnb.get.annotation("controlsEPICv2")
meta <- rnb.get.annotation("controlsEPICv2", assembly = "hg38")
}else if(rnb.set@target=="probes450"){
meta <- rnb.get.annotation("controls450")
}else if(rnb.set@target=="probes27"){
Expand Down
2 changes: 1 addition & 1 deletion R/qualityControl.R
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ add.qc.barplots<-function(report, object, sample.batch.size=50){
cmd <- rnb.get.annotation("controlsEPIC")
ctypes<-unique(cmd$Target)[unique(cmd$Target) %in% rnb.infinium.control.targets("probesEPIC")[c(14,4,3,15,1:2,12:13,6,11)]]
}else if(object@target=="probesEPICv2"){
cmd <- rnb.get.annotation("controlsEPICv2")
cmd <- rnb.get.annotation("controlsEPICv2", assembly = "hg38")
ctypes<-unique(cmd$Target)[unique(cmd$Target) %in% rnb.infinium.control.targets("probesEPICv2")[c(14,4,3,15,1:2,12:13,6,11)]]
}else if(object@target=="probes450"){
cmd <- rnb.get.annotation("controls450")
Expand Down

0 comments on commit 572359f

Please sign in to comment.