Entering edit mode
3.1 years ago
accibio
▴
20
Is there a way to incorporate online BLAST search using an R script which takes FASTA sequences as input and returns the BLAST hits?
Why do you wish to automate a web crawl on BLAST when blast has a command line utility with online search enabled?
I'm trying to develop an R package for extracting annotations for proteins based on results from BLAST searches. So I need to incorporate BLAST inside the R package.
Why not take BLAST results as input instead? Why not accept a FASTA file instead of a sequence? Use R for data processing, not reinventing the wheel on existing processes. For example, while an R package to parse BAM files is useful, an R package to call variants from BAM is not - not everything needs to be re-implemented in every language.
Maybe this helps https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/system2 or this https://www.r-bloggers.com/2020/01/working-with-windows-cmd-system-commands-in-r/
metablastr
is probably what you're looking for. Or you could try using theBLAST
API.I agree with Ram though. You're probably better off telling your users to do their own sequence searches, and just bring your package the output in a standardized format (which you can prescribe). Especially if you're just going to end up telling them to run
BLAST
locally (in which case you should be telling them to useMMseqs2
at this point because it's faster and lightweight).Check this R package (https://github.com/gschofl/blastr and https://rdrr.io/github/gschofl/blastr/man/). It looks like BLAST with R. But I failed to find any tutorials about this package.
It's possible with SequenceServer. We've made examples for blasting from within python. And for remote blasting in the unix command-line.
The same concept (i.e. server-side API) should be accessible from R too. But we have yet to make example code.