In today's data driven biology, programming knowledge is essential in turning ideas into testable hypothesis. Based on the author's extensive experience, Python for Bioinformatics, Second Edition helps biologists get to grips with the basics of software development. Requiring no prior knowledge of programming-related concepts, the book focuses on the easy-to-use, yet powerful, Python computer language. This new edition is updated throughout to Python 3 and is designed not just to help scientists master the basics, but to do more in less time and in a reproducible way. New developments added in this edition include NoSQL databases, the Anaconda Python distribution, graphical libraries like Bokeh, and the use of Github for collaborative development.
Author(s): Sebastian Bassi
Edition: 2
Publisher: CRC Press
Year: 2017
Language: English
Pages: 412
Cover
Half Title
Chapman & Hall/crc
Published Titles
Title
Copyright
Contents
List Of Figures
List Of Tables
Preface To The First Edition
Preface To The Second Edition
Acknowledgments
Section I Programming
Chapter 1 Introduction
1.1 Who Should Read This Book
1.1.1 What The Reader Should Already Know
1.2 Using This Book
1.2.1 Typographical Conventions
1.2.2 Python Versions
1.2.3 Code Style
1.2.4 Get The Most From This Book Without Reading It All
1.2.5 Online Resources Related To This Book
1.3 Why Learn To Program
1.4 Basic Programming Concepts
1.4.1 What Is A Program
1.5 Why Python
1.5.1 Main Features Of Python
1.5.2 Comparing Python With Other Languages
1.5.3 How Is It Used
1.5.4 Who Uses Python
1.5.5 Flavors Of Python
1.5.6 Special Python Distributions
1.6 Additional Resources
Chapter 2 First Steps With Python
2.1 Installing Python
2.1.1 Learn Python By Using It
2.1.2 Install Python Locally
2.1.3 Using Python Online
2.1.4 Testing Python
2.1.5 First Use
2.2 Interactive Mode
2.2.1 Baby Steps
2.2.2 Basic Input And Output
2.2.3 More On The Interactive Mode
2.2.4 Mathematical Operations
2.2.5 Exit From The Python Shell
2.3 Batch Mode
2.3.1 Comments
2.3.2 Indentation
2.4 Choosing An Editor
2.4.1 Sublime Text
2.4.2 Atom
2.4.3 Pycharm
2.4.4 Spyder Ide
2.4.5 Final Words About Editors
2.5 Other Tools
2.6 Additional Resources
2.7 Self-evaluation
Chapter 3 Basic Programming: Data Types
3.1 Strings
3.1.1 Strings Are Sequences Of Unicode Characters
3.1.2 String Manipulation
3.1.3 Methods Associated With Strings
3.2 Lists
3.2.1 Accessing List Elements
3.2.2 List With Multiple Repeated Items
3.2.3 List Comprehension
3.2.4 Modifying Lists
3.2.5 Copying A List
3.3 Tuples
3.3.1 Tuples Are Immutable Lists
3.4 Common Properties Of The Sequences
3.5 Dictionaries
3.5.1 Mapping: Calling Each Value By A Name
3.5.2 Operating With Dictionaries
3.6 Sets
3.6.1 Unordered Collection Of Objects
3.6.2 Set Operations
3.6.3 Shared Operations With Other Data Types
3.6.4 Immutable Set: Frozenset
3.7 Naming Objects
3.8 Assigning A Value To A Variable Versus Binding A Name To An Object
3.9 Additional Resources
3.10 Self-evaluation
Chapter 4 Programming: Flow Control
4.1 If-else
4.1.1 Pass Statement
4.2 For Loop
4.3 While Loop
4.4 Break: Breaking The Loop
4.5 Wrapping It Up
4.5.1 Estimate The Net Charge Of A Protein
4.5.2 Search For A Low-degeneration Zone
4.6 Additional Resources
4.7 Self-evaluation
Chapter 5 Handling Files
5.1 Reading Files
5.1.1 Example Of File Handling
5.2 Writing Files
5.2.1 File Reading And Writing Examples
5.3 Csv Files
5.4 Pickle: Storing And Retrieving The Contents Of Vari- Ables
5.5 Json Files
5.6 File Handling: Os, Os.path, Shutil, And Path.py Module
5.6.1 Path.py Module
5.6.2 Consolidate Multiple Dna Sequences Into One Fasta File
5.7 Additional Resources
5.8 Self-evaluation
Chapter 6 Code Modularizing
6.1 Introduction To Code Modularizing
6.2 Functions
6.2.1 Standard Way To Make Python Code Modular
6.2.2 Function Parameter Options
6.2.3 Generators
6.3 Modules And Packages
6.3.1 Using Modules
6.3.2 Packages
6.3.3 Installing Third-party Modules
6.3.4 Virtualenv: Isolated Python Environments
6.3.5 Conda: Anaconda Virtual Environment
6.3.6 Creating Modules
6.3.7 Testing Modules
6.4 Additional Resources
6.5 Self-evaluation
Chapter 7 Error Handling
7.1 Introduction To Error Handling
7.1.1 Try And Except
7.1.2 Exception Types
7.1.3 Triggering Exceptions
7.2 Creating Customized Exceptions
7.3 Additional Resources
7.4 Self-evaluation
Chapter 8 Introduction To Object Orienting Programming (oop
8.1 Object Paradigm And Python
8.2 Exploring The Jargon
8.3 Creating Classes
8.4 Inheritance
8.5 Special Methods
8.5.1 Create A New Data Type Using A Built-in Data Type
8.6 Making Our Code Private
8.7 Additional Resources
8.8 Self-evaluation
Chapter 9 Introduction To Biopython
9.1 What Is Biopython
9.1.1 Project Organization
9.2 Installing Biopython
9.3 Biopython Components
9.3.1 Alphabet
9.3.2 Seq
9.3.3 Mutableseq
9.3.4 Seqrecord
9.3.5 Align
9.3.6 Alignio
9.3.7 Clustalw
9.3.8 Seqio
9.3.9 Alignio
9.3.10 Blast
9.3.11 Biological Related Data
9.3.12 Entrez
9.3.13 Pdb
9.3.14 Prosite
9.3.15 Restriction
9.3.16 Sequtils
9.3.17 Sequencing
9.3.18 Swissprot
9.4 Conclusion
9.5 Additional Resources
9.6 Self-evaluation
Section Ii Advanced Topics
Chapter 10 Web Applications
10.1 Introduction To Python On The Web
10.2 Cgi In Python
10.2.1 Configuring A Web Server For Cgi
10.2.2 Testing The Server With Our Script
10.2.3 Web Program To Calculate The Net Charge Of A Protein (cgi Version
10.3 Wsgi
10.3.1 Bottle: A Python Web Framework For Wsgi
10.3.2 Installing Bottle
10.3.3 Minimal Bottle Application
10.3.4 Bottle Components
10.3.5 Web Program To Calculate The Net Charge Of A Protein (bottle Version
10.3.6 Installing A Wsgi Program In Apache
10.4 Alternative Options For Making Python-based Dynamic Web Sites
10.5 Some Words About Script Security
10.6 Where To Host Python Programs
10.7 Additional Resources
10.8 Self-evaluation
Chapter 11 Xml
11.1 Introduction To Xml
11.2 Structure Of An Xml Document
11.3 Methods To Access Data Inside An Xml Document
11.3.1 Sax: Celementtree Iterparse
11.4 Summary
11.5 Additional Resources
11.6 Self-evaluation
Chapter 12 Python And Databases
12.1 Introduction To Databases
12.1.1 Database Management: Rdbms
12.1.2 Components Of A Relational Database
12.1.3 Database Data Types
12.2 Connecting To A Database
12.3 Creating A Mysql Database
12.3.1 Creating Tables
12.3.2 Loading A Table
12.4 Planning Ahead
12.4.1 Pythonu: Sample Database
12.5 Select: Querying A Database
12.5.1 Building A Query
12.5.2 Updating A Database
12.5.3 Deleting A Record From A Database
12.6 Accessing A Database From Python
12.6.1 Pymysql Module
12.6.2 Establishing The Connection
12.6.3 Executing The Query From Python
12.7 Sqlite
12.8 Nosql Databases: Mongodb
12.8.1 Using Mongodb With Pymongo
12.9 Additional Resources
12.10 Self-evaluation
Chapter 13 Regular Expressions
13.1 Introduction To Regular Expressions (regex
13.1.1 Regex Syntax
13.2 The Re Module
13.2.1 Compiling A Pattern
13.2.2 Regex Examples
13.2.3 Pattern Replace
13.3 Regex In Bioinformatics
13.3.1 Cleaning Up A Sequence
13.4 Additional Resources
13.5 Self-evaluation
Chapter 14 Graphics In Python
14.1 Introduction To Bokeh
14.2 Installing Bokeh
14.3 Using Bokeh
14.3.1 A Simple X-y Plot
14.3.2 Two Data Series Plot
14.3.3 A Scatter Plot
14.3.4 A Heatmap
14.3.5 A Chord Diagram
Section Iii Python Recipes With Commentedsource Code3
Chapter 15 Sequence Manipulation In Batch
15.1 Problem Description
15.2 Problem One: Create A Fasta File With Random Se- Quences
15.2.1 Commented Source Code
15.3 Problem Two: Filter Not Empty Sequences From A Fasta File
15.3.1 Commented Source Code
15.4 Problem Three: Modify Every Record Of A Fasta File
15.4.1 Commented Source Code
Chapter 16 Web Application For Filtering Vector Contamination
16.1 Problem Description
16.1.1 Commented Source Code
16.2 Additional Resources
Chapter 17 Searching For Pcr Primers Using Primer3
17.1 Problem Description
17.2 Primer Design Flanking A Variable Length Region
17.2.1 Commented Source Code
17.3 Primer Design Flanking A Variable Length Region, With Biopython
17.4 Additional Resources
Chapter 18 Calculating Melting Temperature From A Set Of Primers
18.1 Problem Description
18.1.1 Commented Source Code
18.2 Additional Resources
Chapter 19 Filtering Out Specific Fields From A Genbank File
19.1 Extracting Selected Protein Sequences
19.1.1 Commented Source Code
19.2 Extracting The Upstream Region Of Selected Pro- Teins
19.2.1 Commented Source Code
19.3 Additional Resources
Chapter 20 Inferring Splicing Sites
20.1 Problem Description
20.1.1 Infer Splicing Sites With Commented Source Code
20.1.2 Sample Run Of Estimate Intron Program
Chapter 21 Web Server For Multiple Alignment
21.1 Problem Description
21.1.1 Web Interface: Front-end. Html Code
21.1.2 Web Interface: Server-side Script. Commented Source Code
21.2 Additional Resources
Chapter 22 Drawing Marker Positions Using Data Stored In A Database
22.1 Problem Description
22.1.1 Preliminary Work On The Data
22.1.2 Mongodb Version With Commented Source Code
Section Iv Appendices
Appendix A Collaborative Development: Version Control With Github
A.1 Introduction To Version Control
A.2 Version Your Code
A.3 Share Your Code
A.4 Contribute To Other Projects
A.5 Conclusion
A.6 Methods
A.7 Additional Resources
Appendix B Install A Bottle App In Pythonanywhere
B.1 Pythonanywhere
B.1.1 What Is Pythonanywhere
B.1.2 Installing A Web App In Pythonanywhere
Appendix C Scientific Python Cheat Sheet
C.1 Pure Python
C.2 Virtualenv
C.3 Conda
C.4 Ipython
C.5 Numpy
C.6 Matplotlib
C.7 Scipy
C.8 Pandas
Index