Coder Social home page Coder Social logo

bhklab / annotationgx Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 1.0 16.32 MB

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

R 98.14% Dockerfile 0.73% CSS 1.12%

annotationgx's People

Contributors

christophereeles avatar jjjermiah avatar shahzadashameelfarooq avatar sisiranair avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

annotationgx's Issues

Handle mapping to properties with a bad CID

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

Create chembl vignette

Basic functionality implemented, create vignette with the example.

Add the annotation step in a pipeline?

bug: error in one of the CAS annotations

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

Too many queries issue

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.>

Zenodo API

  • Review Zenodo API documentation
  • Write an R wrapper function which allows data submission to Zenodo via POST request

AnnotationGx installation error

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'

vignettes(cellosaurus): describe annotation steps

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)])
    }
    

feature: mapCellosaurus functions

  1. add parameter in function call to not return the query and query:ac columns
  • Validate that data.table assignment operations to fields are possible and streamlined
  1. QOL feature to map the api column names i.e sy, di to their real names synonyms disease

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.