Skip to content

Commit

Permalink
Parsing of color assignment for plotting from DM.R to DMRichR::proces…
Browse files Browse the repository at this point in the history
…sBismark()
  • Loading branch information
ben-laufer committed Mar 19, 2021
1 parent 58a2ab7 commit 68aa14d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 9 additions & 0 deletions R/processBismark.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,15 @@ processBismark <- function(files = list.files(path = getwd(), pattern = "*.txt.g
stop(print(glue::glue("processBismark arguments")))
}

glue::glue("Assigning colors for plotting...")
pData <- pData(bs.filtered)
if(length(levels(pData[,testCovariate])) == 2){
pData$col <- NULL
pData$col[pData[,testCovariate] == levels(pData[,testCovariate])[1]] <- "mediumblue"
pData$col[pData[,testCovariate] == levels(pData[,testCovariate])[2]] <- "firebrick3"
pData(bs.filtered) <- pData
}

print(glue::glue("processBismark timing..."))
end_time <- Sys.time()
print(end_time - start_time)
Expand Down
9 changes: 0 additions & 9 deletions exec/DM.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,6 @@ bs.filtered <- DMRichR::processBismark(files = list.files(path = getwd(),
perGroup = perGroup,
sexCheck = sexCheck)

glue::glue("Assigning colors for plotting...")
pData <- pData(bs.filtered)
if(length(levels(pData[,testCovariate])) == 2){
pData$col <- NULL
pData$col[pData[,testCovariate] == levels(pData[,testCovariate])[1]] <- "mediumblue"
pData$col[pData[,testCovariate] == levels(pData[,testCovariate])[2]] <- "firebrick3"
pData(bs.filtered) <- pData
}

glue::glue("Saving Rdata...")
save(bs.filtered, file = "RData/bismark.RData")
#load("RData/bismark.RData")
Expand Down

0 comments on commit 68aa14d

Please sign in to comment.