Difference between revisions of "Python for Biologists/C2/Introduction-to-Python-for-Biologists/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Title of script''': '''Introduction to Python for Biologists'''
+
'''Title of script: Introduction to Python for Biologists '''
  
 
'''Author: Trupti Rajesh Kini & Snehalatha '''
 
'''Author: Trupti Rajesh Kini & Snehalatha '''
  
'''Keywords: video tutorial, Python, DNA seqences, Protein sequences, Biologists'''
+
'''Keywords: video tutorial, Python, DNA seqences, Protein sequences, Biologists'''  
  
  
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Visual Cue'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Visual Cue'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Narration'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Narration'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 1'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 1'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Welcome to the '''spoken-tutorial '''on''' Introduction to Python for Biologists.'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Welcome to the '''spoken-tutorial '''on '''Introduction to Python for Biologists.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 2'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 2'''  
  
 
'''Learning Objectives '''
 
'''Learning Objectives '''
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial we will learn,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial we will learn,  
 
+
* Installation of '''Python/IPython interpreter.'''
+
* Simple '''Python''' programs using examples of''' DNA''' and Protein sequences.<br/>
+
  
 +
* Installation of '''Python/IPython interpreter.'''
 +
* Simple '''Python''' programs using examples of '''DNA''' and Protein sequences.
  
  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 3'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 3'''  
  
'''System Requirements'''
+
'''System Requirements'''  
  
  
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To record this tutorial, I am using
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To record this tutorial, I am using  
  
* '''Ubuntu OS version 12.04'''
+
* '''Ubuntu OS version 12.04'''  
* '''Python 3.2.3'''
+
* '''Python 3.2.3'''  
* '''IPython 0.12.1'''
+
* '''IPython 0.12.1'''  
  
  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 4'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 4'''  
  
'''Prerequisites'''
+
'''Prerequisites'''  
  
  
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To practice this tutorial you should be familiar with,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To practice this tutorial you should be familiar with,  
  
* Basic biochemistry
+
* Basic biochemistry  
  
You can also refer to '''Spoken Tutorials''' on '''Python''' for better understanding of this tutorial.
+
You can also refer to '''Spoken Tutorials''' on '''Python''' for better understanding of this tutorial.  
  
 
+
These are available at the given link.
These are available at '''www.spoken-tutorial.org'''
+
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 5'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 5'''  
 
+
'''Why Python for biologists?'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Some of the features of '''Python''' useful for biologists are as follows:
+
 
+
  
* Python has many tools to write small <br/> programs that are useful in biology.
+
'''Why Python for biologists?'''
* It has a consistent syntax.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Some of the features of '''Python''' useful for biologists are as follows:
* It has built-in-libraries for common tasks.
+
* We can manipulate DNA and protein sequences easily .
+
  
 +
* Python has many tools to write small programs that are useful in biology.
 +
* It has a consistent syntax.
 +
* It has built-in-libraries for common tasks.
 +
* We can manipulate DNA and protein sequences easily .
  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 6 '''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 6 '''
  
'''Why Pyhton for biologists?'''
+
'''Why Pyhton for biologists?'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|  
* It has a large user base as it is commonly used in bioinformatics.
+
* It has a large user base as it is commonly used in '''bioinformatics'''.  
* Listed here are examples of few bioinformatic tools in Python:
+
* Listed here are examples of few '''bioinformatic''' tools in '''Python''':  
  
'''Biopython, Modeller, chemopy, BLASTorage, Pymol'''
+
'''Biopython, Modeller, chemopy, BLASTorage, Pymol'''  
  
 +
For more information, refer the given website:
  
