3
$\begingroup$

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 aPython extension for it. Also, is there any reason to use bioconductor over Biopython?

askedMay 10, 2020 at 14:40
An Ignorant Wanderer's user avatar
$\endgroup$
1
  • $\begingroup$don't quite get your question.. is there something you need to use one or the other for? The link you have uses rpy2, basically calling R from inside python.. not so easy for you to pass objects from rpy2 back into python$\endgroup$CommentedMay 10, 2020 at 17:49

3 Answers3

5
$\begingroup$

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.

answeredMay 10, 2020 at 19:15
Devon Ryan's user avatar
$\endgroup$
2
  • $\begingroup$Thanks for replying. So is there a way to work around not using R (and use Python instead) while still being able to do what Bioconductor can do? Is there an ecosystem of Python packages along with Biopython that can emulate what can be done with Bioconductor to a certain extent?$\endgroup$CommentedMay 10, 2020 at 20:13
  • 2
    $\begingroup$There is no python equivalent to Bioconductor. If you need to perform a statistical analysis you need to learn R.$\endgroup$CommentedMay 10, 2020 at 20:15
1
$\begingroup$

Recently I have done something similar for my work, I am usingsangerseqR which is s Bioconductor package in Python Environment usingrpy2

    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")
answeredAug 26, 2021 at 13:44
alex3465's user avatar
$\endgroup$
1
$\begingroup$

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 usinglibrary(plumber) and started the server on my local machine. On the Python side, I utilizedrequests to call the functions and receive responses.

I know that this solution is somewhat ugly, but it has works for me

answeredAug 10, 2023 at 8:50
Boris Gorelik's user avatar
$\endgroup$

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.