UNIX and Perl to the Rescue! : A Field Guide for the Life Sciences (and Other Data-rich Pursuits)
Your research has generated gigabytes of data and now you need to analyse it. You hate using spreadsheets but it is all you know, so what else can you do? This book will transform how you work with large and complex data sets, teaching you powerful programming tools for slicing and dicing data to suit your needs. Written in a fun and accessible style, this step-by-step guide will inspire and inform non-programmers about the essential aspects of Unix and Perl. It shows how, with just a little programming knowledge, you can write programs that could save you hours, or even days. No prior experience is required and new concepts are introduced using numerous code examples that you can try out for yourself. Going beyond the basics, the authors touch upon many broader topics that will help those new to programming, including debugging and how to write in a good programming style.
- Electronic book text
- CAMBRIDGE UNIVERSITY PRESS
- Cambridge University Press (Virtual Publishing)
- Cambridge, United Kingdom
- 5 b/w illus.
Table of contents
Part I. Introduction and Background: 1. Introduction; 2. How to use this book; Part II. Installing Unix and Perl: 3. What do I need in order to learn Unix and Perl?; 4. Installing Linux on a PC; 5. Installing a code editor; Part III. Essential Unix: 6. Introduction to Unix; 7. The Unix terminal; 8. The Unix command prompt; 9. Your first Unix command; 10. The hierarchy of a Unix file system; 11. Finding out where you are in the filesystem; 12. How to navigate a Unix filesystem; 13. Absolute and relative paths; 14. Working with your home directory; 15. The Unix shell; 16. Environment variables; 17. Introduction to command-line options; 18. Main pages; 19. Working with directories; 20. The importance of saving keystrokes; 21. Moving and renaming files; 22. Moving and renaming directories; 23. How to remove files; 24. How to copy files and directories; 25. Working with text files; 26. Introduction to aliases; 27. Editing text files; 28. Automating Unix commands; 29. How to hide files and find hidden files; 30. Creating a configuration file; 31. Programming with Unix; 32. Unix file permissions; 33. How to specify which directories contain programs; 34. Creating useful shell scripts; 35. Unix summary; Part IV. Essential Perl: 36. Hello world; 37. Scalar variables; 38. Use warnings; 39. Maths and functions; 40. Perl vs perl; 41. Conditional statements; 42. Use strict; 43. Stopping programs; 44. Working with strings; 45. Dealing with special characters; 46. Matching operators; 47. The transliteration operator; 48. List context; 49. Introduction to arrays; 50. Array manipulation; 51. The @ARGV array; 52. Defined and undefined variables; 53. Sorting; 54. Introduction to loops; 55. More loops; 56. Loop control; 57. Data input and output; 58. Reading and writing files; 59. Introduction to hashes; 60. Working with hashes; 61. Introduction to regular expressions; 62. Regular expression metacharacters; 63. Working with regular expressions; 64. Interacting with other programs; 65. Using functions and subroutines; 66. Returning data from a subroutine; 67. Part IV summary; Part V. Advanced Unix: 68. Introduction to advanced Unix; 69. Introduction to process control; 70. The grep command; 71. Viewing, and controlling, program output; 72. Redirecting input and output; 73. Standard error; 74. Connecting commands with pipelines; 75. Advanced text manipulation; Part VI. Advanced Perl: 76. Regular expressions revisited; 77. Function libraries; 78. References and 2-dimensional arrays; 79. Records and other hash references; 80. Using references with subroutines; 81. Complex data structures; 82. Adding command-line options; 83. OOP basics; 84. CPAN; Part VII. Programming Topics: 85. Debugging strategies; 86. Common error messages; 87. Code beautification; 88. Abstraction; 89. Data management; 90. Documentation; 91. Revision control; 92. Working with other peoples' data; 93. Getting help; Appendix; Index.
'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 M. D. Sharma, Genetics Society News '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 '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 [work] complete with sprinkles of humor and biologically motivated examples.' Jason Stajich, University of California, Riverside '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, Choice