-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework deprecated setAnnotations * Update downstream usage * Update more downstream usage * Update one more downstream usage * Fix typo, regen R docs * Export, regen docs * Update README * Add test * More test updates * Remove non-functional test file * Update tests * Add more introductory annotation vignette * Update pkgdown index * Final clean up of tests * One more README update
- Loading branch information
Showing
15 changed files
with
254 additions
and
52 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
test_that("Copy annotations works", { | ||
skip_if_no_synapseclient() | ||
skip_if_no_login() | ||
|
||
PARENT_TEST_PROJECT <- "syn26462036" | ||
# Create some folder objects with some annotations | ||
entity_a <- synapseclient$Folder("Entity A", | ||
parent = PARENT_TEST_PROJECT, | ||
annotations = list(foo = "bar", favorites = c("raindrops", "whiskers"))) | ||
entity_a <- .syn$store(entity_a) | ||
|
||
entity_b <- synapseclient$Folder("Entity B", | ||
parent = PARENT_TEST_PROJECT, | ||
annotations = list(favorites = c("kettles", "mittens"), after_a = TRUE)) | ||
entity_b <- .syn$store(entity_b) | ||
|
||
entity_c <- synapseclient$Folder("Entity C", | ||
parent = PARENT_TEST_PROJECT) | ||
entity_c <- .syn$store(entity_c) | ||
|
||
# when copying all annotations from A->B (default) | ||
copy_annotations(entity_from = entity_a$properties$id, | ||
entity_to = entity_b$properties$id, | ||
select = NULL, | ||
update = TRUE) | ||
|
||
# when copying selective annotations from A->C | ||
copy_annotations(entity_from = entity_a$properties$id, | ||
entity_to = entity_c$properties$id, | ||
select = c("favorites", "key_not_on_a"), | ||
update = TRUE) | ||
|
||
result_b <- .syn$get_annotations(entity_b) | ||
result_c <- .syn$get_annotations(entity_c) | ||
.syn$delete(entity_a) | ||
.syn$delete(entity_b) | ||
.syn$delete(entity_c) | ||
testthat::expect_equal(result_b$foo, "bar") | ||
testthat::expect_equal(result_b$favorites, c("raindrops", "whiskers")) | ||
testthat::expect_equal(result_b$after_a, TRUE) | ||
testthat::expect_error(result_c$foo) # Expect KeyError since key should not be present | ||
testthat::expect_equal(result_c$favorites, c("raindrops", "whiskers")) | ||
testthat::expect_error(result_c$key_not_on_a) | ||
|
||
}) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
test_that("Annotate with manifest works", { | ||
skip_if_no_synapseclient() | ||
skip_if_no_login() | ||
|
||
PARENT_TEST_PROJECT <- "syn26462036" | ||
# Use some folders to represent objects to annotate | ||
objs <- make_folder(parent = PARENT_TEST_PROJECT, folders = c("mock_file_1", "mock_file_2", "mock_file_3")) | ||
ids <- sapply(objs, function(x) x$properties$id) | ||
# Partial manifest as a data.table with list columns | ||
manifest <- data.table( | ||
entityId = ids, | ||
assay = "drugScreen", | ||
experimentalTimepoint = c(1L, 3L, 7L), | ||
experimentalTimepointUnit = "days", | ||
cellType = list(c("schwann", "macrophage"), c("schwann", "macrophage"), c("schwann", "macrophage")) | ||
) | ||
annotate_with_manifest(manifest) | ||
remanifested <- list() | ||
for(i in ids) { | ||
remanifested[[i]] <- .syn$get_annotations(i) | ||
} | ||
for(i in ids) .syn$delete(i) | ||
}) |
Oops, something went wrong.