You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically I'm using reticulate in R to call your python script (similar to the 'Generate Python Code' button for the Functions table in https://www.mousemine.org/mousemine/portal.do#).
The only thing I've really changed is i) add a constrant for Gene symbols in a column of a dataframe and ii) rewrote the results iterator for reticulate. However, I get the following error:
Error: intermine.errors.WebserviceError: [Errno Internal server error] 500: 'Internal Server Error'
Code Below: library(reticulate) MouseMine_query <- function(db){ # Use the use_python() function to specify the path to your Python executable use_python("/usr/bin/python3") # Import the intermine.webservice module service <- import("intermine.webservice") # Create a Service object service_obj <- service$Service("https://www.mousemine.org/mousemine/service", token = "MY-API-TOKEN") # Create a new OntologyAnnotation query object query <- service_obj$new_query("SequenceFeature") query$add_constraint("ontologyAnnotations.ontologyTerm", "GOTerm") # Add constraints to the query object query$add_view( "primaryIdentifier", "symbol", "name", "mgiType", "ontologyAnnotations.ontologyTerm.namespace", "ontologyAnnotations.qualifier", "ontologyAnnotations.ontologyTerm.identifier", "ontologyAnnotations.ontologyTerm.name", "ontologyAnnotations.evidence.code.code", "ontologyAnnotations.evidence.withText", "ontologyAnnotations.evidence.publications.mgiJnum", "ontologyAnnotations.evidence.publications.pubMedId", "ontologyAnnotations.evidence.publications.citation", "ontologyAnnotations.evidence.comments.type", "ontologyAnnotations.evidence.comments.description" ) query$add_constraint("ontologyAnnotations.dataSets.name", "=", "GOTerm to Mouse Feature Annotations from MGI", code = "B") query$add_constraint("organism.taxonId", "=", "10090", code = "D") query$add_constraint("SequenceFeature", "IN", "link_1", code = "C") query$add_constraint("symbol", "ONE OF", db$Gene.Symbol, code = "E") query$outerjoin("ontologyAnnotations.evidence.comments") # Execute the query and print the results results <- query$results() res_ontology <- reticulate::iterate(results) return(res_ontology) } onto <- MouseMine_query(sifted_just_C3H_HEH)
The text was updated successfully, but these errors were encountered:
Hi Devs,
Basically I'm using reticulate in R to call your python script (similar to the 'Generate Python Code' button for the Functions table in
https://www.mousemine.org/mousemine/portal.do#).
The only thing I've really changed is i) add a constrant for Gene symbols in a column of a dataframe and ii) rewrote the results iterator for reticulate. However, I get the following error:
Error: intermine.errors.WebserviceError: [Errno Internal server error] 500: 'Internal Server Error'
Code Below:
library(reticulate)
MouseMine_query <- function(db){
# Use the use_python() function to specify the path to your Python executable
use_python("/usr/bin/python3")
# Import the intermine.webservice module
service <- import("intermine.webservice")
# Create a Service object
service_obj <- service$Service("https://www.mousemine.org/mousemine/service", token = "MY-API-TOKEN")
# Create a new OntologyAnnotation query object
query <- service_obj$new_query("SequenceFeature")
query$add_constraint("ontologyAnnotations.ontologyTerm", "GOTerm")
# Add constraints to the query object
query$add_view( "primaryIdentifier", "symbol", "name", "mgiType", "ontologyAnnotations.ontologyTerm.namespace", "ontologyAnnotations.qualifier", "ontologyAnnotations.ontologyTerm.identifier", "ontologyAnnotations.ontologyTerm.name", "ontologyAnnotations.evidence.code.code", "ontologyAnnotations.evidence.withText", "ontologyAnnotations.evidence.publications.mgiJnum", "ontologyAnnotations.evidence.publications.pubMedId", "ontologyAnnotations.evidence.publications.citation", "ontologyAnnotations.evidence.comments.type", "ontologyAnnotations.evidence.comments.description" )
query$add_constraint("ontologyAnnotations.dataSets.name", "=", "GOTerm to Mouse Feature Annotations from MGI", code = "B")
query$add_constraint("organism.taxonId", "=", "10090", code = "D")
query$add_constraint("SequenceFeature", "IN", "link_1", code = "C")
query$add_constraint("symbol", "ONE OF", db$Gene.Symbol, code = "E")
query$outerjoin("ontologyAnnotations.evidence.comments")
# Execute the query and print the results
results <- query$results()
res_ontology <- reticulate::iterate(results)
return(res_ontology)
}
onto <- MouseMine_query(sifted_just_C3H_HEH)
The text was updated successfully, but these errors were encountered: