+
Dr. Ramadan Babers
Faculty of Science - Helwan University
Spring – 2019
Python
LEC - 03
for
Biologists
https://www.linkedin.com/in/ramadan-babers-phd-78976345
+
Printing
and
Manipulating Text
(Exercise)
2
Chapter: 2
3
1- Calculating AT content
Here's a short DNA sequence:
ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT
Write a program that will print out the AT content
of this DNA sequence.
Hint: you can use normal mathematical symbols
like add (+), subtract (-), multiply (*), divide (/)
and parentheses to carry out calculations on
numbers in Python.
4
1- Calculating AT content
5
1- Calculating AT content (Quiz)
Here's a short DNA sequence:
ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT
 Write a program that will print out the AT content of this DNA
sequence.
 Hint: you can use normal mathematical symbols like add (+), subtract
(-), multiply (*), divide (/) and parentheses to carry out calculations on
numbers in Python.
 The result will be as shown below
6
2- Complementing DNA
Here's a short DNA sequence:
ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT
Write a program that will print the complement of this
sequence.
i.e., replace:
A with T,
T with A,
C with G, and
G with C.
7
2- Complementing DNA
8
3- Restriction fragment lengths
Here's a short DNA sequence:
ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT
The sequence contains a recognition site for the EcoRI restriction
enzyme, which cuts at the motif G*AATTC (the position of the cut
is indicated by an asterisk).
Write a program which will calculate the size of the two fragments
that will be produced when the DNA sequence is digested with
EcoRI.
9
3- Restriction fragment lengths
10
3- Restriction fragment lengths (Quiz)
Here's a short DNA sequence:
ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT
The sequence contains a recognition site for the EcoRI restriction enzyme, which cuts at
the motif G*AATTC (the position of the cut is indicated by an asterisk).
Write a program which will calculate the size of the two fragments that will be produced
when the DNA sequence is digested with EcoRI.
Print the DNA
Print the DNA Length
Print Fragment1
Print Fragment2
Print Fragment1 Length
Print Fragment2 Length

Python lec 1004_ch02_excercies

  • 1.
    + Dr. Ramadan Babers Facultyof Science - Helwan University Spring – 2019 Python LEC - 03 for Biologists https://www.linkedin.com/in/ramadan-babers-phd-78976345
  • 2.
  • 3.
    3 1- Calculating ATcontent Here's a short DNA sequence: ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT Write a program that will print out the AT content of this DNA sequence. Hint: you can use normal mathematical symbols like add (+), subtract (-), multiply (*), divide (/) and parentheses to carry out calculations on numbers in Python.
  • 4.
  • 5.
    5 1- Calculating ATcontent (Quiz) Here's a short DNA sequence: ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT  Write a program that will print out the AT content of this DNA sequence.  Hint: you can use normal mathematical symbols like add (+), subtract (-), multiply (*), divide (/) and parentheses to carry out calculations on numbers in Python.  The result will be as shown below
  • 6.
    6 2- Complementing DNA Here'sa short DNA sequence: ACTGATCGATTACGTATAGTATTTGCTATCATACATATATATCGATGCGTTCAT Write a program that will print the complement of this sequence. i.e., replace: A with T, T with A, C with G, and G with C.
  • 7.
  • 8.
    8 3- Restriction fragmentlengths Here's a short DNA sequence: ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT The sequence contains a recognition site for the EcoRI restriction enzyme, which cuts at the motif G*AATTC (the position of the cut is indicated by an asterisk). Write a program which will calculate the size of the two fragments that will be produced when the DNA sequence is digested with EcoRI.
  • 9.
  • 10.
    10 3- Restriction fragmentlengths (Quiz) Here's a short DNA sequence: ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT The sequence contains a recognition site for the EcoRI restriction enzyme, which cuts at the motif G*AATTC (the position of the cut is indicated by an asterisk). Write a program which will calculate the size of the two fragments that will be produced when the DNA sequence is digested with EcoRI. Print the DNA Print the DNA Length Print Fragment1 Print Fragment2 Print Fragment1 Length Print Fragment2 Length