Has anyone used bioconductor from Python? Is there any reason I would choose to use it from R instead of Python? It seems like there is a Python extension for it. Also, is there any reason to use bioconductor over Biopython?
Bioconductor packages are R packages that can only be used directly from python via rpy2 or similar. If you've ever had reason to use rpy2 you'd probably realize quickly that while it works, it's no where near as easy as doing the same thing directly in R.
Biopython is a package for doing a number of useful things, but it can in no way come remotely close to performing even a percent of what Bioconductor packages do. That would be an impossible feat for a single python package.
import rpy2.robjects as r from rpy2.robjects.packages import importr utils = importr('utils') utils.install_packages('sangerseqR', repos="https://git.bioconductor.org/packages/sangerseqR") utils.chooseBioCmirror(ind=1) # select the first mirror in the list utils.install_packages('sangerseqR') sangerseqR = importr('sangerseqR') #now using the sangerseqR package to the read the sequcence Trace = sangerseqR.readsangerseq( file="1I1_F_P1815443_047.scf")
I had some trouble installing rpy2 because of binary incompatibility issues. To solve this problem, I took the following steps:
First, I wrote the necessary functions in R. Then, I created a straightforward REST-API using
library(plumber) and started the server on my local machine. On the Python side, I utilized
requests to call the functions and receive responses.
I know that this solution is somewhat ugly, but it has works for me