Forum:Programming Language In Bioinformatics
8
1
Entering edit mode
11.6 years ago
AndreiR ▴ 260

I understand that each programming language has its advantages and disadvantages. Had some experience on python and perl. I start reading about ruby, bioruby and different questions come to my mind. Away from personal preferences, regarding syntax for example, what should guide the choice for python, perl, ruby or other languages? Are there true advantages of one language instead of other?

perl python • 8.3k views
ADD COMMENT
2
Entering edit mode

I think you can find a lot of comparisons on Internet. If you don't know any of the language and want to learn one especially for bioinformatics then either of perl or python are great. This way you should be able to use BioPython and BioPerl. I have never used Ruby and don't know anything about BioRuby. It could be great too but I have never used it. I have coded both in Perl and Python and personally I believe Python would be quick to learn.

ADD REPLY
3
Entering edit mode

This type of question is already covered copiously On The Internet, and is entirely about personal preference. The answer should be "the best programming languages are the a) the one you know today plus b) the three or four you will learn in the next several years as your projects and skills expand." I started with R, since at the time I needed stats and making figures and then microarray analysis. I looked at Python, have used it for some projects but overall prefer Perl due to its syntax, CPAN, web frameworks, and also user community -- but that is really entirely personal and subjective. What are your mentors using? What are your friends using? What are they not using? Try to learn something from all of them.

ADD REPLY
0
Entering edit mode

Thank you for the answer Alex. Indeed, this question is exhaustively discussed. My point was about performance, memory management, "small" and "fast" coding. Maybe something about cost and benefit. In the end, as you put it, personal and subjective impressions may lead the choice. :)

ADD REPLY
0
Entering edit mode

I am absolutely zero in python, I want to learn then I installed Pycharm, now you think I better start with a book like " Learning to Program Using Python by Cody Jackson" or suggested weblogs in biostars-googling????

Thank you

ADD REPLY
1
Entering edit mode

PyCharm is a great development environment, but yes it won't teach you Python. There are probably dozens, if not hundreds, of online courses you can do for free to learn Python. Depending on what you want to do you'll even find some geared towards Data Science type analyses versus standard things. Coursera, EdX, CodeAcademy, etc. Definitely where you want to go versus a book.

ADD REPLY
0
Entering edit mode

Hello, I installed python package for my python3.5 I used his commands: -m pip install biopython pip install biopython pip install biopython --upgrade pip install biopython --user but still the same message is displayed ImportError: No module named 'Bio' please that what i should do

ADD REPLY
1
Entering edit mode

Please don't ask question in unrelated threads. Open a new one after browsing the web for existing solutions and if you do provide full code. THis one here is lacking the part where you try to load then package.

ADD REPLY
6
Entering edit mode
11.5 years ago
Gabriel R. ★ 2.9k

A picture is worth a 1000 words :https://ibb.co/ciyRnQ

ADD COMMENT
4
Entering edit mode
11.5 years ago
DG 7.3k

While it has been covered several times, and ultimately comes down mostly to personal preferences, I think these are worth having from time to time as people update (and languages too). I've become a python convert. I learned programming initially in C and later added Java and Perl. When I started grad school I was coding pretty much exclusively in Perl with one project that I inherited in Python as there was existing legacy code. I stuck mostly with Perl throughout my PhD but started using Python more often. After starting my post-doc I decided to try doing much of my work in Python instead of Perl and absolutely fell in love with it for genomics.

Perl is still superior for arbitrary text parsing. I find it much less cumbersome when it comes to regular expressions for instance. But Python has so many great libraries for handling delimited-file types, defaultdict is powerful, and it has lots of great genomics libraries that are truly object oriented compared to Perl.

Basically between PyVCF, PyBedTools, the csv package, defaultdict, and IntervalTree I can do some really powerful analyses with Python in a really efficient manner compared to Perl.

ADD COMMENT
2
Entering edit mode
11.5 years ago
AndreiR ▴ 260

One comparison of perl python and ruby

http://jimhester.calepin.co/perl-vs-python-vs-ruby-restriction-enzyme-regular-expression-performance.html

And a paper "A comparison of common programming languages used in bioinformatics" Mathieu Fourment* and Michael R Gillings

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2267699/pdf/1471-2105-9-82.pdf

And a comparison regarding "mainly: loops, dynamic arrays with numbers, basic math operations."

http://blog.famzah.net/2010/07/01/cpp-vs-python-vs-perl-vs-php-performance-benchmark/

ADD COMMENT
2
Entering edit mode

I don't have much experience in programming (I am just starting with bash), so no bias from me. And in http://jimhester.calepin.co blog post ruby seems to be the cleanest and most human readable language compared to python or perl, is it?

ADD REPLY
1
Entering edit mode

I'm not sure I would consider parsing of RE cutsites a common task these days in Bioinformatics. But Regular expressions are, IMHO, a weakness of python. If I need to do a lot of parsing of that sort I will tend to go towards perl. Not having to compile regular expressions makes it much more clean (and fast). That said a lot of routine regular expression type stuff can be handled very quickly in Python. startswith() and endswith(), contains(), etc are all pretty powerful.

With genomics work I am finding I deal mostly with delimited file types anyway, which makes things a lot easier. If there is a header it also makes it much more intuitive to parse large files line by line in an object-oriented fashion with things like the csv and DictReader/DictWriter modules.

ADD REPLY
1
Entering edit mode
11.5 years ago
Samuel Lampa ★ 1.3k

This comparison, on doing a typical bioinformatics task (calculating GC content) in a bunch of different languages, might give you some pointers: http://saml.rilspace.org/moar-languagez-gc-content-in-python-d-fpc-c-and-c

If you click the language names in the list under the graphs, you can see code examples, to get an idea of code readability.

As you can see, python, by using PyPy, does a very good job and is comparable to compiled languages. If you want slightly better performance still, while wanting to keep code compact and readable, D would be my next bet. (Compare code: Python, and D).

ADD COMMENT
0
Entering edit mode
ADD COMMENT
0
Entering edit mode
11.5 years ago
Pappu ★ 2.1k

Python is #1 in the market now!

ADD COMMENT
0
Entering edit mode
11.5 years ago
Woa ★ 2.9k

How about this? Do you people think it'll mark its presence soon in the field of Bioinformatics? http://julialang.org/

ADD COMMENT
2
Entering edit mode

Doubtful. It looks interesting but you need a certain level of language maturity to start to get broad adoption within any field of science. The existence of libraries for common (and difficult) tasks is what currently makes or breaks a language I think. If a new language offers substantial improvement, particularly in data processing speed or how well it matches how we want to conceptualized a particular task, it may be worth the effort of a small community building up those libraries.

ADD REPLY
0
Entering edit mode

I don't have any idea but is this the same reason for the language "D" didn't become that popular? http://en.wikipedia.org/wiki/D_%28programming_language%29

ADD REPLY

Login before adding your answer.

Traffic: 2093 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6