Skip to content

Commit

Permalink
add online tests for Expression Data Endpoints functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgpanw committed Jun 25, 2024
1 parent 19bb09a commit fd73c35
Show file tree
Hide file tree
Showing 13 changed files with 279 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/testthat/test-get_clustered_median_exon_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test_that("`get_clustered_median_exon_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_clustered_median_exon_expression(c("ENSG00000203782.5", "ENSG00000132693.12"),
tissueSiteDetailIds = "Bladder")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"exonId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_clustered_median_gene_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_clustered_median_gene_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_clustered_median_gene_expression(c("ENSG00000203782.5", "ENSG00000132693.12"),
tissueSiteDetailIds = "Bladder")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
24 changes: 24 additions & 0 deletions tests/testthat/test-get_clustered_median_junction_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
test_that(
"`get_clustered_median_junction_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_clustered_median_junction_expression(c("ENSG00000203782.5", "ENSG00000132693.12"),
tissueSiteDetailIds = "Bladder")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"junctionId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
}
)
24 changes: 24 additions & 0 deletions tests/testthat/test-get_clustered_median_transcript_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
test_that(
"`get_clustered_median_transcript_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_clustered_median_transcript_expression(c("ENSG00000203782.5", "ENSG00000132693.12"),
tissueSiteDetailIds = "Bladder")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"transcriptId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
}
)
20 changes: 20 additions & 0 deletions tests/testthat/test-get_expression_pca.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_that("`get_expression_pca()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_expression_pca(tissueSiteDetailIds = "Adipose_Subcutaneous", sampleId = "GTEX-1117F-0226-SM-5GZZ7")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"pc1",
"pc2",
"pc3",
"sampleId",
"tissueSiteDetailId",
"ontologyId",
"datasetId"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_gene_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_gene_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_gene_expression(gencodeIds = "ENSG00000132693.12", tissueSiteDetailIds = "Whole_Blood")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"data",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit",
"subsetGroup"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_median_exon_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_median_exon_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_median_exon_expression(gencodeIds = "ENSG00000132693.12", tissueSiteDetailIds = "Whole_Blood")

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"exonId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_median_gene_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_median_gene_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_median_gene_expression(gencodeIds = "ENSG00000132693.12", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
22 changes: 22 additions & 0 deletions tests/testthat/test-get_median_junction_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test_that("`get_median_junction_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_median_junction_expression(gencodeIds = "ENSG00000132693.12", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"junctionId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
22 changes: 22 additions & 0 deletions tests/testthat/test-get_median_transcript_expression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test_that("`get_median_transcript_expression()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_median_transcript_expression(gencodeIds = "ENSG00000132693.12", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"median",
"transcriptId",
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"unit"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_single_nucleus_gex.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_single_nucleus_gex()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_single_nucleus_gex(gencodeIds = "ENSG00000132693.12", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"cellTypes",
"unit"
)
)
})
19 changes: 19 additions & 0 deletions tests/testthat/test-get_single_nucleus_gex_summary.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test_that("`get_single_nucleus_gex_summary()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_single_nucleus_gex_summary(tissueSiteDetailIds = "Breast_Mammary_Tissue", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"cellType",
"numCells"
)
)
})
21 changes: 21 additions & 0 deletions tests/testthat/test-get_top_expressed_genes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
test_that("`get_top_expressed_genes()` returns tibble with expected colnames",
{
skip_if_offline()
result <- get_top_expressed_genes(tissueSiteDetailId = "Breast_Mammary_Tissue", itemsPerPage = 1) |>
suppressWarnings()

expect_s3_class(result, "tbl_df")

expect_identical(
names(result),
c(
"tissueSiteDetailId",
"ontologyId",
"datasetId",
"gencodeId",
"geneSymbol",
"median",
"unit"
)
)
})

0 comments on commit fd73c35

Please sign in to comment.