bhklab / annotationgx Goto Github PK
View Code? Open in Web Editor NEWAn R package to query various bio/chem-informatics databases APIs to construct annotation files.
Home Page: https://bhklab.github.io/AnnotationGx/
License: MIT License
An R package to query various bio/chem-informatics databases APIs to construct annotation files.
Home Page: https://bhklab.github.io/AnnotationGx/
License: MIT License
queryUnichem is currently only one at a time and makes the user apply across a list.
Include an option with a list input
AnnotationGx::getPubchemCompound(ids= 'PUGREST.BadRequest', from = 'cid', to = 'property', properties = c('Title', 'MolecularFormula', 'InChIKey', 'CanonicalSMILES'))
property/Title,MolecularFormula,InChIKey,CanonicalSMILES
<char>
1: PUGREST.BadRequest
whereas a good CID returns:
AnnotationGx::getPubchemCompound(ids= '100016', from = 'cid', to = 'property', properties = c('Title', 'MolecularFormula', 'InChIKey', 'CanonicalSMILES'))
CID MolecularFormula CanonicalSMILES
<int> <char> <char>
1: 100016 C9H12N2O5 C1=CN(C(=O)N=C1)C2C(C(C(O2)CO)O)O
InChIKey Title
<char> <char>
1: RPQZTTQVRYEKCR-WCTZXXKLSA-N Zebularine
Basic functionality implemented, create vignette with the example.
Add the annotation step in a pipeline?
from ccle pipeline:
# treatment_annotations$pubchem.CID[20]
# which is 60838
AnnotationGx::annotatePubchemCompound("60838", "CAS")
Error in if (is.character(txt) && length(txt) == 1 && nchar(txt, type = "bytes") < :
missing value where TRUE/FALSE needed
This is how I run the query:
pubchem_r2 = lapply(paste0("clean", seq(9)) ,function(col){ pubchem_query = getPubChemCompound(na.omit(unlist(drugnames_df[,col])), from='name', to='property', properties=c('Title'), batch=FALSE) })
I usually get blacklisted after "clean2".
Each queried vector contains 821 drug names.
Here is the error I get:
<simpleError: PubChem Server returned Black status! You could be black listed. The returned state message is:
Request Count status: Black (265%), Request Time status: Green (0%), Service status: Green (7%),
Remaining blocking time: 0:0:2.>
remotes::install_github(
"bhklab/AnnotationGx",
build_manual=TRUE,
build_vignettes=TRUE
)
Downloading GitHub repo bhklab/AnnotationGx@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: rlang (1.1.2 -> 1.1.3 ) [CRAN]
5: withr (2.5.2 -> 3.0.0 ) [CRAN]
6: tidyselect (1.2.0 -> 1.2.1 ) [CRAN]
7: glue (1.6.2 -> 1.7.0 ) [CRAN]
8: openssl (2.1.1 -> 2.1.2 ) [CRAN]
9: curl (5.2.0 -> 5.2.1 ) [CRAN]
10: readr (2.1.4 -> 2.1.5 ) [CRAN]
11: data.table (1.14.10 -> 1.15.4) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/private/var/folders/8x/mq9t1w4d4kxdbj1837xwsx_m0000gn/T/RtmpgShzxp/remotes122a2268168fc/bhklab-AnnotationGx-27cbafe/DESCRIPTION’ (578ms)
─ preparing ‘AnnotationGx’:
✔ checking DESCRIPTION meta-information ...
─ installing the package to build vignettes
E creating vignettes (1m 3.9s)
--- re-building ‘Cellosaurus.Rmd’ using rmarkdown
--- finished re-building ‘Cellosaurus.Rmd’
--- re-building ‘ChEMBL.Rmd’ using rmarkdown
--- finished re-building ‘ChEMBL.Rmd’
--- re-building ‘Introduction.Rmd’ using rmarkdown
Warning: The vignette title specified in \VignetteIndexEntry{} is different from the title in the YAML metadata. The former is "1. Introduction to AnnotationGx", and the latter is "Introduction to AnnotationGx". If that is intentional, you may set options(rmarkdown.html_vignette.check_title = FALSE) to suppress this check.
--- finished re-building ‘Introduction.Rmd’
--- re-building ‘OncoTree.Rmd’ using rmarkdown
Quitting from lines 62-63 [getCancerSubtypes] (OncoTree.Rmd)
Error: processing vignette 'OncoTree.Rmd' failed with diagnostics:
replacement has 0 rows, data has 885
--- failed re-building ‘OncoTree.Rmd’
--- re-building ‘PubChemAPI.Rmd’ using rmarkdown
--- finished re-building ‘PubChemAPI.Rmd’
--- re-building ‘Unichem.Rmd’ using rmarkdown
--- finished re-building ‘Unichem.Rmd’
SUMMARY: processing the following file failed:
‘OncoTree.Rmd’
Error: Vignette re-building failed.
Execution halted
Error: Failed to install 'AnnotationGx' from GitHub:
! System command 'R' failed
Initially it asked to install 'sessioninfo'
need to explain how to annotate to other fields:
example from the gdsc pipeline
field_map <- list(
"id" = "id",
"ac" = "accession",
"sy" = "synonyms",
"misspelling" = "misspellings",
"di" = "diseases",
"ca" = "category",
"sx" = "sexOfCell",
"ag" = "ageAtSampling",
"derived-from-site" = "samplingSite"
)
fields <- names(field_map)
sampleMetadata[, paste0("cellosaurus.", fields) := {
mapped <- AnnotationGx::mapCell2Accession(
as.character(GDSC.COSMIC_ID),
from = "dr",
to = fields,
BPPARAM = BPPARAM
)
return(mapped[, 1:length(fields)])
}
Write a function to fetch annotations from OncoTree
See API - http://oncotree.mskcc.org/#/home?tab=api
query
and query:ac
columnssy
, di
to their real names synonyms
disease
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.