SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
python and NGS data markero Bioinformatics 8 05-16-2014 11:27 AM
gatk python script m_elena_bioinfo Bioinformatics 7 11-20-2011 06:40 AM
python dror Bioinformatics 0 11-29-2010 03:22 AM
Rookie's plee for advice: PERL or Python, Linux or Windows? A1_UltiMA Bioinformatics 7 11-29-2010 01:07 AM
python in ABySS dror RNA Sequencing 0 11-28-2010 05:19 AM

Reply
 
Thread Tools
Old 11-04-2011, 04:12 AM   #1
ETHANol
Senior Member
 
Location: Western Australia

Join Date: Feb 2010
Posts: 308
Default Perl or Python

I'm a molecular biologist that has gotten sucked into the world of next-generation sequencing. I'm mostly interested epigenetics related stuff like ChIP-seq, RNA-seq, RRBS-seq, 4C-seq, etc. It seems learning some perl or python could save me some time and increase my ability to answer the questions I want to answer.

Would you recommend I learn Perl or Python? Does one language have advantages over the other? Is one easier then the other to learn?
__________________
--------------
Ethan
ETHANol is offline   Reply With Quote
Old 11-04-2011, 04:43 AM   #2
lukas1848
Member
 
Location: Germany

Join Date: Jun 2011
Posts: 54
Default

If you follow this great Unix and Perl tutorial, your Perl skills should be at a good level to start with. Since I don't know of any similar script for learning Python, I'd just recommend learning Perl...

But I'd say that for RNAseq, you should definitly spend just as much time on learning R as you spend on learning Perl or Python.
lukas1848 is offline   Reply With Quote
Old 11-04-2011, 04:43 AM   #3
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 700
Default

Both are adequate and relatively easy to understand. You'll find "modules" addressing nextgen problems in both. The downsides are that they are interpreted languages and tend to struggle with the staggering volume of data in nextgen datasets ... when programs are implemented strictly in that language and not calling external modules, often written in a "lower" level language. You'll find fans (and fanboys) of both so don't be surprised if a lurid prose battle erupts below.

If I had to pick, I'd go with Python, strictly based on the comp-sci grad students I've talked with think it's "cool" and Perl stodgy ... something that hackers like me tinkered with back in the stone age: the 1990s!!! A bad reason, I know.

Personally I wish something like Affy Power Tools (which became the toolset for old school array data) would emerge for next gen and I could use any language I wanted to play with the output, like R, or Java, or C, or awk and sed and ...

That day is coming, we got part of it now: samtools.
Richard Finney is offline   Reply With Quote
Old 11-04-2011, 05:04 AM   #4
ETHANol
Senior Member
 
Location: Western Australia

Join Date: Feb 2010
Posts: 308
Default

I went through the tutorial UNIX and Perl tutorial for Biologists, which took a lot less time and was easier then I had thought. It really opened my eyes to the laborious work arounds I have implemented to address lack of programming knowledge. Before I spent more time and effort I thought I'd try to make a more informed decision on where to focus my efforts. Of course I could just go back to watching Jersey Shore before I go to sleep but that is twice as boring as the Perl tutorial.

I am aware of the fanboy issues involved but I assume there are some real differences as well.

As for R and Bioconductor, it's been kind of an off and on mostly unsuccessful project of mine. I still haven't found a good lesson plan for R. I find the vignettes from Bioconductor to be very ambiguous. But point well taken. I'll get back on R. Thanks.
__________________
--------------
Ethan
ETHANol is offline   Reply With Quote
Old 11-04-2011, 05:40 AM   #5
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 700
Default What is the state of R/bioconductor/nextgen ?

I was just thinking yesterday, "I bet those R guys have gotten around to doing something about nextgen". As many many of you know, google has become almost useless over the last 3 years, and I didn't find much. ETHANol's comments are pretty good: useless vignettes. Is there a good link to nextgen and R somewhere?
Richard Finney is offline   Reply With Quote
Old 11-04-2011, 06:53 AM   #6
damiankao
Member
 
Location: UK

Join Date: Jan 2010
Posts: 49
Default

You can probably do most of it with R. I personally prefer python to perl. I think it's easier to learn too.
damiankao is offline   Reply With Quote
Old 11-04-2011, 07:33 AM   #7
rubyb
Junior Member
 
Location: paris

Join Date: Jun 2011
Posts: 6
Default

Hi Ethanol,

I would say Python. Easier to learn, more readable & most of all object oriented (though you can do some kind of OO with perl).

