Skip to content

Commit

Permalink
fixed CRAN bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfeizi committed Sep 21, 2024
1 parent 1e18af1 commit 5f289af
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: otargen
Type: Package
Title: Access Open Target Genetics
Version: 1.1.5
Date: 2024-02-09
Date: 2024-09-21
Authors@R: c(
person("Amir", "Feizi", role = c("aut", "cre"), email = "[email protected]"),
person("Kamalika", "Ray", role = "aut"))
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/otargen?color=blue)](https://CRAN.R-project.org/package=otargen)
[![Downloads](https://cranlogs.r-pkg.org/badges/otargen?color=yellow)](https://CRAN.R-project.org/package=otargen)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?color=green)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/your-username/your-repository.svg?branch=master)](https://travis-ci.org/your-username/your-repository)
[![Build Status](https://app.travis-ci.com/your-username/your-repository.svg?branch=master)](https://app.travis-ci.com/your-username/your-repository)



Expand Down Expand Up @@ -38,7 +38,8 @@ devtools::install_github("https://github.com/amirfeizi/otargen.git")
```

### Citing otargen :raising_hand_man:
Please cite `otargen` if you use it in your research. [Bioinformatics](https://academic.oup.com/bioinformatics/article/39/8/btad441/7226507).
Please cite `otargen` if you use it in your research. [Bioinformatics](https://doi.org/10.1093/bioinformatics/btad441).

```
Feizi, Amir, and Kamalika Ray. "otargen: GraphQL-based R package for tidy data accessing and processing from Open Targets Genetics." Bioinformatics 39.8 (2023): btad441.
```
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-colocalisationsForGene.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test colocalisationsForGene works", {
skip_on_cran()
expected_1 <- otargen::colocalisationsForGene(genes = "ENSG00000169174")
expected_2 <- otargen::colocalisationsForGene(genes = c("ENSG00000163946", "ENSG00000169174", "ENSG00000143001"))
expected_3 <- otargen::colocalisationsForGene(genes = c("TP53", "TASOR", "PCSK9"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-geneInfo.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test geneInfo works", {
skip_on_cran()
expected_1 <- otargen::geneInfo(gene="ENSG00000004864")
expected_2 <- otargen::geneInfo(gene="PCSK9")
expect_s3_class(expected_1, "data.frame")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-genesForVariant.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test genesForVariant works", {
skip_on_cran()
expected_1 <- otargen::genesForVariant(variant_id = "1_154453788_C_T")
expected_2 <- otargen::genesForVariant(variant_id = "rs55808324")
expect_type(expected_1, "list")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-getLociGenes.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test get_genes works", {
skip_on_cran()
expected <- otargen::getLociGenes(chromosome = "2", start = 239634984, end = 241634984)
expect_s3_class(expected, c("tbl_df", "tbl", "data.frame"))
expect_named(expected, c("id", "symbol","bioType","description","chromosome", "tss", "start","end","fwdStrand","exons"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gwasColocalisation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test the gwasColocalisation works", {
skip_on_cran()
expected <- otargen::gwasColocalisation(study_id = "GCST90002357" ,variant_id = "1_154119580_C_A")
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gwasColocalisationForRegion.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test gwasColocalizationForRegion works", {
skip_on_cran()
expected <- otargen::gwasColocalisationForRegion(chromosome = "1", start = 55058000 , end = 5505900 )
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gwasCredibleSet.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test gwasCredibleSet works", {
skip_on_cran()
expected <- otargen::gwasCredibleSet(study_id = "GCST006614_3" ,variant_id = "1_55058182_G_A")
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gwasRegional.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test gwasRegional works", {
skip_on_cran()
expected <- otargen::gwasRegional(study_id = "GCST90025954" , chromosome = "1" , start = 55058000 , end = 55059000 )
expect_s3_class(expected, "data.frame")
expect_false(is.null(expected))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-indexVariantsAndStudiesForTagVariant.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test indexVariantsAndStudiesForTagVariant works", {
skip_on_cran()
expected <- otargen::indexVariantsAndStudiesForTagVariant(variant_id = "1_109274968_G_T", pageindex = 1, pagesize = 50)
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-manhattan.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test manhattan works", {
skip_on_cran()
expected <- otargen::manhattan(study_id = "GCST90025954" , pageindex = 0 , pagesize = 10 )
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-overlapinfoForStudy.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test overlapinfoForStudy works", {
skip_on_cran()
expected <- otargen::overlapInfoForStudy(study_id = "GCST90025954" , study_ids = c("GCST006612","GCST010245" ,"GCST90038690"))
expect_type(expected, "list")
expect_false(is.null(length(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-pheWAS.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test phewas works", {
skip_on_cran()
expected_1 <- otargen::pheWAS(variant_id = "1_55063514_G_A")
expected_2 <- otargen::pheWAS(variant_id = "rs72698179")
expect_s3_class(expected_1, "data.frame")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot_coloc.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test plot_coloc works", {
skip_on_cran()
expected_1 <- otargen::colocalisationsForGene(gene = "ENSG00000169174") %>% otargen::plot_coloc(biobank = TRUE)
expected_2 <- otargen::colocalisationsForGene(gene = c("ENSG00000167207","ENSG00000096968","ENSG00000138821", "ENSG00000125255")) %>%
otargen::plot_coloc()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot_l2g.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test plot_l2g works", {
skip_on_cran()
# Try-Catch Block to Handle Errors Gracefully
tryCatch({
# Perform the operations and store the results
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot_manhattan.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test plot_manhattan works", {
skip_on_cran()
expected <- otargen::manhattan(study_id = "GCST003044") %>% otargen::plot_manhattan()
expect_s3_class(expected, "ggplot")
expect_false(is.null(expected))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot_phewas.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test plot_phewas works", {
skip_on_cran()
expected_1 <- otargen::pheWAS(variant_id = "14_87978408_G_A") %>% otargen::plot_phewas(disease = TRUE)
expected_2 <- otargen::pheWAS(variant_id = "rs55808324") %>% otargen::plot_phewas()
expect_s3_class(expected_1, "ggplot")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-qtlColocalisationVariantQuery.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test qtlColocalisationVariantQuery works", {
skip_on_cran()
expected <- otargen::qtlColocalisationVariantQuery(study_id = "GCST90025954" ,variant_id = "1_55029009_C_T")
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-qtlCredibleSet.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test qtlCredibleSet works", {
skip_on_cran()
expected_1 <- otargen::qtlCredibleSet(study_id = "Braineac2", variant_id = "1_55053079_C_T", gene = "ENSG00000169174", biofeature = "SUBSTANTIA_NIGRA")
expected_2 <- otargen::qtlCredibleSet(study_id="Braineac2", variant_id="rs7552841", gene="PCSK9", biofeature="SUBSTANTIA_NIGRA")
expect_s3_class(expected_1, "data.frame")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-studiesAndLeadVariantsForGeneByL2G.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test studiesAndLeadVariantsForGeneByL2G works", {
skip_on_cran()
expected_1 <- otargen::studiesAndLeadVariantsForGeneByL2G(gene="ENSG00000169174")
expected_2 <- otargen::studiesAndLeadVariantsForGeneByL2G(gene=list("PCSK9", "TASOR"))
expect_s3_class(expected_1, "data.frame")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-studyInfo.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test studyInfo works", {
skip_on_cran()
expected <- otargen::studyInfo(study_id = "GCST90002357")
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-studyLocus2GeneTable.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test studyLocus2GeneTable works", {
skip_on_cran()
expected <- otargen::studyLocus2GeneTable(study_id = "GCST003044" , variant_id = "14_88009660_C_T")
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-studyVariants.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test studyVariants works", {
skip_on_cran()
expected <- otargen::studyVariants(study_id = "GCST003155")
expect_type(expected, "list")
expect_false(is.null(length(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tagVariantsAndStudiesForIndexVariant.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test tagVariantsAndStudiesForIndexVariant works", {
skip_on_cran()
expected <- otargen::tagVariantsAndStudiesForIndexVariant(variant_id = "1_55063514_G_A" , pageindex = 0 , pagesize = 10 )
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-topOverlappedStudies.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test the topOverlappedStudies works", {
skip_on_cran()
expected <- otargen::manhattan(study_id = "NEALE2_6177_1", pageindex = 1, pagesize = 50)
expect_s3_class(expected, "data.frame")
expect_false(is.null(dim(expected)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-variantInfo.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("test variantInfo works", {
skip_on_cran()
expected_1 <- otargen::variantInfo(variant_id = "1_55039974_G_T")
expected_2 <- otargen::variantInfo(variant_id = "rs11591147")
expect_s3_class(expected_1, "data.frame")
Expand Down

0 comments on commit 5f289af

Please sign in to comment.