Skip to content

Commit

Permalink
finalize meth atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-d13 committed Nov 21, 2024
1 parent 9593ff4 commit 3f1b7f7
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
11 changes: 9 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ Imports:
FlowSorted.Blood.EPIC,
ggplot2,
methylCC,
minfi
minfi,
reticulate,
MethylResolver,
data.table,
dplyr,
reshape,
tibble
Suggests:
Biobase,
FlowSorted.Blood.450k,
Expand All @@ -27,7 +33,8 @@ Suggests:
IlluminaHumanMethylation450kmanifest,
testthat (>= 3.0.0),
knitr,
rmarkdown
rmarkdown,
minfiData
Remotes:
omnideconv/MethylResolver
Config/testthat/edition: 3
Expand Down
3 changes: 1 addition & 2 deletions R/FlowSortedBlood.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ run_flowsortedblood <- function(methyl_set, array = c('450k','EPIC'),
processMethod = 'preprocessQuantile', probeSelect = c('IDOL','both','any'), cellTypes =c('CD8T','CD4T','NK','Bcell','Mono','Neu'),
referencePlatform = c('IlluminaHumanMethylationEPIC','IlluminaHumanMethylation450k','IlluminaHumanMethylation27k'),
referenceset = NULL, CustomCpGs = NULL, meanPlot = FALSE, verbose = TRUE, lessThanOne = FALSE, cellCounts = NULL, ...){
require(FlowSorted.Blood.EPIC)


check_input_mset(methyl_set)

if (length(array) > 1) {
Expand Down
3 changes: 1 addition & 2 deletions R/epidish.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ run_epidish <- function(methyl_set, mode=c('RPC', 'CBS', 'CP'),
reference=c('blood','breast','epithelial'),
maxit = 50, nu.v = c(0.25, 0.5, 0.7),
constraint = c("inequality", "equality")){
require(EpiDISH)


check_input_mset(methyl_set)
beta_matrix <- minfi::getBeta(methyl_set)

Expand Down
2 changes: 0 additions & 2 deletions R/methylResolver.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
run_methylresolver <- function(methyl_set, doPar = F, numCores = 1, alpha = seq(0.5,0.9,by = 0.05),
absolute = TRUE, purityModel = MethylResolver::RFmodel, seed = 1){

require(MethylResolver)

set.seed(seed)

check_input_mset(methyl_set)
Expand Down
6 changes: 1 addition & 5 deletions R/methylcc.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ run_methylcc <- function(methyl_set, array = c('450k','EPIC'),
init_param_method = "random", a0init = NULL, a1init = NULL,
sig0init = NULL, sig1init = NULL, tauinit = NULL, demo = FALSE,
seed = 1){
require(methylCC)
require(minfi)
require(FlowSorted.Blood.450k)
require(IlluminaHumanMethylation450kmanifest)

set.seed(seed)
options(matrixStats.useNames.NA = "deprecated")

check_input_mset(methyl_set)

Expand Down
8 changes: 4 additions & 4 deletions R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ visualize_results <- function(result){
df <- data.frame()
sapply(names(result), function(m){
df_tmp <- as.data.frame(result[[m]])
df_tmp <- methylDeconv:::rename_cell_types(df_tmp)
df_tmp <- rename_cell_types(df_tmp)
df_tmp$other <- NULL
df_tmp$method <- m
df_tmp$sample <- rownames(df_tmp)
Expand Down Expand Up @@ -114,7 +114,7 @@ visualize_result_bar <- function(result, rename = F) {
}
df <- as.data.frame(result)
if(rename){
df <- methylDeconv:::rename_cell_types(df)
df <- rename_cell_types(df)
}

df$sample <- rownames(df)
Expand Down Expand Up @@ -153,8 +153,8 @@ compare_results <- function(res1, res2) {
return()
}

df1 <- methylDeconv:::rename_cell_types(res1)
df2 <- methylDeconv:::rename_cell_types(res2)
df1 <- rename_cell_types(res1)
df2 <- rename_cell_types(res2)

df <- merge(df1, df2, by=0, all = T)
df$Row.names <- NULL
Expand Down
3 changes: 2 additions & 1 deletion inst/deconvolve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/nfs/home/students/l.willruth/miniconda3/envs/r-methyldeconv/bin/python -u
## downloaded from https://github.com/nloyfer/meth_atlas

import numpy as np
import pandas as pd
from scipy import optimize
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test_methods.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library(methylDeconv)
library(minfiData)
library(minfi)
suppressMessages(library(methylDeconv))
suppressMessages(library(minfiData))
suppressMessages(library(minfi))

ex_data <- minfiData::MsetEx
meth <- minfi::getMeth(ex_data)
Expand Down

0 comments on commit 3f1b7f7

Please sign in to comment.