DAGOBAH -- DAY
With Yoda strapped to his back, Luke climbs up one of
the many thick vines that grow in the swamp until he
reaches the Dagobah statistics lab. Panting heavily, he
continues his exercises -- grepping, installing new
packages, logging in as root, and writing replacements for
two-year-old shell scripts in Python.

YODA: Code! Yes. A programmer's strength flows from code
maintainability. But beware of Perl. Terse syntax... more
than one way to do it... default variables. The dark side
of code maintainability are they. Easily they flow, quick
to join you when code you write. If once you start down the
dark path, forever will it dominate your destiny, consume
you it will.

LUKE: Is Perl better than Python?

YODA: No... no... no. Quicker, easier, more seductive.

LUKE: But how will I know why Python is better than Perl?

YODA: You will know. When your code you try to read six months
from now.
rubyb is offline   Reply With Quote
Old 11-04-2011, 12:08 PM   #8
RDW
Member
 
Location: London

Join Date: Oct 2008
Posts: 63
Default

I'm a Perl fan, but they are both excellent languages, and which you choose is largely a matter of taste. There's a core philosophical difference, as expressed in the Perl slogan 'there's more than one way to do it' (i.e., the language often allows you to choose between multiple methods of achieving the same thing). This is seen by Perl hackers as a major advantage (the language adapts to you), but Pythonistas tend to view things differently (perhaps freedom is dangerous, if it allows you to make bad choices). But a good, disciplined programmer is going to write clear, maintainable code in either language.

You could make a pragmatic decision based on what your colleagues are using, or on the amount (and quality) of available code for your particular applications. Or you could try some tutorials and see which you prefer. I'll leave it to the Python guys to point you towards the best places to learn that language. For Perl there are quite a few places to avoid - old tutorials that teach bad habits that date back to the Perl 4 days, and will have you writing the sort of ugly code that some people imagine is standard Perl. Unfortunately, these tend to be some of the top Google hits when people are looking for tutorials! Instead, you might take a look at this:

http://onyxneon.com/books/modern_perl/
http://www.modernperlbooks.com

and get the (up to date) 6th edition of this classic book:

http://shop.oreilly.com/product/0636920018452.do

and drop in on this community:

http://www.perlmonks.org/

Last edited by RDW; 11-04-2011 at 01:10 PM. Reason: On 2nd thoughts, let's keep the links completely Modern!
RDW is offline   Reply With Quote
Old 11-04-2011, 04:21 PM   #9
adaptivegenome
Super Moderator
 
Location: US

Join Date: Nov 2009
Posts: 437
Default

I vote PERL as it is great for simple parsing tasks. Also it is incredibly simple to learn. Python is more structured and more readable but personally if I am not hacking together a quick script in PERL I usually jump straight to C/C++.
adaptivegenome is offline   Reply With Quote
Old 11-05-2011, 06:10 AM   #10
rnaseek
Member
 
Location: USA

Join Date: Nov 2011
Posts: 22
Default

Had to chime in, even though it is too late now. For beginners, Python is a better option to start off. Che out a couple of free python books available online
http://cmdlinetips.com/2011/09/free-...-books-online/
rnaseek is offline   Reply With Quote
Old 11-05-2011, 09:15 AM   #11
ETHANol
Senior Member
 
Location: Western Australia

Join Date: Feb 2010
Posts: 308
Default

Thanks everyone. Special thanks for the links to the tutorials. Most of the stuff that comes up with Google is garbage. I kind of got going with perl just because of a nice tutorial. I think the bottom line is take a look at both and see what I fall into better. But python sounds a little more organized. All I really plan on doing is pretty trivial stuff so in the end it probably doesn't matter much. But it's still nice to here some opinions.

If anyone knows a good R tutorial oriented towards biologists (or even better next gen sequencing), I'd like to know. Or really anything good. Something to help make sense of the cryptic Bioconductor packages.
__________________
--------------
Ethan
ETHANol is offline   Reply With Quote
Old 11-06-2011, 12:15 PM   #12
RDW
Member
 
Location: London

Join Date: Oct 2008
Posts: 63
Default

The Bioconductor docs tend to assume a fair bit of R knowledge, so a general tutorial/reference is probably what you need. The official Introduction to R is quite good, but pretty terse:

http://cran.r-project.org/manuals.html

For a much more comprehensive book, take a look at:

http://www.amazon.com/R-Nutshell-Des.../dp/059680170X
http://shop.oreilly.com/product/9780596801717.do

