<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,5 +3,5 @@
 '''first script featured on the website
 like a hello world'''
 
-myDNA = &quot;ACGTACGTACGTACGTACGTACGT&quot;
-print(myDNA)
\ No newline at end of file
+dna = &quot;ACGTACGTACGTACGTACGTACGT&quot;
+print(dna)</diff>
      <filename>scripts/original_scripts/3.0/code_01.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,10 +3,10 @@
 '''second script available, shows a simple way to concatenate
 two DNA sequences, strings'''
 
-myDNA = &quot;ACGTACGTACGTACGTACGTACGT&quot;
-myDNA2 = &quot;TCGATCGATCGATCGATCGA&quot;
+dna = &quot;ACGTACGTACGTACGTACGTACGT&quot;
+dna2 = &quot;TCGATCGATCGATCGATCGA&quot;
 print(&quot;First and Second sequences&quot;)
-print(myDNA, myDNA2)
-myDNA3 = myDNA + myDNA2
+print(dna, dna2)
+dna3 = dna + dna2
 print(&quot;Concatenated sequence&quot;)
-print(myDNA3)
\ No newline at end of file
+print(dna3)</diff>
      <filename>scripts/original_scripts/3.0/code_02.py</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ regex module to transcribe DNA to RNA
 import re
 
 #setting the DNA string
-myDNA = 'ACGTTGCAACGTTGCAACGTTGCA'
+dna = 'ACGTTGCAACGTTGCAACGTTGCA'
 
 #assigning a new regex and compiling it 
 #to find all Ts
@@ -16,6 +16,6 @@ regexp = re.compile('T')
 
 #create a new string tha will receive 
 #the regex result with Us replacing Ts
-myRNA = regexp.sub('U', myDNA)
+rna = regexp.sub('U', dna)
 
-print(myRNA)
\ No newline at end of file
+print(rna)</diff>
      <filename>scripts/original_scripts/3.0/code_03.py</filename>
    </modified>
    <modified>
      <diff>@@ -10,4 +10,4 @@ file = open(dnafile, 'r')
 
 #printing each line of the file
 for line in file:
-    print(line, end = '')
+    print(line, end='')</diff>
      <filename>scripts/original_scripts/3.0/code_04.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,5 +3,5 @@
 '''first script featured on the website
 like a hello world'''
 
-myDNA = &quot;ACGTACGTACGTACGTACGTACGT&quot;
-print myDNA
\ No newline at end of file
+dna = &quot;ACGTACGTACGTACGTACGTACGT&quot;
+print dna</diff>
      <filename>scripts/original_scripts/code_01.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,10 +3,10 @@
 '''second script available, shows a simple way to concatenate
 two DNA sequences, strings'''
 
-myDNA = &quot;ACGTACGTACGTACGTACGTACGT&quot;
-myDNA2 = &quot;TCGATCGATCGATCGATCGA&quot;
+dna = &quot;ACGTACGTACGTACGTACGTACGT&quot;
+dna2 = &quot;TCGATCGATCGATCGATCGA&quot;
 print &quot;First and Second sequences&quot;
-print myDNA, myDNA2
-myDNA3 = myDNA + myDNA2
+print dna, dna2
+dna3 = dna + dna2
 print &quot;Concatenated sequence&quot;
-print myDNA3
\ No newline at end of file
+print dna3</diff>
      <filename>scripts/original_scripts/code_02.py</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ regex module to transcribe DNA to RNA
 import re
 
 #setting the DNA string
-myDNA = 'ACGTTGCAACGTTGCAACGTTGCA'
+dna = 'ACGTTGCAACGTTGCAACGTTGCA'
 
 #assigning a new regex and compiling it 
 #to find all Ts
@@ -16,6 +16,6 @@ regexp = re.compile('T')
 
 #create a new string tha will receive 
 #the regex result with Us replacing Ts
-myRNA = regexp.sub('U', myDNA)
+rna = regexp.sub('U', dna)
 
-print myRNA
\ No newline at end of file
+print rna</diff>
      <filename>scripts/original_scripts/code_03.py</filename>
    </modified>
    <modified>
      <diff>@@ -20,25 +20,25 @@ for line in file:
 seqlist = list(sequence)
 
 #initializing integers to store the counts
-totalA = 0
-totalC = 0
-totalG = 0
-totalT = 0
+total_a = 0
+total_c = 0
+total_g = 0
+total_t = 0
 
 #checking each item in the list and updating counts	
 for base in seqlist:
     if base == 'A':
-        totalA += 1
+        total_a += 1
     elif base == 'C':
-        totalC += 1
+        total_c += 1
     elif base == 'G':
-        totalG += 1
+        total_g += 1
     elif base == 'T':
-        totalT += 1
+        total_t += 1
 
-print str(totalA) + ' As found'
-print str(totalC) + ' Cs found'
-print str(totalG) + ' Gs found'
-print str(totalT) + ' Ts found'
+print str(total_a) + ' As found'
+print str(total_c) + ' Cs found'
+print str(total_g) + ' Gs found'
+print str(total_t) + ' Ts found'
 
 </diff>
      <filename>scripts/original_scripts/code_07.py</filename>
    </modified>
    <modified>
      <diff>@@ -13,14 +13,14 @@ seqlist = open(dnafile, 'r').readlines()
 temp = ''.join(seqlist)
 
 #counting
-totalA = temp.count('A')
-totalC = temp.count('C')
-totalG = temp.count('G')
-totalT = temp.count('T')
+total_a = temp.count('A')
+total_c = temp.count('C')
+total_g = temp.count('G')
+total_t = temp.count('T')
 
 #printing results
-print str(totalA) + ' As found'
-print str(totalC) + ' Cs found'
-print str(totalG) + ' Gs found'
-print str(totalT) + ' Ts found'
+print str(total_a) + ' As found'
+print str(total_c) + ' Cs found'
+print str(total_g) + ' Gs found'
+print str(total_t) + ' Ts found'
 </diff>
      <filename>scripts/original_scripts/code_08.py</filename>
    </modified>
    <modified>
      <diff>@@ -24,10 +24,10 @@ while fileentered == True:
             #remove carriage returns
             sequence = sequence.replace('\n', '')
             #counting
-            totalA = sequence.count('A')
-            totalC = sequence.count('C')
-            totalG = sequence.count('G')
-            totalT = sequence.count('T')
+            total_a = sequence.count('A')
+            total_c = sequence.count('C')
+            total_g = sequence.count('G')
+            total_t = sequence.count('T')
             #create a regex object with non-nucleotide letters to check for &quot;errors&quot;
             otherletter = re.compile('[BDEFHIJKLMNOPQRSUVXZ]+')
             #find possible non-nucleotides
@@ -36,10 +36,10 @@ while fileentered == True:
             output = open(filename + '.count', 'w')
             #writing the output
             output.write('Count report for file ' + filename + '\n')
-            output.write('A = ' + str(totalA) + '\n')
-            output.write('C = ' + str(totalC) + '\n')
-            output.write('G = ' + str(totalG) + '\n')
-            output.write('T = ' + str(totalT) + '\n')
+            output.write('A = ' + str(total_a) + '\n')
+            output.write('C = ' + str(total_c) + '\n')
+            output.write('G = ' + str(total_g) + '\n')
+            output.write('T = ' + str(total_t) + '\n')
             #if there are non-nucleotides in the sequence, report them
             if len(extra) &gt; 0:
                 output.write('Also were found ' + str(len(extra)) + ' errors\n')
@@ -53,4 +53,4 @@ while fileentered == True:
     else:
         #if no filename entered, exit
         fileentered = False
-        sys.exit()
\ No newline at end of file
+        sys.exit()</diff>
      <filename>scripts/original_scripts/code_09.py</filename>
    </modified>
    <modified>
      <diff>@@ -9,15 +9,15 @@ import sys
 def count_nucleotide_types(seq):
     '''counting nucleotides and returning a list with counts'''
     result = []
-    totalA = seq.count('A')
-    totalC = seq.count('C')
-    totalG = seq.count('G')
-    totalT = seq.count('T')
+    total_a = seq.count('A')
+    total_c = seq.count('C')
+    total_g = seq.count('G')
+    total_t = seq.count('T')
 
-    result.append(totalA)
-    result.append(totalC)
-    result.append(totalG)
-    result.append(totalT)
+    result.append(total_a)
+    result.append(total_c)
+    result.append(total_g)
+    result.append(total_t)
 
     return result
 </diff>
      <filename>scripts/original_scripts/code_11.py</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ extremely simple script to DNA transcription
 '''
 
 
-myDNA = 'ACGTTGCAACGTTGCAACGTTGCA'
+dna = 'ACGTTGCAACGTTGCAACGTTGCA'
 #string buil-in replace method
-myRNA = myDNA.replace('T', 'U')
-print myRNA
+rna = dna.replace('T', 'U')
+print rna</diff>
      <filename>scripts/original_scripts/code_16.py</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ def read_fasta(file):
         if line.startswith(&quot;&gt;&quot;):
            if index &gt;= 1:
                items.append(aninstance)
-           index+=1
+           index += 1
            name = line[:-1]
            seq = ''
            aninstance = Fasta(name, seq)
@@ -19,4 +19,4 @@ def read_fasta(file):
            aninstance = Fasta(name, seq)
 
     items.append(aninstance)
-    return items
\ No newline at end of file
+    return items</diff>
      <filename>scripts/original_scripts/code_26.py</filename>
    </modified>
    <modified>
      <diff>@@ -5,14 +5,15 @@ import fasta
 
 file = sys.argv[1]
 temp = file.split('.')
-filename = temp[0]
+filename_base = temp[0]
 tag = temp[1]
 
 sequences = fasta.read_fasta(open(file, 'r').readlines())
 
 count = 1
 for i in sequences:
-    output = open(filename+'_'+str(count)+'.'+tag, 'w')
-    output.write(i.name+'\n')
+    f = filename_base + '_' + str(count) + '.' + tag
+    output = open(f, 'w')
+    output.write(i.name + '\n')
     output.write(i.sequence)
-    count += 1
\ No newline at end of file
+    count += 1</diff>
      <filename>scripts/original_scripts/code_27.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,4 +4,4 @@ import fasta
 import sys
 
 data = fasta.read_seqs(open(sys.argv[1], 'r').readlines())
-print map(lambda seq:len(seq), data)
+print [len(seq) for seq in data]</diff>
      <filename>scripts/original_scripts/code_30.py</filename>
    </modified>
    <modified>
      <diff>@@ -18,13 +18,13 @@ for line in open(file, 'r'):
             segment.append(line.strip())
             linesize = len(line.strip())
 
-startline = (start/linesize) + 1
-endline = (end/linesize)+1
+startline = (start / linesize) + 1
+endline = (end / linesize) + 1
 
 if not start % linesize == 0 and not end % linesize == 0:
     segment[0] = segment[0][startline*linesize-start:]
     segment[-1] = segment[-1][endline*linesize-end:]
-elif not start %linesize == 0:
+elif not start % linesize == 0:
     segment[0] = segment[0][startline*linesize-start:]
 elif not end % linesize == 0:
     segment[-1] = segment[-1][endline*linesize-end:]</diff>
      <filename>scripts/original_scripts/code_32.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 from collections import defaultdict
+
 def merge_seqs(data1, data2):
     first, second = defaultdict(list), defaultdict(list)
     for i in data1:
@@ -11,8 +12,8 @@ def merge_seqs(data1, data2):
 
     flist = []
     for i in shared_ids:
-        cross = [(a,b) for a in first[i] for b in second[i]]
-        for j,k in cross:
+        cross = ((a,b) for a in first[i] for b in second[i])
+        for j, k in cross:
             tempname = j.name + &#8216;-&#8217; + k.name + &#8216;-&gt;&#8217; + str(len(j.sequence))
             tempseq = j.sequence + k.sequence
             flist.append(tempname + &#8216;\n&#8217; + tempseq)</diff>
      <filename>scripts/original_scripts/code_38.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 from collections import defaultdict
+
 def merge_seqs(data1, data2):
     first, second = defaultdict(list), defaultdict(list)
     for i in data1:
@@ -11,8 +12,8 @@ def merge_seqs(data1, data2):
 
     flist = []
     for i in shared_ids:
-        cross = [(a,b) for a in first[i] for b in second[i]]
-        for j,k in cross:
+        cross = ((a,b) for a in first[i] for b in second[i])
+        for j, k in cross:
             tempname = j.name + '-' + k.name + '-&amp;gt;'&#8217; + str(len(j.sequence))
             tempseq = j.sequence + k.sequence
             flist.append(tempname + '\n' + tempseq)</diff>
      <filename>scripts/original_scripts/code_39.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b7780f146067326205fa47fec7a5389cfa67da37</id>
    </parent>
  </parents>
  <author>
    <name>Paulo Nuin</name>
    <email>nuin@iMacNuin.gateway.2wire.net</email>
  </author>
  <url>http://github.com/nuin/beginning-python-for-bioinformatics/commit/b33813f4ec11a59a5c6381cc5b78044824d25e3f</url>
  <id>b33813f4ec11a59a5c6381cc5b78044824d25e3f</id>
  <committed-date>2009-01-31T09:41:49-08:00</committed-date>
  <authored-date>2009-01-31T09:41:49-08:00</authored-date>
  <message>patch applied, PEP 8 compliant</message>
  <tree>43d7d8ec8483baf35959861d1b5850c0c5604b5e</tree>
  <committer>
    <name>Paulo Nuin</name>
    <email>nuin@iMacNuin.gateway.2wire.net</email>
  </committer>
</commit>
