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

Suggestion: Wrapper function to run Annotator on larger datasets #37

Open
iainmwallace opened this issue Jul 7, 2017 · 2 comments
Open

Comments

@iainmwallace
Copy link

Hi,

It would be useful to have a wrapper function for Annotator for when the list of ids is >500. Ideally it would run the queries in parallel.

Cheers,

Iain

@iainmwallace
Copy link
Author

This is the best that I could come up with ---

x<-split(my_ids, ceiling(seq_along(my_ids)/500))

annotate_data<-function(my_id_subset,full_data,my_fields){
mini_dataset<-full_data%>%filter(id%in%my_id_subset)
annotated_dataset<-Annotator.annotate(mini_dataset,my_fields)%>%as_tibble() # annotation should return lists
return(annotated_dataset)
}

y<-pblapply(x,annotate_data,a,fields)%>%bind_rows()

@davecap
Copy link
Member

davecap commented Jul 7, 2017

Not bad! We actually do something similar in the Python client: https://github.com/solvebio/solvebio-python/blob/master/solvebio/annotate.py#L33

Shouldn't be too hard to get it integrated in the R client.

@davecap davecap modified the milestone: v2.0.1 Release Aug 5, 2017
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