Skip to content

Commit

Permalink
Deployed 6894101 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghuazhao committed Jan 6, 2025
1 parent 20ad000 commit 3321a47
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2025-01-06 18:09:00.336016+00:00
Build Date UTC : 2025-01-06 20:10:22.512885+00:00
-->
81 changes: 79 additions & 2 deletions misc/ot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,84 @@ Rscript -e '
ERAP2$ensGenes
data <- jsonlite::fromJSON("ERAP2.json")
diseases_data <- data$data$target$associatedDiseases$rows
library(tidyr)
diseases_data <- unnest(diseases_data, cols = everything(), names_sep = "_")
diseases_data <- tidyr::unnest(diseases_data, cols = everything(), names_sep = "_")
write.table(diseases_data, file = "ERAP2.tsv", sep = "\t", row.names = FALSE, quote = FALSE)
'

# https://platform-docs.opentargets.org/data-access/graphql-api

## Python: Used directly without change

python3 <<END
import requests
import json
gene_id = "ENSG00000164308"
query_string = """
query target($ensemblId: String!){
target(ensemblId: $ensemblId){
id
approvedSymbol
biotype
geneticConstraint {
constraintType
exp
obs
score
oe
oeLower
oeUpper
}
tractability {
label
modality
value
}
}
}
"""
variables = {"ensemblId": gene_id}
base_url = "https://api.platform.opentargets.org/api/v4/graphql"
r = requests.post(base_url, json={"query": query_string, "variables": variables})
print(r.status_code)
api_response = json.loads(r.text)
print(api_response)
END

## R: necessary to get around httr::content(r) for iconvlist() with iconv().

Rscript -e '
library(httr)
library(jsonlite)
gene_id <- "ENSG00000164308"
query_string = "
query target($ensemblId: String!){
target(ensemblId: $ensemblId){
id
approvedSymbol
biotype
geneticConstraint {
constraintType
exp
obs
score
oe
oeLower
oeUpper
}
tractability {
label
modality
value
}
}
}
"
base_url <- "https://api.platform.opentargets.org/api/v4/graphql"
variables <- list("ensemblId" = gene_id)
post_body <- list(query = query_string, variables = variables)
r <- httr::POST(url=base_url, body=post_body, encode='json')
data <- iconv(r, "latin1", "ASCII")
content <- jsonlite::fromJSON(data)
'
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 3321a47

Please sign in to comment.