Lec 2 PDF
Lec 2 PDF
Edited by
Python Programming
in bioinformatics
Why Python?
Python can be installed and used on different platforms,
including Windows, Mac, and Linux.
Python has several built-in features that make it well-
suited for bioinformatics applications.
Python‟s dynamic and modular nature allows researchers
to reuse and share code, reducing development time and
increasing productivity.
Python has a relatively simple syntax, making it easy to
learn and use.
Python is a high-level language that offers advanced data
structures and functions that make it easy to work with
complex biological data.
Tools for Python Programming in
Bioinformatics
1. Biopython
One of the most widely used bioinformatics packages for Python. Biopython is an
open-source collection of Python modules that provides a set of powerful and easy-
to-use tools for performing biological computations.
Biopython requires very less code and comes up with the following advantages −
2. Cell Microarray
What are the input data types for Biopython?
CSV file:
FASTA File:
What are the input data types for Biopython?
<type 'int’>
<type ’float’>
<type ’complex'>
>>> (2+1j)**2
>>> 17/5
(3+4j)
3
Data Types: Strings
Single quote:
>>> ’atg’
’atg’
Double quote:
>>> ”atg”
’atg’
>>> ’This is a codon, isn’t it?’
Invalid Syntax
>>> ” This is a codon, isn’t it?” # Or >>> ’This is a codon, isn\’t it?’
• The + adds either reading or writing to an existing open mode (update mode).
• The r means reading file; r+ means reading and writing the file.
• The w means writing file; w+ means reading and writing the file.
• The a means writing file, append mode; a+ means reading and writing file, append mode.
Examples:
Difference between r and r+ in open()