Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output TreeSE #24

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
up
TuomasBorman committed Mar 14, 2024
commit 4d1a1b80799d666be70ff313c454bd4aa37725d9
4 changes: 2 additions & 2 deletions tests/testthat/test-getResult.R
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ test_that("getResult", {
res <- getResult(samples)
# The data must be MAE that have SEs inside
expect_s4_class(res, "MultiAssayExperiment")
expect_s4_class(res[[1]], "SummarizedExperiment")
expect_s4_class(res[[1]], "TreeSummarizedExperiment")

# This function fetches corresponding values from MAE (getResult) and list of
# data.frames (getData)
@@ -95,7 +95,7 @@ test_that("getResult", {
res <- getResult(samples)
# The data must be MAE that have SEs inside
expect_s4_class(res, "MultiAssayExperiment")
expect_s4_class(res[[1]], "SummarizedExperiment")
expect_s4_class(res[[1]], "TreeSummarizedExperiment")

ref <- getMetaboLights(
"https://www.ebi.ac.uk/metabolights/ws/studies/MTBLS4381")

Unchanged files with check annotations Beta

rownames(temp) <- accessions
temp <- DataFrame(temp, check.names = FALSE)
# Create empty SE
se <- TreeSummarizedExperiment(colData = temp)

Check warning on line 201 in R/getResult.R

Codecov / codecov/patch

R/getResult.R#L201

Added line #L201 was not covered by tests
return(se)
})
names(ses) <- type_names
feat_meta <- DataFrame(feat_meta, check.names = FALSE)
sample_meta <- DataFrame(sample_meta, check.names = FALSE)
# Create TreeSummarizedExperiment
se <- TreeSummarizedExperiment(

Check warning on line 270 in R/getResult.R

Codecov / codecov/patch

R/getResult.R#L270

Added line #L270 was not covered by tests
assays = assays, rowData = feat_meta, colData = sample_meta)
# The data still has sample names from MetaboLights and not from HoloFood
# This function cretaes a MAE object from list of tables.
.construct_omics_data_from_markers <- function(res, metadata){
# Convert each table to TreeSummarizedExperiment
res <- lapply(res, .convert_type_to_TreeSummarizedExperiment, metadata)

Check warning on line 512 in R/getResult.R

Codecov / codecov/patch

R/getResult.R#L512

Added line #L512 was not covered by tests
# Create MultiAssayExperiment
res <- ExperimentList(res)
res <- MultiAssayExperiment(res)
# Create TreeSummarizedExperiment
assays <- SimpleList(assay)
names(assays) <- assay.type
se <- TreeSummarizedExperiment(

Check warning on line 587 in R/getResult.R

Codecov / codecov/patch

R/getResult.R#L587

Added line #L587 was not covered by tests
assays = assays, rowData = row_data,
colData = col_data
)