Forum: Python or R
0
gravatar for Qingyang Xiao
10 months ago by
Qingyang Xiao130
Stockholm
Qingyang Xiao130 wrote:

Generally speaking, which programming language is better, R and Python? Personally, I used Unix system in supercomputers plus R in my laptop and I didn't find much uncomfortable stuff. For RNA-Seq, from fastq files to differentially expressed gene data and from DE to pathway/co-expression network.

So overall, what's the advantage of Python in these kinds of analysis?

ADD COMMENTlink modified 10 months ago by Kevin Blighe41k • written 10 months ago by Qingyang Xiao130
5

There is no "better" programming language, depends of your needs and your skills. Use the one you are confortable with.

R is generally used to compute statistical and mathematical process but also some great packages to plot your data

Python is mostly used to hundle text file management as fastq files, there is less package than R to plot your data in python (to discuss below)

My way to go in RNA-seq is to use bash to align and count. Then put the count file in R and do the statistical and plotting parts

I don't really need python on this kind of analysis.

ADD REPLYlink modified 10 months ago • written 10 months ago by Bastien Hervé3.9k
1

there is less package than R to plot your data in python

Well, about that, matplotlib, seaborn, plotly, bokeh, altair,... plenty of choices :)

ADD REPLYlink written 10 months ago by WouterDeCoster38k
2

I have to say, in future I’m going to switch to doing everything in Python I think. I used R to plot all my data, with ggplot ported to python and all the other options (especially plotly), I don’t really see as compelling a reason to use it anymore (since I don’t do much in the way of stats or modelling). Having to write 2 separate sets of code is silly really... not to mention I find R’s dataframe structure much more confusing than pandas frames or simple arrays and matrices.

ADD REPLYlink written 10 months ago by jrj.healey11k

Agree, but I was thinking about DESeq2, in a RNAseq analysis, for example. Do you know a way to use it throught python ? Maybe you could plot whatever you want with python as much as R but for statistical purpose R is still leading.

ADD REPLYlink written 10 months ago by Bastien Hervé3.9k

The community of differential expression analysis clearly chose R, and there is no way around that. R definitely is the only sensible choice here.

But for statistics in general python can do everything as well as R ;-)

ADD REPLYlink written 10 months ago by WouterDeCoster38k
1

Yeah I agree. Personally, I'd like to see a DEseq implementation or similar in pure python, but its not the end of the world to have to dip in to it for the one or two necessary analyses.

Though it probably wouldn't be that hard to write a python wrapper around the Rscript :P

ADD REPLYlink written 10 months ago by jrj.healey11k

Though it probably wouldn't be that hard to write a python wrapper around the Rscript :P

Casual reminder that we should be writing and thinking about graduating.

ADD REPLYlink written 10 months ago by WouterDeCoster38k

Shhhhh....

(My thesis doc is open on my other screen, so its all under control haha)

ADD REPLYlink written 10 months ago by jrj.healey11k
1

The one thing that I've noticed in recent years is that many languages now 'talk' to each other via libraries or wrapper functions, which is of course a good thing. HTSlib was a great thing, for example, and R has interfaces with Python and JAVA< and probably others. The one language that may still like to keep to itself, though, is Perl (correct me if wrong).

ADD REPLYlink modified 10 months ago • written 10 months ago by Kevin Blighe41k
1

See also ursalabs, developing Apache Arrow, shared data structure for (currently) C, C++, Go, Java, JavaScript, Python, Ruby and Rust.

ADD REPLYlink written 10 months ago by WouterDeCoster38k
1

Of course there are packages for that in python but I think that the pool of packages is more important and more supported in R. I'm a huge fan of python but I switch to R to visualize my data :)

ADD REPLYlink modified 10 months ago • written 10 months ago by Bastien Hervé3.9k
2

but I switch to R to visualize my data :)

Sure, whatever makes you feel comfortable :-p

ADD REPLYlink written 10 months ago by WouterDeCoster38k
2

haha, that quote. Is it supposed to sound really sarcastic "a few weeks of tinkering". HAHA

ADD REPLYlink written 10 months ago by russhh4.3k

Maybe I will give it a try for my upcoming visualization :)

ADD REPLYlink written 10 months ago by Bastien Hervé3.9k

Belgian guy?

ADD REPLYlink written 10 months ago by Kevin Blighe41k

Me ? No ! Why ? Did not get the joke if there is one :)

ADD REPLYlink written 10 months ago by Bastien Hervé3.9k

No, the Jake VanderPlas dude. With a name like yours, tu es Français

ADD REPLYlink written 10 months ago by Kevin Blighe41k
1

You replied on my comment that why I got confuse. You're correct I'm french and for this guy, his Twitter say "Seattle"

ADD REPLYlink modified 10 months ago • written 10 months ago by Bastien Hervé3.9k

On parle aussi le francais en Belgique

ADD REPLYlink written 10 months ago by WouterDeCoster38k
1

This question is pointless. It entirely depends on your application and preferences (both personal and those from the community).

Generally speaking,

So, Python vs R in general?

in these kinds of analysis?

Oh you mean for RNA-seq analysis?

If you don't know for sure what you are asking, how should we answer? :-)

ADD REPLYlink modified 10 months ago • written 10 months ago by WouterDeCoster38k

I would say python personally. I find it to be more widely used and more versatile.

ADD REPLYlink written 10 months ago by jrj.healey11k

Hi Qingyang Xiao ,

Don't forget to follow up on your questions/threads.

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Upvote|Bookmark|Accept

Please do this for your previous posts as well.

ADD REPLYlink modified 10 months ago • written 10 months ago by genomax65k

Bioinformatics has no language. It is one of these polyglot beasts like web development. You've got to pick up multiple languages to proceed. Nonetheless, if I wanted to get to diffexes and coexes quickly, I'd use R.

ADD REPLYlink written 10 months ago by russhh4.3k
1
gravatar for Kevin Blighe
10 months ago by
Kevin Blighe41k
London, England
Kevin Blighe41k wrote:

This is my 'no answer' to the forum question.

Kevin

ADD COMMENTlink written 10 months ago by Kevin Blighe41k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1180 users visited in the last hour