Skip to content

Commit

Permalink
add get_gene_differential_expression_values, no processor
Browse files Browse the repository at this point in the history
  • Loading branch information
oganm committed Jul 4, 2024
1 parent 87ec765 commit ca6059b
Show file tree
Hide file tree
Showing 11 changed files with 407 additions and 117 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export(get_dataset_samples)
export(get_datasets)
export(get_datasets_by_ids)
export(get_differential_expression_values)
export(get_gene_differential_expression_values)
export(get_gene_go_terms)
export(get_gene_locations)
export(get_gene_probes)
Expand Down
395 changes: 287 additions & 108 deletions R/allEndpoints.R

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions R/processors.R
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,12 @@ processQuantitationTypeValueObject <- function(d){
)
}

processDifferentialExpressionAnalysisResultByGeneValueObject <- function(data){
browser()
return(data)
}


# processSVD <- function(d){
# d$vMatrix$rawMatrix
# browser()
Expand Down
10 changes: 10 additions & 0 deletions R/validators.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,13 @@ addToFilter <- function(filter,property,terms){
filter <- glue::glue("{filter}{property} in ({paste(terms,collapse = ',')})")
return(filter)
}

validateNumber = function(name,...){
number = unlist(list(...))

if(length(number)>1 || typeof(number)!= 'double'){
stop(glue::glue("{name} must be a double of length one"))
}

return(number)
}
2 changes: 1 addition & 1 deletion inst/script/openapi.json

Large diffs are not rendered by default.

34 changes: 32 additions & 2 deletions inst/script/registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ NULL


registerEndpoint('datasets/{datasets}/expressions/genes/{genes}?keepNonSpecific={keepNonSpecific}&consolidate={consolidate}',
'get_dataset_expression_for_genes', open_api_name = 'get_dataset_expression_for_genes',
'get_dataset_expression_for_genes', open_api_name = 'get_datasets_expression_levels_for_genes',
keyword = 'dataset',
defaults = list(
datasets = bquote(),
Expand Down Expand Up @@ -562,6 +562,36 @@ registerEndpoint("datasets/{datasets}?&offset={offset}&limit={limit}&sort={sort}
# datasets/categories -----
# currently unimplemented

# /datasets/analyses/differential/results/genes/gene
registerEndpoint("datasets/analyses/differential/results/genes/{gene}?&query={query}&filter={filter}&threshold={threshold}&offset={offset}&limit={limit}",
"get_gene_differential_expression_values",
open_api_name = "get_datasets_differential_expression_analysis_results_for_gene",
keyword = 'gene',
header = "text/tab-separated-values",
defaults = list(
gene = bquote(),
query = NA_character_,
filter = NA_character_,
offset = 0L,
limit = 20L,
threshold = 1
),
compressibles = c('filter'),
validators = c(
gene = validateSingleID,
query = validateOptionalQuery,
filter = validateFilter,
offset = validatePositiveInteger,
limit = validateLimit,
threshold = validateNumber
),
preprocessor = quote(processDifferentialExpressionAnalysisResultByGeneValueObject)
)


# /datasets/analyses/differential/results/taxa/{taxon}/genes/gene
# unimplemented along with other taxon specific endpoints

# datasets/taxa -----
# currently unimplemented

Expand Down Expand Up @@ -959,7 +989,7 @@ doFinalize <- function(document = getOption("gemmaAPI.document", "R/allEndpoints

styler::style_file("./R/allEndpoints.R", transformers = biocthis::bioc_style())
devtools::document()
devtools::build(vignettes = FALSE)
# devtools::build(vignettes = FALSE)
}

doFinalize()
Expand Down
4 changes: 2 additions & 2 deletions man/get_dataset_expression_for_genes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/get_dataset_object.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions man/get_gene_differential_expression_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_genes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_result_sets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca6059b

Please sign in to comment.