[0bdad5]: / tests / testthat / test-basic-workflow.R

Download this file

103 lines (82 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
# Skip these tests on CRAN
skip_on_cran()
context("test-basic-workflow")
data("XenaData", package = "UCSCXenaTools")
head(XenaData)
test_that("Load XenaData works", {
expect_is(XenaData, "data.frame")
})
xe <- XenaGenerate(subset = XenaHostNames == "tcgaHub")
test_that("XenaGenerate works", {
expect_is(xe, "XenaHub")
})
test_that("Xena Scan works", {
XenaScan()
XenaScan(pattern = "zzzzzzzzzzz")
x1 <- XenaScan(pattern = "Blood")
x2 <- XenaScan(pattern = "LUNG", ignore.case = FALSE)
x1 %>%
XenaGenerate()
x2 %>%
XenaGenerate()
})
xe2 <- XenaFilter(xe, filterDatasets = "clinical")
xe2 <- XenaFilter(xe2, filterDatasets = "LUAD|LUSC")
test_that("XenaFilter works", {
expect_is(xe2, "XenaHub")
})
xe2_query <- XenaQuery(xe2)
test_that("XenaQuery works", {
expect_is(xe2_query, "data.frame")
})
xe2_download <- XenaDownload(xe2_query, trans_slash = FALSE, download_probeMap = TRUE)
xe2_download <- XenaDownload(xe2_query,
trans_slash = TRUE,
destdir = file.path(tempdir(), "test_ucscxenatools")
)
# 4 ways to prepare data
dt1 <- XenaPrepare(file.path(tempdir(), "test_ucscxenatools"))
dt1 <- XenaPrepare(file.path(tempdir(), "test_ucscxenatools"), use_chunk = TRUE)
dt2 <- XenaPrepare(xe2_download$destfiles[1])
dt2 <- XenaPrepare(xe2_download$destfiles[1], use_chunk = TRUE)
dt3 <- XenaPrepare(xe2_download$url[1])
dt3 <- XenaPrepare(xe2_download$url[1], use_chunk = TRUE)
dt3 <- XenaPrepare(xe2_download$url, use_chunk = TRUE)
dt4 <- XenaPrepare(xe2_download)
dt4 <- XenaPrepare(xe2_download, use_chunk = TRUE)
### Simplified functions
expect_error(getTCGAdata("xxx"))
expect_error(getTCGAdata(c("UVM", "LUAD"), mRNASeq = TRUE, mRNASeqType = "xxx"))
expect_error(getTCGAdata(c("UVM", "LUAD"),
Methylation = TRUE, MethylationType = "xxx",
RPPAArray = TRUE, ReplicateBaseNormalization = FALSE
))
getTCGAdata(c("UVM", "LUAD"),
GisticCopyNumber = TRUE, Gistic2Threshold = FALSE,
CopyNumberSegment = TRUE, RemoveGermlineCNV = FALSE
)
getTCGAdata("LUNG", download = TRUE)
getTCGAdata("LUAD",
clinical = FALSE, mRNASeq = TRUE,
mRNAArray = TRUE, miRNASeq = TRUE, exonRNASeq = TRUE,
RPPAArray = TRUE, ReplicateBaseNormalization = TRUE,
Methylation = TRUE, GeneMutation = TRUE, SomaticMutation = TRUE,
GisticCopyNumber = TRUE, Gistic2Threshold = TRUE, CopyNumberSegment = TRUE, RemoveGermlineCNV = TRUE
)
downloadTCGA(
project = "UVM",
data_type = "Phenotype",
file_type = "Clinical Information"
)
downloadTCGA("xxx",
data_type = "Phenotype",
file_type = "Clinical Information"
)
availTCGA()
availTCGA(which = "ProjectID")
availTCGA(which = "DataType")
availTCGA(which = "FileType")
showTCGA()
showTCGA("LUAD")
# clean all
rm(list = ls())