For more information, refer the following website :
+
[http://pythonforbiologists.com/ http://pythonforbiologists.com]
 
+
'''http://pythonforbiologists.com'''
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 7'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 7'''  
 
+
'''Installation'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|
+
* '''Python comes installed, by default on Ubuntu.'''
+
* IPython is an interactive terminal for Python
+
* To install '''Python '''on '''Windows, Mac OS '''and '''Android '''devices, visit '''www.python.org'''
+
  
 +
'''Installation'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|
 +
* '''Python''' comes installed, by default on '''Ubuntu'''.
 +
* '''IPython''' is an '''interactive terminal''' for '''Python'''
 +
* To install '''Python '''on '''Windows, Mac OS '''and '''Android '''devices, visit the given link
  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open terminal by pressing Ctrl+Alt+T at the same time.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Open terminal by pressing '''Ctrl+Alt+T''' at the same time.  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Open the '''terminal''' by pressing '''Ctrl+Alt+T''' simultaneously.  
Open the '''terminal by pressing '''Ctrl+Alt+T''' simultaneously.
+
  
Python comes installed, by default on Ubuntu.
+
'''Python''' comes installed, by default on '''Ubuntu'''.  
  
In case you don't, then manually install the latest version of I'''Python''', by typing
 
  
'''sudo apt-get install ipython3'''
+
|-
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type '''sudo apt-get install ipython3'''  
  
and press '''Enter.'''
+
and press '''Enter.'''  
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| In case you don't, then manually install the latest version of '''IPython''', by typing
  
Give root password if asked.
+
'''sudo apt-get install ipython3''' and press '''Enter.'''
  
|-
+
Give '''root password''' if asked.  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Wait for a few minutes for the installation to complete.
+
Note:Python3 does not overwrite the default Python on the system
+
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal.
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Wait for a few minutes for the installation to complete.
  
Type''' ipython3''' and press '''Enter.'''
+
Note : '''Python3''' does not overwrite the default '''Python''' on the system.  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To check whether '''ipython3''' is installed successfully on your system,
+
 
+
 
+
Type''' ipython3 '''at the '''prompt '''and press '''Enter.'''
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Open the terminal  
  
 +
Type '''ipython3''' and press '''Enter.'''
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To check whether '''ipython3''' is installed successfully on your system,
  
Point to “>>>” symbol.
+
type '''ipython3 '''and press '''Enter.'''  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| You will see few lines of information on '''Python '''like, the version number etc.
+
 
+
 
+
You will also see the I'''Python promptI added this. Pls verify'''<nowiki> In[1]</nowiki> '''on the '''terminal'''.
+
 
+
 
+
 
+
 
+
.Here we are installing manually. But what happens to the already installed Python? Does it get overwritten?
+
  
 +
|-
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
  
 +
Highlight the prompt
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| You will see few lines of information on '''Python '''like, the version number.
  
 +
You will also see the '''Ipython prompt''' on the '''terminal'''.
  
 +
'''Prompt''' indicates that '''Ipython '''is installed successfully.
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on terminal
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on terminal  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let's type a few simple '''Python''' commands with an example of a '''DNA '''sequence.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let's type a few simple '''Python''' commands with an example of a '''DNA '''sequence.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on terminal
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on terminal  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To begin with, we will store data, i.e '''DNA sequence '''in a variable called '''my_DNA.'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To begin with, we will store data, i.e '''DNA sequence, '''in a variable called '''my_DNA.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 8'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 8'''  
  
 +
'''What is a string?'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| In '''Python''' language, data such as '''protein''' and '''DNA''' sequences are called as '''strings'''.
  
'''What is a string?'''
+
A '''string''' is a data in the form of a text.  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In '''Python''' language, data such as '''protein''' and '''DNA''' sequences are called as '''strings'''.
+
  
 +
Let us go back to the '''terminal'''.
  
A '''string''' is a data in the form of a text.  
+
Let us first clear the '''terimal''' by typing '''clear''' and press '''Enter'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type in the terminal,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type in the terminal,  
  
'''my_DNA = "ATGCGCAT"'''
+
'''my_DNA = "ATGCGCAT"'''  
  
Highlight '''my_DNA'''
+
Highlight '''my_DNA'''  
  
Press '''Enter'''
+
Press '''Enter'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|Type,  
  
'''my_DNA equal to ATGCGCAT '''within double quotes
+
'''my_DNA is equal to within double quotes ATGCGCAT.'''
  
 
+
Press '''Enter'''.  
Press '''Enter'''.
+
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the panel.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight '''my_DNA'''
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| We call this as '''''assigning''''' a variable.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| We call this as '''''assigning''''' a variable.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the panel
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight '''my_DNA'''
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| For writing a code, we can use the variable name instead of the string itself.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| For writing a code, we can use the variable name instead of the '''string''' itself.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,  
 +
 
 +
'''print(my_DNA) '''and press '''Enter'''
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To print the DNA sequence,
 +
 
 +
we will use '''print function.'''
  
'''my_DNA '''and press '''Enter'''
+
For that type,
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To print this sequence, type
+
  
'''my_DNA '''and press '''Enter.'''
+
'''print inside brackets my underscore DNA''' and press '''Enter.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight the output,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight the output,  
  
'''ATGCGCAT'''
+
'''ATGCGCAT'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This will print the '''DNA '''sequence, '''ATGCGCAT '''within single quotes as it is a string.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| We get the sequence as output.
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal.  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now let us print the sequence on two separate lines.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Now let us print the sequence on two separate lines.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''up '''arrow  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''up '''arrow  
  
Add '''\n '''and '''DNA '''after '''ATGCGCAT''' '''.'''
+
Add '''\n '''and '''DNA '''after '''ATGCGCAT'''.
  
'''my_DNA = "ATGCGCAT\nDNA"'''
+
'''my_DNA = "ATGCGCAT\nDNA"'''  
  
Press '''Enter'''
+
Press '''Enter'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''up '''arrow on the key board till we get this command on the '''terminal.'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''up '''arrow on the key board till we get this command on the '''terminal.'''  
  
 
'''my_DNA = "ATGCGCAT” '''
 
'''my_DNA = "ATGCGCAT” '''
  
Lets edit this line.
+
Lets edit this line.  
  
Type '''\n '''and '''DNA '''after '''ATGCGCAT '''within double quotes.
+
Type '''\n DNA '''after the sequence within double quotes.  
  
Press '''Enter.'''
+
Press '''Enter.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,  
 
+
'''print(my_DNA) '''and press '''Enter'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,
+
 
+
'''print(my_DNA) '''and press '''Enter.'''
+
  
 +
'''print(my_DNA) '''and press '''Enter'''
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,
  
 +
'''print inside brackets my underscore DNA''' and press '''Enter.'''
  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight the output
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight the output
 
+
'''ATGCGCAT'''
+
 
+
'''DNA'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The output prints the sequence on two separate lines as,
+
 
+
'''ATGCGCAT'''
+
  
'''DNA'''
+
'''ATGCGCAT'''  
  
 +
'''DNA'''
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| The output prints the sequence on two separate lines.
  
<nowiki><<PAUSE>></nowiki>
 
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 9'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 9'''  
  
'''Assignment'''
+
'''Assignment'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment,
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment,  
  
* Using example of a short protein<br/> sequence: '''CNLTFTWPEADFYPI Protein'''<br/>
+
* Using example of a short proteinsequence given
 +
* Print the sequence on a single line,
 +
* And print the sequence on two separate lines.
  
* Print the above sequence on a single line, and also on two separate lines.
 
  
<nowiki><<PAUSE>></nowiki>
+
|-
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us now learn a few more '''functions '''and '''methods'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 10'''
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let's go back to the '''terminal '''and learn a few more '''functions '''and '''methods'''.
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Another useful built-in tool in '''Python''' is the '''len function'''.
 +
 
 +
It is used to calculate the length of a string.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us go back to the '''terminal'''.
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Another useful built-in tool in '''Python''' is the '''len''' '''function'''.
+
  
 +
Press up arrow key
  
It is used to calculate the length of a string.
+
'''my_DNA = "ATGCGCAT"'''
  
|-
+
Press '''Enter'''
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Press up arrow key
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us go back to the '''terminal'''.
  
'''my_DNA = "ATGCGCAT"'''
+
Press '''up '''arrow on the key board till we get this command on the '''terminal.'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''up '''arrow on the key board till we get this command on the '''terminal.'''
+
  
'''my_DNA = "ATGCGCAT”'''
+
'''my_DNA = "ATGCGCAT”'''  
  
Press '''Enter'''
+
Press '''Enter'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type:
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type:  
  
len(my_DNA)
+
len(my_DNA)  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To find the length of the '''DNA''' sequence in a variable, type,
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To find the length of the '''DNA''' sequence in a variable, type,  
 
+
'''len '''within brackets '''my_DNA'''
+
  
 +
'''len '''within brackets '''my_DNA'''
  
 
Press '''Enter.'''  
 
Press '''Enter.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The output on the screen shows the number 8.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| The output on the screen shows the number 8.  
 
+
  
This is the length of the '''DNA '''sequence stored in the variable '''my_DNA.'''
+
This is the length of the '''DNA '''sequence stored in the variable '''my_DNA.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 10'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 11'''
  
 +
'''Assignment'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Another assignment for you
  
'''Assignment'''
+
* Calculate the length of the given '''DNA '''sequence ''''ATGGCATGCGC''''
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Another assignment for you
+
* And Store the output in a variable.  
 
+
* Calculate the length of the given '''DNA '''sequence `ATGGCATGCGC'<br/>
+
 
+
* Store the output in a variable.
+
 
+
  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 12'''
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Lets go back to the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Many times in '''biochemistry''', sequences are represented either in lowercase or uppercase alphabets.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type,  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Many times in biochemistry, sequences are represented either in &nbsp;lowercase or uppercase &nbsp;alphabets.
+
  
 +
'''my_DNA=”ATGCGCAT”'''
  
 +
Press '''Enter'''
  
 +
Type '''my_DNA'''.'''lower()'''
  
|-
+
Press '''Enter.'''
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type '''protein =” ”'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To convert the uppercase alphabets in a string to lowercase, we make use of '''lower() method. '''
  
Press '''Enter'''
+
Let us go back to the '''terminal.'''
  
Type '''my_DNA'''.'''lower()'''
+
Type,
  
Press '''Enter.'''
+
'''my_DNA=”ATGCGCAT”''' and press '''Enter'''  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To convert the uppercase alphabets in a string to &nbsp;lowercase:
+
  
We make use of '''lower()''' method.
 
  
Type,
+
Then type, '''my_DNA dot lower open and close brackets''' .
  
'''my_DNA=”ATGCGCAT”. &nbsp;'''Press '''Enter'''
+
In a method, we write,
  
Then type, '''my_DNA'''.'''lower().'''
+
* The name of the variable first,  
 +
* followed by a period(.),
 +
* then the name of the method,
 +
* then we open and close parentheses.  
  
In a method, we write,
+
Press '''Enter.'''  
 
+
* The name of the variable first,
+
* followed by a period(.),
+
* then the name of the method
+
* then we open and close parentheses.
+
 
+
Press '''Enter.'''
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight &nbsp;''''atgcgcat''''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight &nbsp;''''atgcgcat''''  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The output shows the string in lowercase.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| The output shows the '''string''' in lowercase.  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 11'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 13'''
 
+
'''Assignment'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment,
+
 
+
Using example of a short protein
+
 
+
sequence: &nbsp;'''cnltftwpeadfypi'''
+
  
Convert the sequence to uppercase'''.'''
+
'''Assignment'''  
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment,
  
'''Hint: Use upper() method.'''
+
*Using example of a short protein sequence given
 +
*Convert the sequence to uppercase
 +
* Hint: Use '''upper() method.'''  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Back to terminal again
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us go back to '''terminal''' again.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type
 
+
my_protein = <tt>"alspadkanl"</tt>
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Lets take an example of an amino acid sequence.
+
 
+
Store it in a variable called protein
+
 
+
my_protein = <tt>"alspadkanl"</tt>
+
  
 +
my_protein = <tt>"alspadkanl"</tt>
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Lets take an example of an '''amino acid''' sequence.
  
 +
Store it in a variable called '''my_protein'''.
  
 +
So type '''my_protein = <tt>"alspadkanl"</tt>''' and press '''Enter'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 14
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To find out the number of times an amino acid or a sequence of amino acids occurs in a string.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| To find out the number of times an '''amino acid''' or a sequence of '''amino acids''' occurs in a '''string''', we make use of '''count function. '''
 
+
We make use of '''count '''function
+
 
+
 
+
  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type  
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type  
  
my_protein.count ('a')
+
my_protein.count ('a')  
  
 +
Press '''Enter'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us go back to the '''terminal'''.
  
Press enter
+
For example, to know the number of times '''amino acid Alanine''' occurs in the '''string''', type
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| For example to know the number of times amino acid Alanine occurs in the string
+
  
 +
my_protein.count ('a') [[my underscore protein dot count open and close brackets within single quotes a]]
  
Type
+
Press '''Enter'''
  
my_protein.count ('a')
+
|-
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight 3
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Output shows number 3.  
  
 +
There are 3 '''Alanines''' in the '''string.'''
  
Press enter
 
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Type
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <tt>Output shows number 3.</tt>
+
  
<tt>There are 3 Alanines in the string. </tt>
+
my_protein.count('l')
  
 +
Press '''Enter'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Similarly to find number of''' Leucines''' in the '''string''', type
  
 +
my_protein.count('l') [[my underscore protein dot count open and close brackets within single quotes l]]
  
 +
Press '''Enter'''
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Type
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Highlight 2
 
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| We get an output as '''2'''.
my_protein.count('l')
+
 
+
Press enter
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Similarly to find number of Leucines in the string
+
 
+
Type
+
 
+
my_protein.count('l')
+
 
+
Press enter
+
 
+
 
+
  
 +
There are '''2 Leucines''' in the '''string'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| We get an output as 2, there are 2 Leucines in the string.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Similarly, we can use '''DNA''' or an '''RNA''' sequence as '''string''' to count the ocurrances of '''basepairs'''.  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Cursor on the terminal
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 15'''
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Similarly we can use DNA or an RNA sequence as string to count the ocurrences of basepairs .
+
  
|-
+
'''Summary'''  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 12'''
+
  
'''Summary'''
 
  
  
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us summarize.
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let us summarize,
+
In this tutorial we learnt:  
 
+
In this tutorial we have learnt:
+
 
+
 
+
* Installation of '''IPython Interpreter'''
+
 
+
* Storing data in variables using
+
 
+
examples of '''DNA''' and '''Protein'''
+
 
+
sequences.
+
 
+
 
+
* Printing a sequence in single and on two separate lines
+
 
+
  
 +
* Installation of '''IPython Interpreter'''
 +
* Storing data in variables using examples of '''DNA''' and '''Protein''' sequences.
 +
* Printing a sequence in single and on two separate lines
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 13'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 16'''
 
+
'''Summary'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| * Find the length of the string
+
* Change case of the string <br/>
+
 
+
* Count the number of times a character appears in a string
+
 
+
  
 +
'''Summary'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|
 +
* Find the length of the '''string'''
 +
* Change case of the '''string'''
 +
* Count the number of times a character appears in a '''string'''
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 13
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 17
 
+
'''Assignment'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Here is an assignment,
+
 
+
Calculate GC content in the given DNA sequence.
+
 
+
'ATGGCATGCGC'
+
  
 +
'''Assignment'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment,
  
 +
*Calculate '''GC content''' in the given DNA sequence.
 +
*'ATGGCATGCGC'
  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 14'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 18'''
  
'''About Spoken Tutorial Project'''
+
'''About Spoken Tutorial Project'''  
  
  
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The video available at the following link summarizes the Spoken Tutorial project. Pls watch it.  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| The video available at the following link summarizes the Spoken Tutorial project. Pls watch it.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 15'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 19'''
 
+
'''About Spoken Tutorial workshops'''
+
  
 +
'''About Spoken Tutorial workshops'''
  
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass an online test.
 
  
 +
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass an online test.
  
 
For more details, please write to us.  
 
For more details, please write to us.  
  
 
|-
 
|-
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 16'''
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| '''Slide 20'''
  
'''Acknowledgement'''
+
'''Acknowledgement'''  
  
  
  
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Spoken Tutorial ProjecThese 3 slides remain as before, on LaTeX. Only the narration will now be as given here.t is supported by the NMEICT, MHRD, Government of India.  
+
| style="background-color:#ffffff;border:0.75pt solid #000001;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| Spoken Tutorial Project is supported by NMEICT, MHRD, Government of India.  
  
More information on this Mission is available at this link.
+
More information on this Mission is available at this link.  
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"|  
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This script is contributed by Snehalatha and Trupti Kini.
+
| style="background-color:#ffffff;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding-top:0cm;padding-bottom:0.049cm;padding-left:0.191cm;padding-right:0.191cm;"| This script is contributed by Snehalatha and Trupti Kini.  
  
And this is Trupti Kini from''' IIT Bombay''' signing off.
+
And this is Trupti Kini from IIT Bombay signing off.  
  
Thanks for joining.
+
Thanks for joining.  
  
 
|}
 
|}

Latest revision as of 14:51, 13 August 2014

Title of script: Introduction to Python for Biologists

Author: Trupti Rajesh Kini & Snehalatha

Keywords: video tutorial, Python, DNA seqences, Protein sequences, Biologists


Visual Cue Narration
Slide 1 Welcome to the spoken-tutorial on Introduction to Python for Biologists.
Slide 2

Learning Objectives

In this tutorial we will learn,
  • Installation of Python/IPython interpreter.
  • Simple Python programs using examples of DNA and Protein sequences.


Slide 3

System Requirements


To record this tutorial, I am using
  • Ubuntu OS version 12.04
  • Python 3.2.3
  • IPython 0.12.1


Slide 4

Prerequisites


To practice this tutorial you should be familiar with,
  • Basic biochemistry

You can also refer to Spoken Tutorials on Python for better understanding of this tutorial.

These are available at the given link.

Slide 5

Why Python for biologists?

Some of the features of Python useful for biologists are as follows:
  • Python has many tools to write small programs that are useful in biology.
  • It has a consistent syntax.
  • It has built-in-libraries for common tasks.
  • We can manipulate DNA and protein sequences easily .


Slide 6

Why Pyhton for biologists?

  • It has a large user base as it is commonly used in bioinformatics.
  • Listed here are examples of few bioinformatic tools in Python:

Biopython, Modeller, chemopy, BLASTorage, Pymol

For more information, refer the given website:

http://pythonforbiologists.com

Slide 7

Installation

  • Python comes installed, by default on Ubuntu.
  • IPython is an interactive terminal for Python
  • To install Python on Windows, Mac OS and Android devices, visit the given link


Open terminal by pressing Ctrl+Alt+T at the same time. Open the terminal by pressing Ctrl+Alt+T simultaneously.

Python comes installed, by default on Ubuntu.


Type sudo apt-get install ipython3

and press Enter.

In case you don't, then manually install the latest version of IPython, by typing

sudo apt-get install ipython3 and press Enter.

Give root password if asked.

Cursor on the terminal. Wait for a few minutes for the installation to complete.

Note : Python3 does not overwrite the default Python on the system.

Open the terminal

Type ipython3 and press Enter.

To check whether ipython3 is installed successfully on your system,

type ipython3 and press Enter.

Cursor on the terminal

Highlight the prompt

You will see few lines of information on Python like, the version number.

You will also see the Ipython prompt on the terminal.

Prompt indicates that Ipython is installed successfully.

Cursor on terminal Let's type a few simple Python commands with an example of a DNA sequence.
Cursor on terminal To begin with, we will store data, i.e DNA sequence, in a variable called my_DNA.
Slide 8

What is a string?

In Python language, data such as protein and DNA sequences are called as strings.

A string is a data in the form of a text.

Let us go back to the terminal.

Let us first clear the terimal by typing clear and press Enter.

Type in the terminal,

my_DNA = "ATGCGCAT"

Highlight my_DNA

Press Enter

Type,

my_DNA is equal to within double quotes ATGCGCAT.

Press Enter.

Highlight my_DNA We call this as assigning a variable.
Highlight my_DNA For writing a code, we can use the variable name instead of the string itself.
Type,

print(my_DNA) and press Enter

To print the DNA sequence,

we will use print function.

For that type,

print inside brackets my underscore DNA and press Enter.

Highlight the output,

ATGCGCAT

We get the sequence as output.
Cursor on the terminal. Now let us print the sequence on two separate lines.
Press up arrow

Add \n and DNA after ATGCGCAT.

my_DNA = "ATGCGCAT\nDNA"

Press Enter

Press up arrow on the key board till we get this command on the terminal.

my_DNA = "ATGCGCAT”

Lets edit this line.

Type \n DNA after the sequence within double quotes.

Press Enter.

Type,

print(my_DNA) and press Enter

Type,

print inside brackets my underscore DNA and press Enter.


Highlight the output

ATGCGCAT

DNA

The output prints the sequence on two separate lines.


Slide 9

Assignment

As an assignment,
  • Using example of a short proteinsequence given
  • Print the sequence on a single line,
  • And print the sequence on two separate lines.


Cursor on the terminal Let us now learn a few more functions and methods.
Slide 10 Another useful built-in tool in Python is the len function.

It is used to calculate the length of a string.

Let us go back to the terminal.

Press up arrow key

my_DNA = "ATGCGCAT"

Press Enter

Let us go back to the terminal.

Press up arrow on the key board till we get this command on the terminal.

my_DNA = "ATGCGCAT”

Press Enter

Type:

len(my_DNA)

To find the length of the DNA sequence in a variable, type,

len within brackets my_DNA

Press Enter.

Cursor on the terminal The output on the screen shows the number 8.

This is the length of the DNA sequence stored in the variable my_DNA.

Slide 11

Assignment

Another assignment for you
  • Calculate the length of the given DNA sequence 'ATGGCATGCGC'
  • And Store the output in a variable.


Slide 12 Many times in biochemistry, sequences are represented either in lowercase or uppercase alphabets.
Type,

my_DNA=”ATGCGCAT”

Press Enter

Type my_DNA.lower()

Press Enter.

To convert the uppercase alphabets in a string to lowercase, we make use of lower() method.

Let us go back to the terminal.

Type,

my_DNA=”ATGCGCAT” and press Enter


Then type, my_DNA dot lower open and close brackets .

In a method, we write,

  • The name of the variable first,
  • followed by a period(.),
  • then the name of the method,
  • then we open and close parentheses.

Press Enter.

Highlight  'atgcgcat' The output shows the string in lowercase.
Slide 13

Assignment

As an assignment,
  • Using example of a short protein sequence given
  • Convert the sequence to uppercase
  • Hint: Use upper() method.
Let us go back to terminal again.
Type

my_protein = "alspadkanl"

Lets take an example of an amino acid sequence.

Store it in a variable called my_protein.

So type my_protein = "alspadkanl" and press Enter.

Slide 14 To find out the number of times an amino acid or a sequence of amino acids occurs in a string, we make use of count function.


Type

my_protein.count ('a')

Press Enter

Let us go back to the terminal.

For example, to know the number of times amino acid Alanine occurs in the string, type

my_protein.count ('a') my underscore protein dot count open and close brackets within single quotes a

Press Enter

Highlight 3 Output shows number 3.

There are 3 Alanines in the string.


Type

my_protein.count('l')

Press Enter

Similarly to find number of Leucines in the string, type

my_protein.count('l') my underscore protein dot count open and close brackets within single quotes l

Press Enter

Highlight 2 We get an output as 2.

There are 2 Leucines in the string.

Cursor on the terminal Similarly, we can use DNA or an RNA sequence as string to count the ocurrances of basepairs.
Slide 15

Summary


Let us summarize.

In this tutorial we learnt:

  • Installation of IPython Interpreter
  • Storing data in variables using examples of DNA and Protein sequences.
  • Printing a sequence in single and on two separate lines
Slide 16

Summary

  • Find the length of the string
  • Change case of the string
  • Count the number of times a character appears in a string
Slide 17

Assignment

As an assignment,
  • Calculate GC content in the given DNA sequence.
  • 'ATGGCATGCGC'


Slide 18

About Spoken Tutorial Project


The video available at the following link summarizes the Spoken Tutorial project. Pls watch it.
Slide 19

About Spoken Tutorial workshops


The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass an online test.

For more details, please write to us.

Slide 20

Acknowledgement


Spoken Tutorial Project is supported by NMEICT, MHRD, Government of India.

More information on this Mission is available at this link.

This script is contributed by Snehalatha and Trupti Kini.

And this is Trupti Kini from IIT Bombay signing off.

Thanks for joining.

Contributors and Content Editors

Nancyvarkey, Snehalathak, Trupti