rescuedbycode
rescuedbycode
Rescued by Code!
17 posts
Rescued by Code provides a variety of resources — paid and free — that are designed to teach people to use Unix and to write code. In particular, our material is particularly aimed at those working in the biological sciences and assumes no prior knowledge. We believe that everyone can learn how to code, and that coding can be fun!
Don't wanna be here? Send us removal request.
rescuedbycode · 9 years ago
Text
Perl vs Python: Printing variables
This is part of an ongoing series of posts by Keith Bradnam and Michelle Gill that chronicle some lessons that we have learned while writing UNIX and Python to the Rescue! Keith will be discussing his experiences in switching from Perl to Python while Michelle will cover differences between Python 2 and 3.
After mastering how to print 'hello world', one of the other immediate things you want to do with any programming language is to learn about using variables…and how to print them. Let's look at a really simple example and contrast how we might do this in both Perl and Python:
# Perl my $answer = 42; print "The answer is $answer\n";
# Python answer = 42 print('The answer is', answer)
I don't think there is too much complexity with either language here. You can, of course, write a Perl solution in a similar way to Python:
# Perl v2 my $answer = 42; print "The answer is ", $answer, "\n";
The print functions of both languages allow you print a comma-separated list of items. Note how Python joins items together with a space character by default ( so no space is needed after 'is') whereas Perl doesn't. Of course, with Perl you have to include a newline unless you use the say function (see my previous post for more details).
So far, so good. But what happens when you want to increase the complexity of the print statement just a little bit?
# Perl my $max_volume = 11; my $increment = 1; print "$max_volume is $increment louder than 10\n";
# Python max_volume = 11 increment = 1 print(max_volume, 'is', increment, 'louder than 10')
Even with two variables, the Python print statement starts looking a little more ugly. This is where Perl's easy 'variable interpolation' — substituting variables for their underlying values — helps make for cleaner looking print statements.
Of course, there are other ways of printing multiple variables in Python:
# Python v2 max_volume = 11 increment = 1 print('%d is %d louder' % (max_volume, increment))
This is Python's string expression printing method and is something that appears widely in examples of 'how to print variables in Python' online. However, Python has another method of printing variables using something called a string formatting method:
# Python v3 max_volume = 11 increment = 1 print('{:d} is {:d} louder'.format(max_volume, increment))
This string formatting method is, as its name suggests, a method that is applied to a string in order to format it. The placeholders above {:d} indicate that the variable should be a digit, but we could also simplify this to just use {} instead.
It is possible that this newer technique for printing variables will fully replace the older string expression method which may become deprecated. In any case, you should be aware that there are two distinct styles that you may see in use for printing variables in Python.
Summary
This has been one area where my Perl experience led me to struggle with learning how to print variables in Python. It takes longer to learn and is confusing when you have two different ways of achieving the same goal.
Perl's style of variable interpolation would not be possible in Python because Python variables do not start with any special character that helps distinguish variable names from regular words.
1 note · View note
rescuedbycode · 9 years ago
Text
Python 2 vs 3: All Hail the Print Function
This is part of an ongoing series of posts by Keith Bradnam and Michelle Gill that chronicle some lessons that we have learned while writing UNIX and Python to the Rescue! Keith will be discussing his experiences in switching from Perl to Python while Michelle will cover differences between Python 2 and 3.
One of the more well-known changes in Python 3 is the upgrading of print from its lowly Python 2 status as a statement to a genuine, first-class function in Python 3. In most cases, this simply means a set of parentheses need to be added.
Here is an example using the print statement from Python 2:
# Python 2 uses a print statement print 'The Castle of aaarrrrggh.'
And here is the same example adapted for Python 3:
# Python 3 uses a print function print('The Castle of aaarrrrggh.')
As we will learn in “UNIX and Python to the Rescue!”, later versions1 of Python 2 have a future module that allows you import things from the future (Python 3). What's more, Python 3 code will run just fine with this import, albeit without any actual changes since Python 3 is the future. This means you can write code that is version independent using the future module.
Here is an example of the above code written in a way that is independent of Python 2 vs 3:
from __future__ import print_function # Python 2 and 3: print('The Castle of aaarrrrggh.')
Now that we understand how to update code to work with Python 3, we might want to know why this is useful. There are actually many technical reasons, but the main one is consistency with other functions. In Python 2, print was something of an outlier in that it often worked like a function, but not always. And its syntax reflected this.
For example, the following code produces an error in Python 2:
[print x for x in range(5)] # Python 2: # SyntaxError: invalid syntax
However, this will work in Python 2 (and 3) when print is an actual function:
from __future__ import print_function [print(x) for x in range(5)] # Python 2 and 3: # 0 # 1 # 2 # 3 # 4
This introduction is intended provide a basic understanding of one of the most commonly encountered differences in Python 2 vs 3 and explains why the change is—in most cases—an improvement. It's also important to understand how to write code that is independent of which Python version is being used.
The future module is implemented starting with Python 2.6. ↩︎
1 note · View note
rescuedbycode · 9 years ago
Text
Perl vs Python: the print function and newlines
This is part of an ongoing series of posts by Keith Bradnam and Michelle Gill that chronicle some lessons that we have learned while writing UNIX and Python to the Rescue! Keith will be discussing his experiences in switching from Perl to Python while Michelle will cover differences between Python 2 and 3.
When learning any programming language, the first coding example we always learn is how to write a program that will simply print the words'Hello world'. In Perl, we would use the print function as follows:
print "Hello world!\n";
Whereas in Python (version 3), we would use:
print('Hello world!')
The principle difference being that in Perl you have to explicitly include a newline character (\n) as part of the printed string whereas Python gives this to you for free. The other obvious differences are Python's requirement of parentheses (in version 3) and Perl's requirement of a semicolon.
You don't have to include \n in Perl, but without it your printed output will probably not be what you want. In version 5.10 (from 2007), Perl introduced a say() function as an alternative to print(), and this function lets you omit the newline:
say "Hello world!"; # includes newline for free!
The say() function wasn't introduced until long after I had started using Perl, and including \n in print functions is a hard habit to break when you've been using it for a decade or so.
An issue with Perl's approach is that newlines can be a bit of a confusing topic to explain to people who are new to programming. However, Perl's print() function is at least explicit…no newline character in the code, no newline in your printed output.
This raises the question…how do you not include a newline when printing in Python? The solution in Python (version 3) is to use the 'end' argument to the print() function which lets you specify what the 'end' character will be…in this case, we want to remove the default end character (\n):
print('Hello world!', end = '')
Summary
I find Perl's method for printing more explicit, even with the added cost of having to explain to a new programmer what the deal with \n is. Python's approach is more readable…until you want to omit the newline.
2 notes · View notes
rescuedbycode · 9 years ago
Text
My Python Origin Story
This is part of an ongoing series of posts by Keith Bradnam and Michelle Gill that chronicle some lessons that we have learned while writing UNIX and Python to the Rescue! Keith will be discussing his experiences in switching from Perl to Python while Michelle will cover differences between Python 2 and 3.
All superheroes need an origin story. While I don't consider myself a superhero, the title and theme of our forthcoming book, “UNIX and Python to the Rescue!” depicts one. And I think there is some truth to this depiction—learning to program is a challenging undertaking, but once you have acquired a few basic skills, you can do incredible things with your data. In that spirit, I would like to share what I call “My Python Origin Story.”
My introduction to programming came rather serendipitously during my senior year of high school. I'd finished all the math courses offered by my rural high school the previous school year. Not knowing what else to do with me, my math teacher offered to teach me how to program during his lesson planning period. The arrangement worked quite well—he'd teach me a short lesson for the first fifteen minutes of the period and then send me off to practice. I learned Pascal this way and then Advanced BASIC.
In college, I added to my growing repertoire of languages by learning FORTRAN 95 as part of the requirements for my chemical engineering major. Despite multiple opportunities, programming didn't really “stick.” Maybe I hadn't yet found a language I liked, or maybe I simply didn't have a compelling use for it.
Both of these things changed when I was a graduate student. As a structural biologist, I was constantly performing text manipulations, such as conversions between file formats and switching naming conventions for atoms in PDB files. I discovered some Perl scripts from a former labmate that facilitated a few of these tasks, so I learned Perl in order to tailor them for my own use. Programming proved to be quite handy and quickly developed into one of my favorite research tasks.
During my time as a postdoctoral researcher, I learned a new language—Python—so I could write some custom functions for a program that was popular in the lab. This coincided with a very exciting time in the Python scientific community. Numpy had been released a few years earlier and other Python scientific packages were also maturing. I learned how to perform non-linear regression using Scipy and visualize the results using Matplotlib. Python provided what I considered to be the best of both Perl and FORTRAN—powerful text processing and robust linear algebra functions 1.
Towards the end of my time as a postdoctoral researcher, I read Wes McKinney's Python for Data Analysis and learned pandas. The object-oriented nature of pandas' methods clicked with me, and I still use the library whenever possible. Despite having learned pandas some years ago, I constantly discover new ways of accomplishing common tasks 2.
Sharing this love of Python with others is one of my reasons for joining Keith and Ian in writing “UNIX and Python to the Rescue.” As work on the book has progressed, I have learned new things myself, not the least of which is finally completing my switch from Python 2 to Python 3. I look forward to sharing these lessons with you in the coming weeks.
I think this observation helps to explain some of the popularity of Python. It may not always be the best tool for the job, but it is usually a very good one. ↩︎
Acknowledging more than one way to do things may go against the zen of python, but I say rules were meant to be broken. ↩︎
1 note · View note
rescuedbycode · 9 years ago
Text
The perils of learning a new programming language
This is part of an ongoing series of posts by Keith Bradnam and Michelle Gill that chronicle some lessons that we have learned while writing UNIX and Python to the Rescue! Keith will be discussing his experiences in switching from Perl to Python while Michelle will cover differences between Python 2 and 3.
As a kid, my first real experience with programming was of the variety:
10 PRINT "HELLO" 20 GOTO 10
At the time, my computer was a BBC Micro — yes I'm getting old — and I never really spent the time to learn much more BASIC than in the example above. I do remember learning enough to be able to disable the Escape and Break keys on the BBC Micro. This meant that we could go to our local shop that sold computers (Currys) and write annoying programs on their public computers that couldn't easily be halted.
It wasn't until much later when I was studying for my Masters degree in Bioinformatics that I really started to learn a programming language. Any bioinformatician starting out today would probably gravitate immediately to Python, perhaps with some R thrown in for good measure. However, back in 1993 — a time when the World Wide Web barely existed — the language we learnt was C++.
I have strong memories of really hating C++. Or maybe I just didn't enjoy the style of the instructor. There seemed to be so much to learn before you could do anything useful. I learnt enough to be able to help write a few programs, one of which was used to process the output from a multiple sequence alignment program. This involved a lot of text parsing which didn't seem to be a particular strength of C++ at the time.
Fast forward a couple of years and in October 1996 I started my PhD which was to look at the new world of eukaryotic genome sequence analysis (at the time there was only one complete eukaryotic genome!). On my first day I remember a lab colleague handing me a copy of Learning Perl and imploring me to 'learn this quickly'.
This was in the days of Perl version 4. I think hashes were still being called 'associative arrays' and there was very little you could do in Perl in an object-oriented fashion.
I loved Perl. It was everything that C++ wasn't. Great for working with text, not fussy whether a variable contained a single digit, a string of words, or a very long floating-point number. I also enjoyed a lot of the subtle touches of humour in the Learning Perl book. I seem to recall the die function being introduced with the following example:
die "You gravy sucking pigs"
So Perl was my first real (programming) love and I stuck with Perl for most of the next couple of decades. The danger of learning a programming language at a time when it was still evolving is that you learn some bad habits, and learn to do things in ways which will later turn out to be suboptimal.
This all brings us to today. Having co-authored a book on Perl, I am now trying to co-author a follow up which will instead focus on Python. This seems to the language of choice now for anyone starting out in bioinformatics. These days it feels wrong to think of bioinformatics as a separate discipline, it's just a set of skills which are increasingly being learnt by undergraduates of many different biological disciplines.
I am not a Python programmer. You may think this is a bit of a problem for someone trying to write a book about the Python programming language and you would be correct! So we are enlisting the assistance of someone who does know how to program in Python: step forward Michelle Gill! She will hopefully keep Ian Korf — my co-author from UNIX and Perl to the Rescue! — and myself on the correct path of Python purity.
I am in the process of learning Python to assist with the writing of this book and it struck me that it may be useful to share some of my experiences as I learn new tricks and unlearn old (Perl-based) habits. I've already had many 'Aha!' and 'what-the-what?!?' moments and I plan to write a series of short lesson as, and when, I come across issues.
2 notes · View notes
rescuedbycode · 9 years ago
Text
Lessons learned while writing a book about programming
As you probably know if you've been following this blog, we are currently writing a book about learning Python. This is intended as a follow-up to the 2012 book UNIX and Perl to the Rescue!. This new book is primarily being written by Keith Bradnam and Michelle Gill, with assistance from Ian Korf.
As we draft the chapters and excercises for this new book, we have reflected on — and sometimes even learned! — certain aspects about the Python programming language and how it compares to Perl.
We thought it might be fun and instructive to share some of these thoughts here. Over the next few months, we will take turns sharing some of these observations in short blog posts. Keith will focus on differences between Python and Perl, while Michelle will note important differences between versions 2 and 3 of Python — though our book is written with Python 3 in mind, there are still many situations where Python 2 is being actively used in computing.
We aim to bring you a new post every week or two and we will start off by providing a little bit of background about how we developed our programming skills.
Posts
The perils of learning a new programming language — Keith explains his introduction to the world of programming
My Python Origin Story — Michelle reveals her own path to becoming a programmer
Perl vs Python: the print function and newlines
Python 2 vs 3: All Hail the Print Function
Perl vs Python: printing variables
0 notes
rescuedbycode · 10 years ago
Link
A great side-by-side comparison of the differences between R and Python when trying to read some data from a CSV file and then generate plots and statistics from that data. 
0 notes
rescuedbycode · 10 years ago
Text
We are writing a new book: Unix and Python to the Rescue!
We are excited to announce today that we have agreed a contract with Cambridge University Press to write a new book about Unix and Python. Like Unix and Perl to the Rescue!, we will be primarily aiming this book at people from the life-sciences, but we believe that it will be useful to an even wider audience of anyone who is interested in learning to use powerful tools that can help you slice and dice large, complex datasets.
We also intend for this book to fulfill many of the same goals that we had for our earlier book:
Contain basic material that introduces Unix & Python to someone who has never sat down at a terminal or written a line of code before.
Include many advanced programming concepts in addition to the basics.
Where possible, only introduce one new concept at a time.
Write in a lively, engaging style in order to make the concepts fun!
For this new endeavor we have recruited the many talents of Michelle Gill (@modernscientist) who will bring her Python skills and all-round coding expertise to the project. Michelle is a scientist at the National Cancer Institute and has been using Python to analyze research data — and also using it for fun — for most of the last decade. You can find out more about Michelle, and see examples of her coding expertise on her excellent blog, themodernscientist,
Because this site is no longer just about ‘Unix and Perl’, we have had a bit of a makeover. This new site, rescuedbycode.com, replaces unixandperl.com (which will now redirect visitors here). We have also changed our twitter account to @rescuedbycode. All of the old Unix and Perl material will remain here, and as we continue to write the book we plan to write some more general blog posts about the differences between Python and Perl, as well as other topics of interest.
Provisionally, we aim to have finished the book by early 2016…but you know what they say about deadlines.
1 note · View note
rescuedbycode · 10 years ago
Text
Free command-line Linux bootcamp now available
I recently rewrote some of the material from the Unix and Perl Primer for Biologists, and made it a light-weight bootcamp that is especially suited for learning command-line skills on the Linux platform. The examples were all rewritten from the point of view of someone using Ubuntu Linux, and unlike the Primer, no additional files are needed other than the documentation:
Command-line Linux Bootcamp
0 notes
rescuedbycode · 12 years ago
Text
How good is our Unix & Perl material? Good enough to get you a job in bioinformatics!
We recently heard from someone who thanked us for providing our free Unix and Perl Primer for Biologists. It literally helped him get a job in bioinformatics:
I have recently been hired as a Bioinformatics Support Specialist for the University of Maryland...I'd like to thank you for the UNIX and Perl primer. Without that I wouldn't have the job I'm in today.
Thanks for the kind words. If you can get a bioinformatics job based on the skills you acquire from our free primer, just think what could happen if you buy our book as well :-)
1 note · View note
rescuedbycode · 12 years ago
Text
New Editorial Reviews on Amazon
Just noticed that the Amazon page for our book now has a separate section for Editorial reviews, and various people have had some nice things to say about our book:
Review "My chief regret about this book is that it wasn't available last year, when I was working with a group of life-science researchers. I could have persuaded them all to purchase a copy, thereby saving myself a great deal of the time I spent assisting with their data analysis tasks!"
G. K. Jenkins, Computing Reviews
"With their book on UNIX and Perl, scientists Bradnam and Korf have come to the aid of laboratory or field researchers floundering helplessly under overwhelming gigabytes of unstructured raw data. With a characteristic charming and chipper cheerfulness, the book quickly guides the readers through finding/installing a UNIX system of any variety... Highly recommended."
F.E.J. Linton, emeritus, Wesleyan University, Choice Magazine
"Unix and Perl to the Rescue! is a book I highly recommend for all those students, post-docs, and academics who are scared of programming but can benefit immensely from the power of Unix and scripting languages. It's time to come out of your shell." 
Dr MD Sharma, Genetics Society News
"Bradnam and Korf provide an intuitive and enjoyable volume that shows how to make the terminal window useful to scientists looking to build automation into data queries using UNIX and Perl scripting. With a thorough treatment of more than just the basics, this book fills a missing niche in the Perl and UNIX world with a focus on data processing. The authors have crafted a brilliant treatment of pattern searching with regular expressions to help the reader unleash some of the most powerful parts of the Perl programming language. For scientists looking to parse data files and extract the essential pieces this is a thorough and well explained complete with sprinkles of humor and biologically motivated examples." 
Jason Stajich, University of California, Riverside
1 note · View note
rescuedbycode · 12 years ago
Text
The UK Genetics Society reviews our book
The UK Genetics Society has published a review of our book in their newsletter:
Genetics Society News - January 2013
Are you a budding (or experienced) scientist, overwhelmed by mountains of data, and do not know where to start? Are you wondering if Unix with a scripting language could be the tool-set you need but are afraid to explore the world of programming for the first time? Well, then ‘Unix and Perl to the Rescue! A field guide for the Life Sciences (and other data-rich pursuits)’ is a great place to start.
The book makes no assumptions about prior knowledge and gently guides you through key concepts — one a t a time. Some may find the pace slow to begin with, but then, as the authors say, learning to program is a journey and it takes time and effort. I have been programming for about 16 years now and have recently started harnessing the power of Unix, Perl, Python etc. in the field of bioinformatics and I have to say that this book was a pure pleasure to read.
The book is divided into seven parts and if you chose to read them in sequence, they will help you make a transition from a computer user to a programmer. However, if you are inclined to take a plunge and would rather read ahead, for example leaping to the fundamental of Perl or advanced Unix, then you can easily do so without losing context. All chapters are easy to read with a touch of light humor that makes learning the dark art of programming fun (e.g. you might need to read this section over and over again…De bug is in de computer…and several others).
Every section has brief code snippets supplemented with explanations and the advanced chapters have example problems to work through as well. 
Examples with biological relevance are lacking until you get to the more advanced sections, however, this is by design. If you have had no prior experience in either programming or Unix, I strongly recommend bookmarking the companion website. This book, together with the content on the companion website and the Unix & Perl Primer written by this books authors will undoubtedly help you learn the basics of Unix and Perl, irrespective of your background.
Note that this book is exactly what it says on the cover — a field guide, so do not expect answers to all your questions. If you know the basics, have read this book, and are stuck trying to find programming examples relevant to your datasets, or if you would like to simply venture beyond what this book covers, then complement your programming experience with Beginning Perl for Bioinformatics (James Tinsdall) and Python for Bioinformatics (Sebastien Bassi).
‘Unix and Perl to the Rescue!’ is a book I highly recommend for all those students, post-docs, and academics who are scared of programming but can benefit immensely from the power of Unix and scripting languages. It’s time to come out of your shell. Dr MD Sharma
0 notes
rescuedbycode · 12 years ago
Text
A thoughtful review of our book by Computer Reviews
We have had a thoughtful review from Computing Reviews. An account or subscription is required to read the review on their site, but we have reproduced it here:
Date Reviewed: Dec 20 2012
This is an expanded version of the authors’ publication Unix and Perl primer for biologists, used for a course delivered by them at UC Davis, and available freely on the Web.
As noted in the book’s introduction, the size of raw output files from biological (and other) research projects is increasing at an alarming rate, and the analysis of such files requires an easy-to-use language such as Perl. Perl is available for most platforms, and is usually available by default on Unix/Linux platforms.
The second part, on installing Unix and Perl, explains that a version of Unix is used in most modern Apple Mac machines, and the screen shots later in the book appear to have been generated on such a machine. Some suggestions are offered for the installation of Linux and Perl on machines that don’t have them; these include dual-boot, virtualization, and Cygwin arrangements.
Part 3, “Essential Unix,” introduces a basic set of commands with which users can create, save, and edit Perl and other files. The authors suggest using the nano editor and show how aliases can be created and sourced at login time. Permissions, shells, and paths are discussed and readers are guided through the creation of a simple shell script. I’ve found that a number of life-science researchers actually use Windows desktops and laptops to access and process data held on remote Linux servers. It would be useful if some details were provided about installing a utility like PuTTY for logging on to remote machines. The fourth part, ”Essential Perl,” contains the real meat of the book. Think 
“Perl for Dummies” in a DNA context. The authors have included many really good examples, with somewhat-less-than-subtle hints (“Always, always, always include ‘use warnings’ in your Perl scripts!”) sprinkled throughout. Readers are led progressively through scalar assignments, conditional statements, string handling, arrays and hashes, loops, and subroutines. In Part 5, the reader is introduced to advanced Unix. Here, one can learn how to use the grep utility for extracting lines from FASTA files, and the sed and cut utilities for processing GFF files. The authors also give an all-too-brief summary of awk capabilities, and show how the tr utility can be used to rectify line-end character discrepancies in files received from a foreign system.
Topics dealt with in the next part, “Advanced Perl,” include more advanced regular expressions, modules, garbage-collection considerations, object-oriented-programming, command-line option processing, and the Comprehensive Perl Archive Network (CPAN) repository. There are also some quite detailed examples about two-dimensional arrays, references, and arrays of hashes. I have to confess that this sort of thing confuses me, but at least I now know where to look for examples.
The final part takes up programming topics, and it is actually a grab bag of really useful material. Debugging strategies are illustrated, and there’s a nice table of common error messages with corresponding likely causes. Code beautification is discussed, and there’s a section on data management in which persistent hashes are explained, along with Extensible Markup Language (XML) and SQL database access mechanisms.
The authors emphasize the importance of documentation, with the comment: “We don’t care if you lie, cheat or steal. We do care if you don’t document code!” They also include a whole section about what they term “other people’s data,” or OPD, with the succinct mantra: “Never trust OPD … always examine it!”
The book ends with an appendix with solutions to some of the problems posed in Parts 3 and 4.
My chief regret about this book is that it wasn’t available last year, when I was working with a group of life-science researchers. I could have persuaded them all to purchase a copy, thereby saving myself a great deal of the time I spent assisting with their data analysis tasks!
Reviewer:  G. K. Jenkins
0 notes
rescuedbycode · 12 years ago
Text
Several reviews of our book have appeared on Amazon
At the time of writing we have had 9 reviews of our book on Amazon.com, and 1 review on Amazon.co.uk. These reviews have been very pleasing to read and those 10 reviews give us an average rating of 4.2 stars.
Here are some choice snippets from the reviews:
"Well worth the money" (link)
"Verdict? Recommended for beginners who know nothing about Unix and Perl" (link)
"I am very happy with it. The writing is clear and to the point" (link)
"Great place to begin if desiring to use these tools for data organization"(link)
"I’ve been programming for around 15 years now (Basic, C++, Java, Perl, and R), and this book is as good an introduction as any I’ve seen" (link)
Our favorite review however, comes from someone who really seemed to grasp what our book is all about. Here is his review in full:
Witty, wry, elegant and excellent, January 14, 2013
I normally take a dim view of authors of technical books who try to be humorists. On the whole, I think they fail, and there are a number of, for example, Photoshop book authors who I won’t bother with because they think they’re comedians - and they’re not.
So here we have Keith Bradnam and Ian Korf expounding on two of the driest subjects known to humankind, Unix and Perl, and they actually are witty, engaging, entertaining and, best of all, educational. (Of course, if you are into Unix and Perl, you know they’re really kind of exciting: but this book isn’t written for us. It’s for total beginners.)
This book does not pretend to be anything more than what the authors declare it to be: a basic (very basic, in fact) introduction to Unix and Perl for “the life sciences (and other data-rich pursuits)”.
They say they will teach you what 20 Unix commands are and do - and that is precisely what they do. If you know Unix or Linux, you know they are very rich Operating Systems and have hundreds of functions and operators and thousands of variants. But the 20 Bradnam and Korf tutor the reader in are all you need to get going in Unix and Linux.
Everything is in bite-sized chunks which bear a faint resemblance to chapters. The authors’ wry wit permeates every page and, miraculously, they are actually funny and use their humor to drive their teaching. Well done! The Perl section will not please those who have already passed through the fires of learning Perl. There are almost as many books on Perl programming as there are about Napoleon - and this volume does not try to compete with the classics of the Perl language.
Rather it presumes the reader knows literally nothing about Perl and is motivated by the desire to escape enslavement by spreadsheet as they try to analyze mountains of data.
The authors set out to teach basic data analysis using Perl: they are not showing you how to parse a genome. They demonstrate the very basics of using Perl and make no secret that you are on your own in tackling larger projects.
This is a book for non-programmers, for neophytes, a stress-fee introduction into the scary world of programming. And it does the job well. The authors’ wry wit goes along way into making Unix and Perl (or at least the very basics of the two) easily accessible. Mssrs. Bradnam and Korf have done an excellent job here.
0 notes
rescuedbycode · 13 years ago
Text
First Book Review!
Manuel Corpas is an experienced bioinformatician who runs a popular blog that discusses ‘Genomes, Web 2.0, and Bioethics’. He often uses the blog to discuss useful programming tips (such as converting FASTQ to FASTA).
He has kindly reviewed our book, and here a few snippets from his review:
“Unix and Perl to the Rescue is a light-hearted, compelling book that introduces key programming concepts and Unix tasks, particularly relevant to the field of Bioinformatics.”
“The chapters are easily readable, only several pages long and containing humorous puns that make the book fun to read.”
“I especially recommend this book for any bioinformatics student coming from a Biology background.”
1 note · View note
rescuedbycode · 13 years ago
Quote
An intuitive and enjoyable volume that shows how to make the terminal window useful to scientists looking to build automation into data queries using Unix and Perl scripting. With a thorough treatment of more than just the basics, this book fills a missing niche in the Perl and Unix world with a focus on data processing. The authors have crafted a brilliant treatment of pattern searching with regular expressions to help the reader unleash some of the most powerful parts of the the Perl programming language. For scientists looking to parse data files and extract the essential pieces this is thorough and well explained, complete with sprinkles of humor and biologically motivated examples.
Jason Stajich, University of California, Riverside
0 notes
rescuedbycode · 13 years ago
Text
New version of free 'Unix & Perl Primer for Biologists' available
As our book is just about ready to be published (finally the long wait is almost over), I've taken the time to give our free 'Unix & Perl Primer for Biologists' an overhaul. You can download this extensive (175 pages!) primer from our lab website:
http://korflab.ucdavis.edu/Unix_and_Perl/
New features in v3.0 include:
Whole document now written in Markdown and MultiMarkDown and exported to HTML and PDF (and text)
Many more hyperlinks added (to external sources and to internal sections within the document)
All known typos fixed
Many text clarifications added, sometimes adding several new paragraphs (most sections have been changed by a word or two, if not more).
Removed Smultron from Applications folder (10.5 only) and added more generalized text about other code editors
A few new (minor) code examples added to better explain some concepts
A few new jokes thrown in
Hope people find the new version useful, and please let us know if you spot any new errors.
0 notes