I have and like this (but note that reviewers have spotted some typos, presumably to be fixed in the 2nd edition scheduled for next April).

Here's one I can't vouch for yet, but looks like it will be my next purchase:

http://shop.oreilly.com/product/9780596809164.do
http://www.amazon.com/Cookbook-OReil...dp/0596809158/

Incidentally, some of the O'Reilly Perl, Python and R books (including 'R in a nutshell', the almost up to date 5th edition of 'Learning Perl', and the excellent 'Perl Cookbook', though not the 'R Cookbook') are available as very cheap iPhone apps, basically a proprietary reader packaged with an .epub of the text. You can buy these apps through iTunes even if you don't have an iPhone or iPad, then liberate the books as standard epubs that can be read anywhere just by unzipping the package and re-zipping the .epub content alone. This 'hack' is officially sanctioned by the publisher:

http://zef.me/3246/convert-cheap-ore...-books-to-epub
http://oreilly.com/ebooks/oreilly_iphone_tips.csp
RDW is offline   Reply With Quote
Old 11-06-2011, 03:00 PM   #13
Zigster
(Jeremy Leipzig)
 
Location: Philadelphia, PA

Join Date: May 2009
Posts: 116
Default

Quote:
Originally Posted by Richard Finney View Post
I was just thinking yesterday, "I bet those R guys have gotten around to doing something about nextgen". As many many of you know, google has become almost useless over the last 3 years, and I didn't find much. ETHANol's comments are pretty good: useless vignettes. Is there a good link to nextgen and R somewhere?
I don't know whether to laugh or cry

http://www.google.com/search?q=bioconductor+ngs
__________________
--
Jeremy Leipzig
Bioinformatics Programmer
--
My blog
Twitter
Zigster is offline   Reply With Quote
Old 11-06-2011, 04:01 PM   #14
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 700
Default

"I don't know whether to laugh or cry"

Yeah, I get that feeling whenever I type in the example of an R vignette. I can't count the number of times I've had to get the source and type in printfs to figure 'em out. Gets tedious after a while.
Richard Finney is offline   Reply With Quote
Old 11-11-2011, 07:04 AM   #15
Mark
Member
 
Location: Raleigh, NC

Join Date: Nov 2008
Posts: 48
Default

Though I am just learning python and have many years experience with perl, what I like about perl is its flexibility. Sure, certain things in python are easy if a function exists to do exactly what you want but considerably more difficult if not. Perl focuses more on the tools to concisely create your own functionality tailored to your specific needs.
Mark is offline   Reply With Quote
Old 11-11-2011, 07:12 AM   #16
damiankao
Member
 
Location: UK

Join Date: Jan 2010
Posts: 49
Default

Quote:
Originally Posted by Mark View Post
Though I am just learning python and have many years experience with perl, what I like about perl is its flexibility. Sure, certain things in python are easy if a function exists to do exactly what you want but considerably more difficult if not. Perl focuses more on the tools to concisely create your own functionality tailored to your specific needs.
There are a lot more resources and tools for perl than python. But I don't think there is anything inherently special about perl that makes it easier to develop tools or tailor code your own functions compared to python. It all comes down to what language you know better at the end of the day I think.
damiankao is offline   Reply With Quote
Old 11-11-2011, 08:12 AM   #17
jbrwn
Member
 
Location: Denver, CO

Join Date: Mar 2011
Posts: 37
Default

after re-reading some of perl scripts i lost hope for it and switched to python. i started with this:
Learn Python The Hard Way
jbrwn is offline   Reply With Quote
Old 11-12-2011, 07:11 AM   #18
gringer
David Eccles (gringer)
 
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 836
Default

I think 'learning the hard way' would mean that every copy-paste example in the book had one error in it. That would teach you fairly quickly about debugging -- one of the hardest things to learn in programming (and the most valuable).
gringer is offline   Reply With Quote
Old 08-26-2019, 09:33 PM   #19
savitawanjale
Junior Member
 
Location: India

Join Date: Aug 2019
Posts: 1
Default

Excellent thread! Helpful for me. Keep up!
savitawanjale is offline   Reply With Quote
Old 08-29-2019, 04:30 AM   #20
sklages
Senior Member
 
Location: Berlin, DE

Join Date: May 2008
Posts: 628
Default

Quote:
Originally Posted by savitawanjale View Post
Excellent thread! Helpful for me. Keep up!
Man, this thread is 8 years old ..
sklages is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 10:08 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO