Commit 9f15a02a authored by Blaise Li's avatar Blaise Li
Browse files

Language and details in restriction sites exo.

parent 1eafe0be
Pipeline #58069 passed with stages
in 13 seconds
......@@ -180,7 +180,7 @@ Exercise
For the following exercise use the python file :download:`sv40 in fasta <_static/code/sv40_file.py>` which is a python file with the sequence of sv40 in fasta format
already embeded, and use python -i sv40_file.py to work.
how long is the sv40 in bp?
How long is the sv40 in bp?
Hint : the fasta header is 61bp long.
(http://www.ncbi.nlm.nih.gov/nuccore/J02400.1)
......@@ -202,8 +202,8 @@ pseudocode:
:linenos:
:language: python
:download:`fasta_to_one_line.py <_static/code/fasta_to_one_line.py>` .
:download:`fasta_to_one_line.py <_static/code/fasta_to_one_line.py>`.
::
......@@ -211,18 +211,20 @@ pseudocode:
>>> import sv40_file
>>> import fasta_to_one_line
>>>
>>> sv40_seq = fasta_to_one_line(sv40_file.sv40_fasta)
>>> sv40_seq = fasta_to_one_line(sv40_file.sv40_fasta)
>>> print len(sv40_seq)
5243
Is that the following enzymes:
Consider the following restriction enzymes:
* BamHI (ggatcc),
* EcorI (gaattc),
* HindIII (aagctt),
* SmaI (cccggg)
* BamHI (ggatcc)
* EcorI (gaattc)
* HindIII (aagctt)
* SmaI (cccggg)
have recogition sites in sv40 (just answer by True or False)? ::
For each of them, tell whether it has recogition sites in sv40 (just answer by True or False).
::
>>> "ggatcc".upper() in sv40_sequence
True
......@@ -233,13 +235,16 @@ have recogition sites in sv40 (just answer by True or False)? ::
>>> "cccggg".upper() in sv40_sequence
False
for the enzymes which have a recognition site can you give their positions? ::
For the enzymes which have a recognition site can you give their positions?
::
>>> sv40_sequence = sv40_sequence.lower()
>>> sv40_sequence.find("ggatcc")
2532
>>> # remind the string are numbered from 0
>>> 2532 + 1 = 2533
>>> 2532 + 1
2533
>>> # the recognition motif of BamHI start at 2533
>>> sv40_sequence.find("gaattc")
1781
......@@ -247,13 +252,26 @@ for the enzymes which have a recognition site can you give their positions? ::
>>> sv40_sequence.find("aagctt")
1045
>>> # HindIII -> 1046
is there only one site in sv40 per enzyme?
The ``find`` method give the index of the first occurrence or -1 if the substring is not found.
So we can not determine the occurrences of a site only with the find method.
Is there only one site in sv40 per enzyme?
The ``find`` method gives the index of the first occurrence or -1 if the substring is not found.
So we can not determine the number of occurrences of a site only with the ``find`` method.
We can know how many sites are present with the ``count`` method.
We will see how to determine the site of all occurrences when we learn looping and conditions.
::
>>> sv40_seq.count("ggatcc")
1
>>> sv40_seq.count("gaattc")
1
>>> sv40_seq.count("aagctt")
6
>>> sv40_seq.count("cccggg")
0
We will see how to determine all occurrences of restriction sites when we learn looping and conditions.
Exercise
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment