diff --git a/source/Data_Types.rst b/source/Data_Types.rst index 65de161c593407ac7d408e06fe80f9de63671b94..100eee458510c24c876d6bcfbc091a59253eb3b6 100644 --- a/source/Data_Types.rst +++ b/source/Data_Types.rst @@ -181,8 +181,8 @@ create a representation in fasta format of following sequence : Exercise -------- -For the following exercise use the python file :download:`sv40 in fasta <_static/code/sv40.py>` which is a python file with the sequence of sv40 in fasta format -already embeded, and use python -i sv40.py to work. +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? Hint : the fasta header is 61bp long. @@ -212,14 +212,15 @@ pseudocode: :: python - >>> import sv40 + >>> import sv40_file >>> import fasta_to_one_line >>> - >>> sv40seq = fasta_to_one_line(sv40) - >>> print len(sv40_sequence) + >>> sv40_seq = fasta_to_one_line(sv40_file.sv40_fasta) + >>> print len(sv40_seq) 5243 Is that the following enzymes: + * BamHI (ggatcc), * EcorI (gaattc), * HindIII (aagctt), diff --git a/source/_static/code/fasta_to_one_line.py b/source/_static/code/fasta_to_one_line.py index 6ef59c05b921f85ff9fe6886321b83a0f696008e..86b86b9104a5ab01097e31618c6fcb88aa2e6763 100644 --- a/source/_static/code/fasta_to_one_line.py +++ b/source/_static/code/fasta_to_one_line.py @@ -1,7 +1,7 @@ -def fasta_2_one_line(seq): - header_end_at = find('\n') - seq = seq[:header_end_at + 1] +def fasta_to_one_line(seq): + header_end_at = seq.find('\n') + seq = seq[header_end_at + 1:] seq = seq.replace('\n', '') return seq