Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in map(): ℹ In index: 1. Caused by error in map(): ℹ In index: 1. Caused by error in x$searchTerm: ! $ operator is invalid for atomic vectors Run rlang::last_trace() to see where the error occurred. #7

Open
Super-dong94 opened this issue Jul 24, 2024 · 2 comments

Comments

@Super-dong94
Copy link

CTSgetR(id = "n-[2-(6-amino-9h-purin-9-yl)ethyl]-n-(2-furylmethyl)amine",
from = "Chemical Name",
to = "KEGG",
db_name ='ctsgetr.sqlite')

Error in map():
ℹ In index: 1.
Caused by error in map():
ℹ In index: 1.
Caused by error in x$searchTerm:
! $ operator is invalid for atomic vectors
Run rlang::last_trace() to see where the error occurred.
Warning messages:
1: Factors converted to character
2: Factors converted to character

@dgrapov
Copy link
Owner

dgrapov commented Jul 27, 2024

The issue was the url encoding, which is now fixed.

CTSgetR(id = "n-[2-(6-amino-9h-purin-9-yl)ethyl]-n-(2-furylmethyl)amine",
        from = "Chemical Name",
        to = "KEGG",
        db_name ='ctsgetr.sqlite')
#returns
id KEGG
1 n-[2-(6-amino-9h-purin-9-yl)ethyl]-n-(2-furylmethyl)amine <NA>

Note the backend workflow is to first get the InChIKey and then translate to KEGG

CTSgetR(id = "n-[2-(6-amino-9h-purin-9-yl)ethyl]-n-(2-furylmethyl)amine",
        from = "Chemical Name",
        to = "InChIKey",
        db_name ='ctsgetr.sqlite')

CTSgetR(id = 'OPXOUINPZODWMA-UHFFFAOYSA-N',
        to = "KEGG",
        from = "InChIKey",
        db_name ='ctsgetr.sqlite')
                           id KEGG
1 OPXOUINPZODWMA-UHFFFAOYSA-N <NA>

There is no KEGG entry for this entity in CTS e.g.

 curl 'cts.fiehnlab.ucdavis.edu/rest/score/Chemical%20Name/n-%5B2-%286-amino-9h-purin-9-yl%29ethyl%5D-n-%282-furylmethyl%29amine/biological'
#returns
{"searchTerm":"n-[2-(6-amino-9h-purin-9-yl)ethyl]-n-(2-furylmethyl)amine","from":"Chemical Name","result":[{"InChIKey":"OPXOUINPZODWMA-UHFFFAOYSA-N","score":0.0}]}

@Super-dong94
Copy link
Author

Thank you very much for your reply, I have updated CTSgetr. But there are still some errors.

CTSgetR(id = "sm 8:1;2o/32:0",

  •     from = "Chemical Name",
    
  •     to = "KEGG",
    
  •     db_name='ctsgetr.sqlite')
    

Error in map():
ℹ In index: 1.
Caused by error in map():
ℹ In index: 1.
Caused by error in x$searchTerm:
! $ operator is invalid for atomic vectors
Run rlang::last_trace() to see where the error occurred.
Warning message:
Factors converted to character

CTSgetR(id = "(+/-)12(13)-dihome",

  •     from = "Chemical Name",
    
  •     to = "KEGG",
    
  •     db_name='ctsgetr.sqlite')
    

Error in map():
ℹ In index: 1.
Caused by error in map():
ℹ In index: 1.
Caused by error in x$searchTerm:
! $ operator is invalid for atomic vectors
Run rlang::last_trace() to see where the error occurred.
Warning message:
Factors converted to character

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants