-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from CRI-iAtlas/new_api
updated to use new api
- Loading branch information
Showing
17 changed files
with
220 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#' Query Neoantigens | ||
#' | ||
#' @param pmhcs A vector of strings | ||
#' @param entrez A vector of integers | ||
#' @param patients A vector of strings | ||
#' @param paging A named list | ||
#' @param ... Arguments to create_result_from_api_query | ||
#' | ||
#' @export | ||
query_neoantigens <- function( | ||
pmhcs = NA, | ||
entrez = NA, | ||
patients = NA, | ||
paging = NA, | ||
... | ||
){ | ||
create_result_from_cursor_paginated_api_query( | ||
query_args = list( | ||
"pmhc" = pmhcs, | ||
"entrez" = entrez, | ||
"patient" = patients, | ||
"paging" = paging, | ||
"distinct" = F | ||
), | ||
query_file = "neoantigens.txt", | ||
default_tbl = dplyr::tibble( | ||
"tpm" = double(), | ||
"pmhc" = character(), | ||
"freq_pmhc" = integer(), | ||
"patient" = character(), | ||
"gene_entrez" = integer(), | ||
"gene_hgnc" = character(), | ||
), | ||
select_cols = c( | ||
"tpm" = "tpm", | ||
"pmhc" = "pmhc", | ||
"freq_pmhc" = "freqPmhc", | ||
"patient" = "patient.barcode", | ||
"gene_entrez" = "gene.entrez", | ||
"gene_hgnc" = "gene.hgnc" | ||
), | ||
... | ||
) | ||
} |
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,38 @@ | ||
query Neoantigens( | ||
$paging: PagingInput | ||
$distinct:Boolean | ||
$entrez: [Int!] | ||
$patient: [String!] | ||
$pmhc: [String!] | ||
){ | ||
neoantigens( | ||
paging: $paging | ||
distinct: $distinct | ||
entrez: $entrez | ||
patient: $patient | ||
pmhc: $pmhc | ||
){ | ||
items { | ||
tpm | ||
pmhc | ||
freqPmhc | ||
patient { barcode } | ||
gene { | ||
entrez | ||
hgnc | ||
} | ||
} | ||
paging{ | ||
type | ||
pages | ||
total | ||
page | ||
limit | ||
hasNextPage | ||
hasPreviousPage | ||
startCursor | ||
endCursor | ||
} | ||
error | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
query_dir <- system.file("queries", package = "iatlasGraphQLClient") | ||
api_url <- "https://api.cri-iatlas.org/api" | ||
test_api_url <- "https://api-staging.cri-iatlas.org/api" | ||
local_api_url <- "http://localhost:5000/graphiql" |
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
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,24 @@ | ||
|
||
test_that("query_neoantigens",{ | ||
expected_columns <- c( | ||
"tpm", | ||
"pmhc", | ||
"freq_pmhc", | ||
"patient", | ||
"gene_entrez", | ||
"gene_hgnc" | ||
) | ||
result1 <- query_neoantigens( | ||
pmhcs = list("RLMELQEAV HLA_A*02:01 SPAG9"), | ||
patients = list("VanAllen_antiCTLA4_2015-p126"), | ||
query_dir = query_dir | ||
) | ||
result2 <- query_neoantigens( | ||
pmhcs = list("xxx"), | ||
query_dir = query_dir | ||
) | ||
expect_named(result1, expected_columns) | ||
expect_named(result2, expected_columns) | ||
expect_true(nrow(result1) > 0) | ||
expect_equal(nrow(result2), 0) | ||
}) |
Oops, something went wrong.