Skip to content
This repository
Browse code

Fix spacing around inline comments (E261, E262).

  • Loading branch information...
commit 10a632018ed516a90162ee59c9e6c424728d7ddc 1 parent f57bace
Christian Brueffer authored

Showing 44 changed files with 171 additions and 171 deletions. Show diff stats Hide diff stats

  1. 2  Tests/run_tests.py
  2. 4  Tests/seq_tests_common.py
  3. 6  Tests/test_AlignIO.py
  4. 4  Tests/test_CAPS.py
  5. 10  Tests/test_CodonTable.py
  6. 22  Tests/test_Emboss.py
  7. 2  Tests/test_EmbossPhylipNew.py
  8. 30  Tests/test_GenomeDiagram.py
  9. 2  Tests/test_LogisticRegression.py
  10. 2  Tests/test_MMCIF.py
  11. 2  Tests/test_MarkovModel.py
  12. 16  Tests/test_Muscle_tool.py
  13. 2  Tests/test_NCBITextParser.py
  14. 16  Tests/test_NCBIXML.py
  15. 2  Tests/test_PAML_tools.py
  16. 2  Tests/test_PDB.py
  17. 2  Tests/test_PDB_KDTree.py
  18. 22  Tests/test_Pathway.py
  19. 2  Tests/test_PopGen_DFDist.py
  20. 2  Tests/test_PopGen_FDist.py
  21. 4  Tests/test_PopGen_FDist_nodepend.py
  22. 2  Tests/test_PopGen_GenePop.py
  23. 4  Tests/test_PopGen_GenePop_EasyController.py
  24. 2  Tests/test_PopGen_GenePop_nodepend.py
  25. 2  Tests/test_PopGen_SimCoal.py
  26. 6  Tests/test_Prank_tool.py
  27. 2  Tests/test_SVDSuperimposer.py
  28. 2  Tests/test_SearchIO_index.py
  29. 50  Tests/test_SeqIO.py
  30. 2  Tests/test_SeqIO_FastaIO.py
  31. 2  Tests/test_SeqIO_PdbIO.py
  32. 6  Tests/test_SeqIO_QualityIO.py
  33. 2  Tests/test_SeqIO_convert.py
  34. 18  Tests/test_SeqIO_features.py
  35. 22  Tests/test_SeqIO_index.py
  36. 4  Tests/test_SeqIO_write.py
  37. 4  Tests/test_SeqRecord.py
  38. 10  Tests/test_Seq_objs.py
  39. 2  Tests/test_SubsMat.py
  40. 2  Tests/test_TCoffee_tool.py
  41. 20  Tests/test_TogoWS.py
  42. 4  Tests/test_Uniprot.py
  43. 6  Tests/test_bgzf.py
  44. 12  Tests/test_seq.py
2  Tests/run_tests.py
@@ -139,7 +139,7 @@ def is_numpy():
139 139
     DOCTEST_MODULES.remove("Bio.SearchIO._model.hit")
140 140
     DOCTEST_MODULES.remove("Bio.SearchIO._model.hsp")
141 141
 
142  
-system_lang = os.environ.get('LANG', 'C') #Cache this
  142
+system_lang = os.environ.get('LANG', 'C')  # Cache this
143 143
 
144 144
 
145 145
 def main(argv):
4  Tests/seq_tests_common.py
@@ -209,8 +209,8 @@ def compare_sequence(old, new):
209 209
         assert expected == new[i]
210 210
 
211 211
     #Test slices
212  
-    indices.append(ln) #check copes with overflows
213  
-    indices.append(ln+1000) #check copes with overflows
  212
+    indices.append(ln)  # check copes with overflows
  213
+    indices.append(ln + 1000)  # check copes with overflows
214 214
     for i in indices:
215 215
         for j in indices:
216 216
             expected = s[i:j]
6  Tests/test_AlignIO.py
@@ -30,10 +30,10 @@
30 30
     ("clustal", 7, 1, 'Clustalw/opuntia.aln'),
31 31
     ("clustal", 5, 1, 'Clustalw/hedgehog.aln'),
32 32
     ("clustal", 2, 1, 'Clustalw/odd_consensus.aln'),
33  
-    ("clustal",20, 1, 'Clustalw/protein.aln'), #Used in the tutorial
34  
-    ("clustal",20, 1, 'Clustalw/promals3d.aln'), #Nonstandard header
  33
+    ("clustal",20, 1, 'Clustalw/protein.aln'),  # Used in the tutorial
  34
+    ("clustal",20, 1, 'Clustalw/promals3d.aln'),  # Nonstandard header
35 35
 #Following examples are also used in test_GFF.py
36  
-    ("fasta", 3, 1, 'GFF/multi.fna'), #Trivial nucleotide alignment
  36
+    ("fasta", 3, 1, 'GFF/multi.fna'),  # Trivial nucleotide alignment
37 37
 #Following example is also used in test_Nexus.py
38 38
     ("nexus", 9, 1, 'Nexus/test_Nexus_input.nex'),
39 39
     ("nexus", 2, 1, 'Nexus/codonposset.nex'),
4  Tests/test_CAPS.py
@@ -80,11 +80,11 @@ def testNoCAPS(self):
80 80
 
81 81
     def test_uneven(self):
82 82
         alignment = ["aaaaaaaaaaaaaa",
83  
-                     "aaaaaaaaaaaaaa", #we'll change this below
  83
+                     "aaaaaaaaaaaaaa",  # we'll change this below
84 84
                      "aaaaaaaaaaaaaa",
85 85
                     ]
86 86
         align = createAlignment(alignment, Alphabet.generic_nucleotide)
87  
-        align[1].seq = align[1].seq[:8] #evil
  87
+        align[1].seq = align[1].seq[:8]  # evil
88 88
         self.assertRaises(CAPS.AlignmentHasDifferentLengthsError,
89 89
                           CAPS.CAPSMap,
90 90
                           align)
10  Tests/test_CodonTable.py
@@ -22,11 +22,11 @@
22 22
     assert ambiguous_rna_by_id[n].forward_table["GUU"] == "V"
23 23
     assert ambiguous_rna_by_id[n].forward_table["GUN"] == "V"
24 24
     if n != 23 :
25  
-        assert ambiguous_rna_by_id[n].forward_table["UUN"] == "X" #F or L
  25
+        assert ambiguous_rna_by_id[n].forward_table["UUN"] == "X"  # F or L
26 26
 
27 27
     assert ambiguous_dna_by_id[n].forward_table["GTT"] == "V"
28 28
     if n != 23 :
29  
-        assert ambiguous_dna_by_id[n].forward_table["TTN"] == "X" #F or L
  29
+        assert ambiguous_dna_by_id[n].forward_table["TTN"] == "X"  # F or L
30 30
     assert ambiguous_dna_by_id[n].forward_table["GTN"] == "V"
31 31
 
32 32
     if n != 23 :
@@ -35,14 +35,14 @@
35 35
     assert ambiguous_generic_by_id[n].forward_table["GUU"] == "V"
36 36
     assert ambiguous_generic_by_id[n].forward_table["GUN"] == "V"
37 37
     if n != 23 :
38  
-        assert ambiguous_generic_by_id[n].forward_table["UUN"] == "X" #F or L
  38
+        assert ambiguous_generic_by_id[n].forward_table["UUN"] == "X"  # F or L
39 39
     assert ambiguous_generic_by_id[n].forward_table["GTT"] == "V"
40 40
     if n != 23 :
41  
-        assert ambiguous_generic_by_id[n].forward_table["TTN"] == "X" #F or L
  41
+        assert ambiguous_generic_by_id[n].forward_table["TTN"] == "X"  # F or L
42 42
     assert ambiguous_generic_by_id[n].forward_table["GTN"] == "V"
43 43
     #And finally something evil, an RNA-DNA mixture:
44 44
     if n != 23 :
45  
-        assert ambiguous_generic_by_id[n].forward_table["UTN"] == "X" #F or L
  45
+        assert ambiguous_generic_by_id[n].forward_table["UTN"] == "X"  # F or L
46 46
     assert ambiguous_generic_by_id[n].forward_table["UTU"] == "F"
47 47
 
48 48
     #R = A or G, so URR = UAA or UGA / TRA = TAA or TGA = stop codons
22  Tests/test_Emboss.py
@@ -27,7 +27,7 @@
27 27
 
28 28
 exes_wanted = ["water", "needle", "seqret", "transeq", "seqmatchall",
29 29
                "embossversion"]
30  
-exes = dict() #Dictionary mapping from names to exe locations
  30
+exes = dict()  # Dictionary mapping from names to exe locations
31 31
 
32 32
 if "EMBOSS_ROOT" in os.environ:
33 33
     #Windows default installation path is C:\mEMBOSS which contains the exes.
@@ -63,9 +63,9 @@ def get_emboss_version():
63 63
                              universal_newlines=True,
64 64
                              shell=(sys.platform!="win32"))
65 65
     stdout, stderr = child.communicate()
66  
-    child.stdout.close() #This is both stdout and stderr
  66
+    child.stdout.close()  # This is both stdout and stderr
67 67
     del child
68  
-    assert stderr is None #Send to stdout instead
  68
+    assert stderr is None  # Send to stdout instead
69 69
     for line in stdout.split("\n"):
70 70
         if line.strip()=="Reports the current EMBOSS version number":
71 71
             pass
@@ -102,7 +102,7 @@ def emboss_convert(filename, old_format, new_format):
102 102
                               sequence = filename,
103 103
                               sformat = old_format,
104 104
                               osformat = new_format,
105  
-                              auto = True, #no prompting
  105
+                              auto = True,  # no prompting
106 106
                               stdout = True)
107 107
     #Run the tool,
108 108
     child = subprocess.Popen(str(cline),
@@ -124,7 +124,7 @@ def emboss_piped_SeqIO_convert(records, old_format, new_format):
124 124
     cline = SeqretCommandline(exes["seqret"],
125 125
                               sformat = old_format,
126 126
                               osformat = new_format,
127  
-                              auto = True, #no prompting
  127
+                              auto = True,  # no prompting
128 128
                               filter = True)
129 129
     #Run the tool,
130 130
     child = subprocess.Popen(str(cline),
@@ -151,7 +151,7 @@ def emboss_piped_AlignIO_convert(alignments, old_format, new_format):
151 151
     cline = SeqretCommandline(exes["seqret"],
152 152
                               sformat = old_format,
153 153
                               osformat = new_format,
154  
-                              auto = True, #no prompting
  154
+                              auto = True,  # no prompting
155 155
                               filter = True)
156 156
     #Run the tool,
157 157
     child = subprocess.Popen(str(cline),
@@ -410,7 +410,7 @@ def test_align_clustalw(self):
410 410
         self.check_AlignIO_with_EMBOSS("Clustalw/hedgehog.aln", "clustal")
411 411
         self.check_AlignIO_with_EMBOSS("Clustalw/opuntia.aln", "clustal")
412 412
         self.check_AlignIO_with_EMBOSS("Clustalw/odd_consensus.aln", "clustal",
413  
-                               skip_formats=["nexus"]) #TODO - why not nexus?
  413
+                               skip_formats=["nexus"])  # TODO - why not nexus?
414 414
         self.check_AlignIO_with_EMBOSS("Clustalw/protein.aln", "clustal")
415 415
         self.check_AlignIO_with_EMBOSS("Clustalw/promals3d.aln", "clustal")
416 416
 
@@ -676,8 +676,8 @@ def test_needle_piped2(self):
676 676
         cline = exes["needle"]
677 677
         cline += " -asequence asis:" + query
678 678
         cline += " -bsequence Fasta/f002"
679  
-        cline += " -auto" #no prompting
680  
-        cline += " -filter" #use stdout
  679
+        cline += " -auto"  # no prompting
  680
+        cline += " -filter"  # use stdout
681 681
         #Run the tool,
682 682
         child = subprocess.Popen(str(cline),
683 683
                                  stdin=subprocess.PIPE,
@@ -776,8 +776,8 @@ def emboss_translate(sequence, table=None, frame=None):
776 776
         SeqIO.write(SeqRecord(sequence, id="Test"), filename, "fasta")
777 777
         cline += " -sequence %s" % filename
778 778
 
779  
-    cline += " -auto" #no prompting
780  
-    cline += " -filter" #use stdout
  779
+    cline += " -auto"  # no prompting
  780
+    cline += " -filter"  # use stdout
781 781
     if table is not None:
782 782
         cline += " -table %s" % str(table)
783 783
     if frame is not None:
2  Tests/test_EmbossPhylipNew.py
@@ -22,7 +22,7 @@
22 22
 
23 23
 exes_wanted = ['fdnadist', 'fneighbor', 'fprotdist','fprotpars','fconsense',
24 24
                'fseqboot', 'ftreedist', 'fdnapars']
25  
-exes = dict() #Dictionary mapping from names to exe locations
  25
+exes = dict()  # Dictionary mapping from names to exe locations
26 26
 
27 27
 if "EMBOSS_ROOT" in os.environ:
28 28
     #Windows default installation path is C:\mEMBOSS which contains the exes.
30  Tests/test_GenomeDiagram.py
@@ -163,7 +163,7 @@ def calc_gc_skew(sequence):
163 163
     g = sequence.count('G') + sequence.count('g')
164 164
     c = sequence.count('C') + sequence.count('c')
165 165
     if g+c == 0:
166  
-        return 0.0 #TODO - return NaN or None here?
  166
+        return 0.0  # TODO - return NaN or None here?
167 167
     else:
168 168
         return (g-c)/float(g+c)
169 169
 
@@ -178,7 +178,7 @@ def calc_at_skew(sequence):
178 178
     a = sequence.count('A') + sequence.count('a')
179 179
     t = sequence.count('T') + sequence.count('t')
180 180
     if a+t == 0:
181  
-        return 0.0 #TODO - return NaN or None here?
  181
+        return 0.0  # TODO - return NaN or None here?
182 182
     else:
183 183
         return (a-t)/float(a+t)
184 184
 
@@ -257,7 +257,7 @@ def test_limits(self):
257 257
         #Circular diagram
258 258
         gdd.draw(tracklines=False,
259 259
                  pagesize=(15*cm,15*cm),
260  
-                 circular=True, #Data designed to be periodic
  260
+                 circular=True,  # Data designed to be periodic
261 261
                  start=0, end=points, circle_core=0.5)
262 262
         gdd.write(os.path.join('Graphics', "line_graph_c.pdf"), "pdf")
263 263
 
@@ -454,7 +454,7 @@ def test_arrow_heads(self):
454 454
         self.add_track_with_sigils(sigil="ARROW", color="orange",
455 455
                                    arrowhead_length=1)
456 456
         self.add_track_with_sigils(sigil="ARROW", color="red",
457  
-                                   arrowhead_length=10000) #Triangles
  457
+                                   arrowhead_length=10000)  # Triangles
458 458
         self.assertEqual(len(self.gdd.tracks), 4)
459 459
         self.finish("GD_sigil_arrows")
460 460
 
@@ -570,7 +570,7 @@ def setUp(self):
570 570
     def test_write_arguments(self):
571 571
         """Check how the write methods respond to output format arguments."""
572 572
         gdd = Diagram('Test Diagram')
573  
-        gdd.drawing = None #Hack - need the ReportLab drawing object to be created.
  573
+        gdd.drawing = None  # Hack - need the ReportLab drawing object to be created.
574 574
         filename = os.path.join("Graphics","error.txt")
575 575
         #We (now) allow valid formats in any case.
576 576
         for output in ["XXX","xxx",None,123,5.9]:
@@ -631,7 +631,7 @@ def test_partial_diagram(self):
631 631
             #Note that I am using strings for color names, instead
632 632
             #of passing in color objects.  This should also work!
633 633
             if len(gds_features) % 2 == 0:
634  
-                color = "white" #for testing the automatic black border!
  634
+                color = "white"  # for testing the automatic black border!
635 635
             else:
636 636
                 color = "red"
637 637
             #Checking it can cope with the old UK spelling colour.
@@ -877,10 +877,10 @@ def test_diagram_via_object_pdf(self):
877 877
         #gdfs1.set_all_features('color', colors.red)
878 878
         gdfs2.set_all_features('color', colors.blue)
879 879
 
880  
-        gdt1.add_set(gdfsA) #Before CDS so under them!
  880
+        gdt1.add_set(gdfsA)  # Before CDS so under them!
881 881
         gdt1.add_set(gdfs1)
882 882
 
883  
-        gdt2.add_set(gdfsB) #Before genes so under them!
  883
+        gdt2.add_set(gdfsB)  # Before genes so under them!
884 884
         gdt2.add_set(gdfs2)
885 885
 
886 886
         gdt3 = Track('misc features and repeats', greytrack=1,
@@ -924,7 +924,7 @@ def test_diagram_via_object_pdf(self):
924 924
         gdt5.add_set(gdgs2)
925 925
 
926 926
         gdgs3 = GraphSet('Di-nucleotide count')
927  
-        step = len(genbank_entry)//400 #smaller step
  927
+        step = len(genbank_entry) // 400  # smaller step
928 928
         gdgs3.new_graph(apply_to_window(genbank_entry.seq, step, calc_dinucleotide_counts, step),
929 929
                         'Di-nucleotide count', style='heat',
930 930
                         color=colors.red, altcolor=colors.orange)
@@ -933,12 +933,12 @@ def test_diagram_via_object_pdf(self):
933 933
 
934 934
         #Add the tracks (from both features and graphs)
935 935
         #Leave some white space in the middle/bottom
936  
-        gdd.add_track(gdt4, 3) # GC skew
937  
-        gdd.add_track(gdt5, 4) # GC and AT content
938  
-        gdd.add_track(gdt1, 5) # CDS features
939  
-        gdd.add_track(gdt2, 6) # Gene features
940  
-        gdd.add_track(gdt3, 7) # Misc features and repeat feature
941  
-        gdd.add_track(gdt6, 8) # Feature depth
  936
+        gdd.add_track(gdt4, 3)  # GC skew
  937
+        gdd.add_track(gdt5, 4)  # GC and AT content
  938
+        gdd.add_track(gdt1, 5)  # CDS features
  939
+        gdd.add_track(gdt2, 6)  # Gene features
  940
+        gdd.add_track(gdt3, 7)  # Misc features and repeat feature
  941
+        gdd.add_track(gdt6, 8)  # Feature depth
942 942
 
943 943
         #Finally draw it in both formats, and full view and partial
944 944
         gdd.draw(format='circular', orientation='landscape',
2  Tests/test_LogisticRegression.py
@@ -8,7 +8,7 @@
8 8
 
9 9
 try:
10 10
     import numpy
11  
-    from numpy import linalg #missing in PyPy's micronumpy
  11
+    from numpy import linalg  # missing in PyPy's micronumpy
12 12
 except ImportError:
13 13
     from Bio import MissingExternalDependencyError
14 14
     raise MissingExternalDependencyError(
2  Tests/test_MMCIF.py
@@ -16,7 +16,7 @@
16 16
 
17 17
 try:
18 18
     import numpy
19  
-    from numpy import dot #Missing on PyPy's micronumpy
  19
+    from numpy import dot  # Missing on PyPy's micronumpy
20 20
     del dot
21 21
 except ImportError:
22 22
     from Bio import MissingPythonDependencyError
2  Tests/test_MarkovModel.py
@@ -4,7 +4,7 @@
4 4
 
5 5
 try:
6 6
     from numpy import array
7  
-    from numpy import random #missing in PyPy's micronumpy
  7
+    from numpy import random  # missing in PyPy's micronumpy
8 8
 except ImportError:
9 9
     from Bio import MissingPythonDependencyError
10 10
     raise MissingPythonDependencyError(
16  Tests/test_Muscle_tool.py
@@ -29,7 +29,7 @@
29 29
     #a Muscle directory with the muscle.exe file plus a readme etc,
30 30
     #which the user could put anywhere.  We'll try a few sensible
31 31
     #locations under Program Files... and then the full path.
32  
-    likely_dirs = ["", #Current dir
  32
+    likely_dirs = ["",  # Current dir
33 33
                    prog_files,
34 34
                    os.path.join(prog_files,"Muscle3.6"),
35 35
                    os.path.join(prog_files,"Muscle3.7"),
@@ -65,7 +65,7 @@ def setUp(self):
65 65
         self.infile1 = "Fasta/f002"
66 66
         self.infile2 = "Fasta/fa01"
67 67
         self.infile3 = "Fasta/f001"
68  
-        self.outfile1 = "Fasta/temp align out1.fa" #with spaces!
  68
+        self.outfile1 = "Fasta/temp align out1.fa"  # with spaces!
69 69
         self.outfile2 = "Fasta/temp_align_out2.fa"
70 70
         self.outfile3 = "Fasta/temp_align_out3.fa"
71 71
         self.outfile4 = "Fasta/temp_align_out4.fa"
@@ -95,7 +95,7 @@ def test_Muscle_simple(self):
95 95
     def test_Muscle_with_options(self):
96 96
         """Round-trip through app with a switch and valued option"""
97 97
         cmdline = MuscleCommandline(muscle_exe)
98  
-        cmdline.set_parameter("input", self.infile1) #"input" is alias for "in"
  98
+        cmdline.set_parameter("input", self.infile1)  # "input" is alias for "in"
99 99
         cmdline.set_parameter("out", self.outfile2)
100 100
         #Use property:
101 101
         cmdline.objscore = "sp"
@@ -196,7 +196,7 @@ def test_simple_clustal(self):
196 196
                                  shell=(sys.platform!="win32"))
197 197
         #Didn't use -quiet so there should be progress reports on stderr,
198 198
         align = AlignIO.read(child.stdout, "clustal")
199  
-        align.sort() #by record.id
  199
+        align.sort()  # by record.id
200 200
         self.assertTrue(child.stderr.read().strip().startswith("MUSCLE"))
201 201
         return_code = child.wait()
202 202
         self.assertEqual(return_code, 0)
@@ -218,7 +218,7 @@ def test_simple_clustal_strict(self):
218 218
         cmdline = MuscleCommandline(muscle_exe)
219 219
         cmdline.set_parameter("in", input_file)
220 220
         #Use clustal output (with a CLUSTAL header)
221  
-        cmdline.set_parameter("clwstrict", True) #Default None treated as False!
  221
+        cmdline.set_parameter("clwstrict", True)  # Default None treated as False!
222 222
         self.assertEqual(str(cmdline).rstrip(), muscle_exe +
223 223
                          " -in Fasta/f002 -clwstrict")
224 224
         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
@@ -252,13 +252,13 @@ def test_long(self):
252 252
         cmdline.set_parameter("in", temp_large_fasta_file)
253 253
         #Use fast options
254 254
         cmdline.set_parameter("maxiters", 1)
255  
-        cmdline.set_parameter("diags", True) #Default None treated as False!
  255
+        cmdline.set_parameter("diags", True)  # Default None treated as False!
256 256
         #Use clustal output
257  
-        cmdline.set_parameter("clwstrict", True) #Default None treated as False!
  257
+        cmdline.set_parameter("clwstrict", True)  # Default None treated as False!
258 258
         #Shoudn't need this, but just to make sure it is accepted
259 259
         cmdline.set_parameter("maxhours", 0.1)
260 260
         #No progress reports to stderr
261  
-        cmdline.set_parameter("quiet", True) #Default None treated as False!
  261
+        cmdline.set_parameter("quiet", True)  # Default None treated as False!
262 262
         self.assertEqual(str(cmdline).rstrip(), muscle_exe +
263 263
                          " -in temp_cw_prot.fasta -diags -maxhours 0.1" +
264 264
                          " -maxiters 1 -clwstrict -quiet")
2  Tests/test_NCBITextParser.py
@@ -14192,7 +14192,7 @@ def test_text_2215L_blastx_001(self):
14192 14192
         self.assertEqual(record.application, "BLASTX")
14193 14193
         self.assertEqual(record.version, '2.2.15')
14194 14194
         self.assertEqual(record.date, "Oct-15-2006")
14195  
-        self.assertEqual(record.query, "66118") #Odd name for a query sequence, but valid!
  14195
+        self.assertEqual(record.query, "66118")  # Odd name for a query sequence, but valid!
14196 14196
         self.assertEqual(record.query_letters, 662)
14197 14197
         self.assertEqual(record.database, "Leigo")
14198 14198
         self.assertEqual(record.database_sequences, 4535438)
16  Tests/test_NCBIXML.py
@@ -1609,7 +1609,7 @@ def test_xml_2222_blastx_001(self):
1609 1609
         self.assertEqual(record.num_sequences_in_database, 8994603)
1610 1610
         self.assertEqual(record.database_sequences, 8994603)
1611 1611
         #self.assertEqual(record.database_length, 3078807967)
1612  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1612
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1613 1613
         self.assertEqual(len(record.descriptions), 1)
1614 1614
         self.assertEqual(len(record.alignments), 1)
1615 1615
         self.assertEqual(len(record.alignments[0].hsps), 1)
@@ -1624,7 +1624,7 @@ def test_xml_2222_blastx_001(self):
1624 1624
         self.assertEqual(record.num_sequences_in_database, 8994603)
1625 1625
         self.assertEqual(record.database_sequences, 8994603)
1626 1626
         #self.assertEqual(record.database_length, 3078807967)
1627  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1627
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1628 1628
         # I used -num_descriptions 10 and -num_alignments 1
1629 1629
         self.assertEqual(len(record.descriptions), 10)
1630 1630
         self.assertEqual(len(record.alignments), 10)
@@ -1642,7 +1642,7 @@ def test_xml_2222_blastx_001(self):
1642 1642
         self.assertEqual(record.num_sequences_in_database, 8994603)
1643 1643
         self.assertEqual(record.database_sequences, 8994603)
1644 1644
         #self.assertEqual(record.database_length, 3078807967)
1645  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1645
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1646 1646
         self.assertEqual(len(record.descriptions), 0)
1647 1647
         self.assertEqual(len(record.alignments), 0)
1648 1648
 
@@ -1656,7 +1656,7 @@ def test_xml_2222_blastx_001(self):
1656 1656
         self.assertEqual(record.num_sequences_in_database, 8994603)
1657 1657
         self.assertEqual(record.database_sequences, 8994603)
1658 1658
         #self.assertEqual(record.database_length, 3078807967)
1659  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1659
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1660 1660
         self.assertEqual(len(record.descriptions), 10)
1661 1661
         self.assertEqual(len(record.alignments), 10)
1662 1662
         self.assertEqual(len(record.alignments[0].hsps), 1)
@@ -1672,7 +1672,7 @@ def test_xml_2222_blastx_001(self):
1672 1672
         self.assertEqual(record.num_sequences_in_database, 8994603)
1673 1673
         self.assertEqual(record.database_sequences, 8994603)
1674 1674
         #self.assertEqual(record.database_length, 3078807967)
1675  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1675
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1676 1676
         self.assertEqual(len(record.descriptions), 10)
1677 1677
         self.assertEqual(len(record.alignments), 10)
1678 1678
         self.assertEqual(len(record.alignments[0].hsps), 2)
@@ -1688,7 +1688,7 @@ def test_xml_2222_blastx_001(self):
1688 1688
         self.assertEqual(record.num_sequences_in_database, 8994603)
1689 1689
         self.assertEqual(record.database_sequences, 8994603)
1690 1690
         #self.assertEqual(record.database_length, 3078807967)
1691  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1691
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1692 1692
         self.assertEqual(len(record.descriptions), 10)
1693 1693
         self.assertEqual(len(record.alignments), 10)
1694 1694
         self.assertEqual(len(record.alignments[0].hsps), 1)
@@ -1704,7 +1704,7 @@ def test_xml_2222_blastx_001(self):
1704 1704
         self.assertEqual(record.num_sequences_in_database, 8994603)
1705 1705
         self.assertEqual(record.database_sequences, 8994603)
1706 1706
         #self.assertEqual(record.database_length, 3078807967)
1707  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1707
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1708 1708
         self.assertEqual(len(record.descriptions), 10)
1709 1709
         self.assertEqual(len(record.alignments), 10)
1710 1710
         self.assertEqual(len(record.alignments[0].hsps), 1)
@@ -1733,7 +1733,7 @@ def test_xml_2222_blastp_001(self):
1733 1733
         self.assertEqual(record.num_sequences_in_database, 8994603)
1734 1734
         self.assertEqual(record.database_sequences, 8994603)
1735 1735
         #self.assertEqual(record.database_length, 3078807967)
1736  
-        self.assertEqual(record.database_length, -1216159329) #NCBI bug!
  1736
+        self.assertEqual(record.database_length, -1216159329)  # NCBI bug!
1737 1737
         self.assertEqual(len(record.descriptions), 10)
1738 1738
         self.assertEqual(len(record.alignments), 10)
1739 1739
         self.assertEqual(len(record.alignments[0].hsps), 1)
2  Tests/test_PAML_tools.py
@@ -28,7 +28,7 @@ def which(program):
28 28
         #For Windows, the user is instructed to move the programs to a folder
29 29
         #and then to add the folder to the system path. Just in case they didn't
30 30
         #do that, we can check for it in Program Files.
31  
-        likely_dirs = ["", #Current dir
  31
+        likely_dirs = ["",  # Current dir
32 32
                        prog_files,
33 33
                        os.path.join(prog_files, "paml41"),
34 34
                        os.path.join(prog_files, "paml43"),
2  Tests/test_PDB.py
@@ -17,7 +17,7 @@
17 17
 
18 18
 try:
19 19
     import numpy
20  
-    from numpy import dot #Missing on PyPy's micronumpy
  20
+    from numpy import dot  # Missing on PyPy's micronumpy
21 21
     del dot
22 22
 except ImportError:
23 23
     from Bio import MissingPythonDependencyError
2  Tests/test_PDB_KDTree.py
@@ -48,7 +48,7 @@ def get_coord(self):
48 48
             hits = ns.search_all(5.0)
49 49
             self.assertTrue(isinstance(hits, list), hits)
50 50
             self.assertTrue(len(hits) >= 0, hits)
51  
-        x = array([250,250,250]) #Far away from our random atoms
  51
+        x = array([250,250,250])  # Far away from our random atoms
52 52
         self.assertEqual([], ns.search(x, 5.0, "A"))
53 53
         self.assertEqual([], ns.search(x, 5.0, "R"))
54 54
         self.assertEqual([], ns.search(x, 5.0, "C"))
22  Tests/test_Pathway.py
@@ -50,11 +50,11 @@ def testNodes(self):
50 50
     def testEdges(self):
51 51
         a = Graph(['a','b','c','d'])
52 52
         a.add_edge('a','b','label1')
53  
-        self.assertEqual(a.child_edges('a'), [('b','label1')]) #, "incorrect child edges")
  53
+        self.assertEqual(a.child_edges('a'), [('b','label1')])  # , "incorrect child edges")
54 54
         a.add_edge('b','a','label2')
55  
-        self.assertEqual(a.parent_edges('a'), [('b','label2')]) #, "incorrect parent edges")
  55
+        self.assertEqual(a.parent_edges('a'), [('b','label2')])  # , "incorrect parent edges")
56 56
         a.add_edge('b','c','label3')
57  
-        self.assertEqual(a.parent_edges('c'), [('b','label3')]) #, "incorrect parent edges")
  57
+        self.assertEqual(a.parent_edges('c'), [('b','label3')])  # , "incorrect parent edges")
58 58
         l = a.children('b')
59 59
         l.sort()
60 60
         self.assertEqual(l, ['a', 'c'], "incorrect children")
@@ -72,7 +72,7 @@ def testRemoveNode(self):
72 72
         a.remove_node('e')
73 73
         b = Graph(['a','b','c','d'])
74 74
         b.add_edge('a','b','label5')
75  
-        self.assertEqual(a, b)#, "incorrect node removal")
  75
+        self.assertEqual(a, b)  # , "incorrect node removal")
76 76
 
77 77
 
78 78
 class MultiGraphTestCase(unittest.TestCase):
@@ -112,15 +112,15 @@ def testNodes(self):
112 112
     def testEdges(self):
113 113
         a = MultiGraph(['a','b','c','d'])
114 114
         a.add_edge('a','b','label1')
115  
-        self.assertEqual(a.child_edges('a'), [('b','label1')]) #, "incorrect child edges")
  115
+        self.assertEqual(a.child_edges('a'), [('b','label1')])  # , "incorrect child edges")
116 116
         a.add_edge('a','b','label2')
117 117
         l = a.child_edges('a')
118 118
         l.sort()
119  
-        self.assertEqual(l, [('b','label1'),('b','label2')]) #, "incorrect child edges")
  119
+        self.assertEqual(l, [('b','label1'),('b','label2')])  # , "incorrect child edges")
120 120
         a.add_edge('b','a','label2')
121  
-        self.assertEqual(a.parent_edges('a'), [('b','label2')]) #, "incorrect parent edges")
  121
+        self.assertEqual(a.parent_edges('a'), [('b','label2')])  # , "incorrect parent edges")
122 122
         a.add_edge('b','c','label3')
123  
-        self.assertEqual(a.parent_edges('c'), [('b','label3')]) #, "incorrect parent edges")
  123
+        self.assertEqual(a.parent_edges('c'), [('b','label3')])  # , "incorrect parent edges")
124 124
         l = a.children('b')
125 125
         l.sort()
126 126
         self.assertEqual(l, ['a', 'c'], "incorrect children")
@@ -143,7 +143,7 @@ def testRemoveNode(self):
143 143
         b.add_edge('a','b','label5')
144 144
         self.assertEqual(repr(b), "<MultiGraph: ('a': ('b', 'label5'))('b': )('c': )('d': )>")
145 145
         self.assertEqual(repr(a), repr(b))
146  
-        self.assertEqual(a, b)#, "incorrect node removal")
  146
+        self.assertEqual(a, b)  # , "incorrect node removal")
147 147
 
148 148
 
149 149
 class ReactionTestCase(unittest.TestCase):
@@ -159,8 +159,8 @@ def setUp(self):
159 159
         self.r_4 = Reaction({"c":-1, "d":-1, "a":1, "e":2})
160 160
 
161 161
     def testEq(self):
162  
-        self.assertEqual(self.r_1, self.r_1i) #, "not equal to similar")
163  
-        self.assertNotEqual(self.r_3, self.r_4) #, "equal to different")
  162
+        self.assertEqual(self.r_1, self.r_1i)  # , "not equal to similar")
  163
+        self.assertNotEqual(self.r_3, self.r_4)  # , "equal to different")
164 164
 
165 165
     def testRev(self):
166 166
         self.assertEqual(self.r_empty.reverse(), self.r_empty, "empty reversed not empty")
2  Tests/test_PopGen_DFDist.py
@@ -24,7 +24,7 @@
24 24
                 if file == f or file.lower() == f.lower()+".exe":
25 25
                     wanted[f] = file
26 26
     except os.error:
27  
-        pass #Path doesn't exist - correct to pass
  27
+        pass  # Path doesn't exist - correct to pass
28 28
 if len(wanted) != 4:
29 29
     raise MissingExternalDependencyError(
30 30
         "Install Dfdist, Ddatacal, pv2 and cplot2 if you want to use DFDist with Bio.PopGen.FDist.")
2  Tests/test_PopGen_FDist.py
@@ -24,7 +24,7 @@
24 24
                 if file == f or file.lower() == f.lower()+".exe":
25 25
                     wanted[f] = file
26 26
     except os.error:
27  
-        pass #Path doesn't exist - correct to pass
  27
+        pass  # Path doesn't exist - correct to pass
28 28
 if len(wanted) != 4:
29 29
     raise MissingExternalDependencyError(
30 30
         "Install fdist2, datacal, pv and cplot if you want to use FDist2 with Bio.PopGen.FDist.")
4  Tests/test_PopGen_FDist_nodepend.py
@@ -58,7 +58,7 @@ def test_record_parser(self):
58 58
             handle = self.handles[index]
59 59
             rec = FDist.read(handle)
60 60
             assert isinstance(rec, FDist.Record)
61  
-            assert rec.data_org == 0 #We don't support any other
  61
+            assert rec.data_org == 0  # We don't support any other
62 62
             assert rec.num_pops, rec.num_loci == self.pops_loci[index]
63 63
             for i in range(len(self.num_markers[index])):
64 64
                 assert rec.loci_data[i][0] == \
@@ -97,7 +97,7 @@ def test_convert_big(self):
97 97
             fd_rec = convert_genepop_to_fdist(gp_rec)
98 98
             assert(fd_rec.num_loci == 3)
99 99
             assert(fd_rec.num_pops == 3)
100  
-            gp_rec._handle.close() #TODO - Needs a proper fix
  100
+            gp_rec._handle.close()  # TODO - Needs a proper fix
101 101
 
102 102
     def tearDown(self):
103 103
         for handle in self.handles:
2  Tests/test_PopGen_GenePop.py
@@ -19,7 +19,7 @@
19 19
             if filename.startswith('Genepop'):
20 20
                 found = True
21 21
     except os.error:
22  
-        pass #Path doesn't exist - correct to pass
  22
+        pass  # Path doesn't exist - correct to pass
23 23
 if not found:
24 24
     raise MissingExternalDependencyError(
25 25
         "Install GenePop if you want to use Bio.PopGen.GenePop.")
4  Tests/test_PopGen_GenePop_EasyController.py
@@ -19,13 +19,13 @@
19 19
             if filename.startswith('Genepop'):
20 20
                 found = True
21 21
     except os.error:
22  
-        pass #Path doesn't exist - correct to pass
  22
+        pass  # Path doesn't exist - correct to pass
23 23
 if not found:
24 24
     raise MissingExternalDependencyError(
25 25
         "Install GenePop if you want to use Bio.PopGen.GenePop.")
26 26
 
27 27
 
28  
-cur_dir = os.path.abspath(".") #Tests directory
  28
+cur_dir = os.path.abspath(".")  # Tests directory
29 29
 
30 30
 
31 31
 class AppTest(unittest.TestCase):
2  Tests/test_PopGen_GenePop_nodepend.py
@@ -105,7 +105,7 @@ def test_file_record_parser(self):
105 105
                 continue
106 106
                 assert len(rec.populations[i]) == \
107 107
                            self.pops_indivs[index][1][i]
108  
-            rec._handle.close() #TODO - Needs a proper fix
  108
+            rec._handle.close()  # TODO - Needs a proper fix
109 109
 
110 110
     def test_wrong_file_parser(self):
111 111
         """Testing the ability to deal with wrongly formatted files
2  Tests/test_PopGen_SimCoal.py
@@ -21,7 +21,7 @@
21 21
                 found = True
22 22
                 simcoal_dir = path
23 23
     except os.error:
24  
-        pass #Path doesn't exist - correct to pass
  24
+        pass  # Path doesn't exist - correct to pass
25 25
 if not found:
26 26
     raise MissingExternalDependencyError(
27 27
         "Install SIMCOAL2 if you want to use Bio.PopGen.SimCoal.")
6  Tests/test_Prank_tool.py
@@ -29,7 +29,7 @@
29 29
     #For Windows, PRANK just comes as a zip file which contains the
30 30
     #prank.exe file which the user could put anywhere.  We'll try a few
31 31
     #sensible locations under Program Files... and then the full path.
32  
-    likely_dirs = ["", #Current dir
  32
+    likely_dirs = ["",  # Current dir
33 33
                    prog_files,
34 34
                    os.path.join(prog_files,"Prank")] + sys.path
35 35
     for folder in likely_dirs:
@@ -125,7 +125,7 @@ def test_Prank_complex_command_line(self):
125 125
         cmdline.set_parameter("notree", True)
126 126
         cmdline.set_parameter("-gaprate", 0.321)
127 127
         cmdline.set_parameter("gapext", 0.6)
128  
-        cmdline.set_parameter("-dots", 1) #i.e. True
  128
+        cmdline.set_parameter("-dots", 1)  # i.e. True
129 129
         #Try using a property:
130 130
         cmdline.kappa = 3
131 131
         cmdline.skipins = True
@@ -143,7 +143,7 @@ class PrankConversion(unittest.TestCase):
143 143
     def setUp(self):
144 144
         #As these reads are all 36, it can be seen as pre-aligned:
145 145
         self.input = "Quality/example.fasta"
146  
-        self.output = 'temp with space' #prefix, PRANK will pick extensions
  146
+        self.output = 'temp with space'  # prefix, PRANK will pick extensions
147 147
 
148 148
     def conversion(self, prank_number, prank_ext, format):
149 149
         """Get PRANK to do a conversion, and check it with SeqIO."""
2  Tests/test_SVDSuperimposer.py
@@ -5,7 +5,7 @@
5 5
 #TODO - Don't use "from XXX import *"
6 6
 try:
7 7
     from numpy import *
8  
-    from numpy import dot #missing in PyPy's micronumpy
  8
+    from numpy import dot  # missing in PyPy's micronumpy
9 9
 except ImportError:
10 10
     from Bio import MissingPythonDependencyError
11 11
     raise MissingPythonDependencyError(
2  Tests/test_SearchIO_index.py
@@ -1273,7 +1273,7 @@ def check_index(self, filename, format, **kwargs):
1273 1273
                 self.assertNotEqual(id(qres), id(dbidx_qres))
1274 1274
                 self.assertTrue(compare_search_obj(qres, dbidx_qres))
1275 1275
 
1276  
-        indexed._proxy._handle.close() #TODO - Better solution
  1276
+        indexed._proxy._handle.close()  # TODO - Better solution
1277 1277
         if sqlite3 is not None:
1278 1278
             db_indexed.close()
1279 1279
             db_indexed._con.close()
50  Tests/test_SeqIO.py
@@ -52,8 +52,8 @@ def send_warnings_to_stdout(message, category, filename, lineno,
52 52
 for format in sorted(AlignIO._FormatToWriter):
53 53
     if format not in test_write_read_alignment_formats:
54 54
         test_write_read_alignment_formats.append(format)
55  
-test_write_read_alignment_formats.remove("gb") #an alias for genbank
56  
-test_write_read_alignment_formats.remove("fastq-sanger") #an alias for fastq
  55
+test_write_read_alignment_formats.remove("gb")  # an alias for genbank
  56
+test_write_read_alignment_formats.remove("fastq-sanger")  # an alias for fastq
57 57
 
58 58
 # test_files is a list of tuples containing:
59 59
 # - string:  file format
@@ -82,22 +82,22 @@ def send_warnings_to_stdout(message, category, filename, lineno,
82 82
     ("fasta",  False, 'Fasta/rose.pro', 1),
83 83
     ("fasta",  False, 'Fasta/rosemary.pro', 1),
84 84
 #Following examples are also used in test_BioSQL_SeqIO.py
85  
-    ("fasta",  False, 'Fasta/f001', 1), #Protein
86  
-    ("fasta",  False, 'Fasta/f002', 3), #DNA
87  
-    #("fasta", False, 'Fasta/f003', 2), #Protein with comments
88  
-    ("fasta",  False, 'Fasta/fa01', 2), #Protein with gaps
  85
+    ("fasta",  False, 'Fasta/f001', 1),  # Protein
  86
+    ("fasta",  False, 'Fasta/f002', 3),  # DNA
  87
+    #("fasta", False, 'Fasta/f003', 2),  # Protein with comments
  88
+    ("fasta",  False, 'Fasta/fa01', 2),  # Protein with gaps
89 89
 #Following are also used in test_SeqIO_features.py, see also NC_005816.gb
90 90
     ("fasta",  False, 'GenBank/NC_005816.fna', 1),
91 91
     ("fasta",  False, 'GenBank/NC_005816.ffn', 10),
92 92
     ("fasta",  False, 'GenBank/NC_005816.faa', 10),
93 93
     ("fasta",  False, 'GenBank/NC_000932.faa', 85),
94  
-    ("tab",  False, 'GenBank/NC_005816.tsv', 10), # FASTA -> Tabbed
  94
+    ("tab",  False, 'GenBank/NC_005816.tsv', 10),  # FASTA -> Tabbed
95 95
 #Following examples are also used in test_GFF.py
96  
-    ("fasta",  False, 'GFF/NC_001802.fna', 1), #upper case
97  
-    ("fasta",  False, 'GFF/NC_001802lc.fna', 1), #lower case
98  
-    ("fasta",  True,  'GFF/multi.fna', 3), #Trivial nucleotide alignment
  96
+    ("fasta",  False, 'GFF/NC_001802.fna', 1),  # upper case
  97
+    ("fasta",  False, 'GFF/NC_001802lc.fna', 1),  # lower case
  98
+    ("fasta",  True,  'GFF/multi.fna', 3),  # Trivial nucleotide alignment
99 99
 #Following example is also used in test_registry.py
100  
-    ("fasta",  False, 'Registry/seqs.fasta', 2), #contains blank line
  100
+    ("fasta",  False, 'Registry/seqs.fasta', 2),  # contains blank line
101 101
 #Following example is also used in test_Nexus.py
102 102
     ("nexus",  True,  'Nexus/test_Nexus_input.nex', 9),
103 103
 #Following examples are also used in test_SwissProt.py
@@ -130,17 +130,17 @@ def send_warnings_to_stdout(message, category, filename, lineno,
130 130
     ("genbank",False, 'GenBank/iro.gb', 1),
131 131
     ("genbank",False, 'GenBank/pri1.gb', 1),
132 132
     ("genbank",False, 'GenBank/arab1.gb', 1),
133  
-    ("genbank",False, 'GenBank/protein_refseq.gb', 1), #Old version
134  
-    ("genbank",False, 'GenBank/protein_refseq2.gb', 1), #Revised version
  133
+    ("genbank",False, 'GenBank/protein_refseq.gb', 1),  # Old version
  134
+    ("genbank",False, 'GenBank/protein_refseq2.gb', 1),  # Revised version
135 135
     ("genbank",False, 'GenBank/extra_keywords.gb', 1),
136 136
     ("genbank",False, 'GenBank/one_of.gb', 1),
137  
-    ("genbank",False, 'GenBank/NT_019265.gb', 1), #contig, no sequence
  137
+    ("genbank",False, 'GenBank/NT_019265.gb', 1),  # contig, no sequence
138 138
     ("genbank",False, 'GenBank/origin_line.gb', 1),
139 139
     ("genbank",False, 'GenBank/blank_seq.gb', 1),
140 140
     ("genbank",False, 'GenBank/dbsource_wrap.gb', 1),
141  
-    ("genbank",False, 'GenBank/NC_005816.gb', 1), #See also AE017046.embl
  141
+    ("genbank",False, 'GenBank/NC_005816.gb', 1),  # See also AE017046.embl
142 142
     ("genbank",False, 'GenBank/NC_000932.gb', 1),
143  
-    ("genbank",False, 'GenBank/pBAD30.gb', 1), #Odd LOCUS line from Vector NTI
  143
+    ("genbank",False, 'GenBank/pBAD30.gb', 1),  # Odd LOCUS line from Vector NTI
144 144
 # The next example is a truncated copy of gbvrl1.seq from
145 145
 # ftp://ftp.ncbi.nih.gov/genbank/gbvrl1.seq.gz
146 146
 # This includes an NCBI header, and the first three records:
@@ -148,17 +148,17 @@ def send_warnings_to_stdout(message, category, filename, lineno,
148 148
 #Following files are also used in test_GFF.py
149 149
     ("genbank",False, 'GFF/NC_001422.gbk', 1),
150 150
 #Following files are currently only used here or in test_SeqIO_index.py:
151  
-    ("embl",   False, 'EMBL/epo_prt_selection.embl', 9), #proteins
  151
+    ("embl",   False, 'EMBL/epo_prt_selection.embl', 9),  # proteins
152 152
     ("embl",   False, 'EMBL/TRBG361.embl', 1),
153 153
     ("embl",   False, 'EMBL/DD231055_edited.embl', 1),
154  
-    ("embl",   False, 'EMBL/SC10H5.embl', 1), # Pre 2006 style ID line
155  
-    ("embl",   False, 'EMBL/U87107.embl', 1), # Old ID line with SV line
156  
-    ("embl",   False, 'EMBL/AAA03323.embl', 1), # 2008, PA line but no AC
157  
-    ("embl",   False, 'EMBL/AE017046.embl', 1), #See also NC_005816.gb
158  
-    ("embl",   False, 'EMBL/Human_contigs.embl', 2), #contigs, no sequences
159  
-    ("embl",   False, 'EMBL/location_wrap.embl', 1), #wrapped locations and unspecified type
160  
-    ("embl",   False, 'EMBL/A04195.imgt', 1), # features over indented for EMBL
161  
-    ("imgt",   False, 'EMBL/A04195.imgt', 1), # features over indented for EMBL
  154
+    ("embl",   False, 'EMBL/SC10H5.embl', 1),  # Pre 2006 style ID line
  155
+    ("embl",   False, 'EMBL/U87107.embl', 1),  # Old ID line with SV line
  156
+    ("embl",   False, 'EMBL/AAA03323.embl', 1),  # 2008, PA line but no AC
  157
+    ("embl",   False, 'EMBL/AE017046.embl', 1),  # See also NC_005816.gb
  158
+    ("embl",   False, 'EMBL/Human_contigs.embl', 2),  # contigs, no sequences
  159
+    ("embl",   False, 'EMBL/location_wrap.embl', 1),  # wrapped locations and unspecified type
  160
+    ("embl",   False, 'EMBL/A04195.imgt', 1),  # features over indented for EMBL
  161
+    ("imgt",   False, 'EMBL/A04195.imgt', 1),  # features over indented for EMBL
162 162
     ("stockholm", True,  'Stockholm/simple.sth', 2),
163 163
     ("stockholm", True,  'Stockholm/funny.sth', 6),
164 164
 #Following PHYLIP files are currently only used here and in test_AlignIO.py,
2  Tests/test_SeqIO_FastaIO.py
@@ -70,7 +70,7 @@ class TitleFunctions(unittest.TestCase):
70 70
     """Cunning unit test where methods are added at run time."""
71 71
     def simple_check(self, filename, alphabet):
72 72
         """Basic test for parsing single record FASTA files."""
73  
-        title, seq = read_title_and_seq(filename) #crude parser
  73
+        title, seq = read_title_and_seq(filename)  # crude parser
74 74
         #First check using Bio.SeqIO.FastaIO directly with title function,
75 75
         record = read_single_with_titles(filename, alphabet)
76 76
         idn, name, descr = title_to_ids(title)
2  Tests/test_SeqIO_PdbIO.py
@@ -8,7 +8,7 @@
8 8
 
9 9
 try:
10 10
     import numpy
11  
-    from numpy import dot #Missing on PyPy's micronumpy
  11
+    from numpy import dot  # Missing on PyPy's micronumpy
12 12
     del dot
13 13
 except ImportError:
14 14
     from Bio import MissingPythonDependencyError
6  Tests/test_SeqIO_QualityIO.py
@@ -140,7 +140,7 @@ def check_fails(self, filename, good_count, formats=None, raw=True):
140 140
             handle = open(filename, "rU")
141 141
             records = SeqIO.parse(handle, format)
142 142
             for i in range(good_count):
143  
-                record = records.next() #Make sure no errors!
  143
+                record = records.next()  # Make sure no errors!
144 144
                 self.assertTrue(isinstance(record, SeqRecord))
145 145
             self.assertRaises(ValueError, records.next)
146 146
             handle.close()
@@ -149,7 +149,7 @@ def check_general_fails(self, filename, good_count):
149 149
         handle = open(filename, "rU")
150 150
         tuples = QualityIO.FastqGeneralIterator(handle)
151 151
         for i in range(good_count):
152  
-            title, seq, qual = tuples.next() #Make sure no errors!
  152
+            title, seq, qual = tuples.next()  # Make sure no errors!
153 153
         self.assertRaises(ValueError, tuples.next)
154 154
         handle.close()
155 155
 
@@ -599,7 +599,7 @@ def test_E3MFGYR02_trimmed(self) :
599 599
         """Write and read back E3MFGYR02_random_10_reads.sff (trimmed)"""
600 600
         self.check(os.path.join("Roche", "E3MFGYR02_random_10_reads.sff"), "sff-trim",
601 601
                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
602  
-                    "fasta", "qual", "phd"]) #not sff as output
  602
+                    "fasta", "qual", "phd"])  # not sff as output
603 603
 
604 604
 
605 605
 class MappingTests(unittest.TestCase):
2  Tests/test_SeqIO_convert.py
@@ -95,7 +95,7 @@ def compare_record(old, new, truncate=None):
95 95
     if old.description != new.description \
96 96
     and (old.id+" "+old.description).strip() != new.description \
97 97
     and new.description != "<unknown description>" \
98  
-    and new.description != "" : #e.g. tab format
  98
+    and new.description != "":  # e.g. tab format
99 99
         raise ValueError("'%s' vs '%s' " % (old.description, new.description))
100 100
     if len(old.seq) != len(new.seq):
101 101
         raise ValueError("%i vs %i" % (len(old.seq), len(new.seq)))
18  Tests/test_SeqIO_features.py
@@ -226,7 +226,7 @@ def check(self, parent_seq, feature, answer_str, location_str):
226 226
         self.assertEqual(new, answer_str)
227 227
 
228 228
         new = feature.extract(parent_seq.tomutable())
229  
-        self.assertTrue(isinstance(new, Seq)) #Not MutableSeq!
  229
+        self.assertTrue(isinstance(new, Seq))  # Not MutableSeq!
230 230
         self.assertEqual(str(new), answer_str)
231 231
 
232 232
         new = feature.extract(UnknownSeq(len(parent_seq), parent_seq.alphabet))
@@ -253,14 +253,14 @@ def check(self, parent_seq, feature, answer_str, location_str):
253 253
         #unit test have mostly defaulted to strand None.
254 254
         self.assertEqual(len(feature.sub_features), len(new_f.sub_features))
255 255
         for f1, f2 in zip(feature.sub_features, new_f.sub_features):
256  
-            f1.type = "misc_feature" #hack as may not be misc_feature
  256
+            f1.type = "misc_feature"  # hack as may not be misc_feature
257 257
             if f1.strand is None:
258  
-                f1.strand = f2.strand #hack as described above
  258
+                f1.strand = f2.strand  # hack as described above
259 259
             self.assertEqual(f1.strand, f2.strand)
260 260
             self.assertTrue(compare_feature(f1,f2))
261  
-        feature.type = "misc_feature" #hack as may not be misc_feature
  261
+        feature.type = "misc_feature"  # hack as may not be misc_feature
262 262
         if not feature.strand:
263  
-            feature.strand = new_f.strand #hack as above
  263
+            feature.strand = new_f.strand  # hack as above
264 264
         self.assertEqual(feature.strand, new_f.strand)
265 265
         self.assertTrue(compare_feature(feature, new_f))
266 266
 
@@ -959,11 +959,11 @@ def test_within(self):
959 959
 class NC_000932(unittest.TestCase):
960 960
     #This includes an evil dual strand gene
961 961
     basename = "NC_000932"
962  
-    emblname = None # "AP000423" has different annotation (e.g. more CDS)
  962
+    emblname = None  # "AP000423" has different annotation (e.g. more CDS)
963 963
     table = 11
964  
-    skip_trans_test = ["gi|7525080|ref|NP_051037.1|", #dual-strand
965  
-                       "gi|7525057|ref|NP_051038.1|", #dual-strand
966  
-                       "gi|90110725|ref|NP_051109.2|", #Invalid annotation? No start codon
  964
+    skip_trans_test = ["gi|7525080|ref|NP_051037.1|",  # dual-strand
  965
+                       "gi|7525057|ref|NP_051038.1|",  # dual-strand
  966
+                       "gi|90110725|ref|NP_051109.2|",  # Invalid annotation? No start codon
967 967
                        ]
968 968
     __doc__ = "Tests using %s GenBank and FASTA files from the NCBI" % basename
969 969
     #TODO - neat way to change the docstrings...
22  Tests/test_SeqIO_index.py
@@ -45,7 +45,7 @@ def gzip_open(filename, format):
45 45
     if sys.version_info[0] < 3 or format in SeqIO._BinaryFormats:
46 46
         return gzip.open(filename)
47 47
     handle = gzip.open(filename)
48  
-    data = handle.read() #bytes!
  48
+    data = handle.read()  # bytes!
49 49
     handle.close()
50 50
     return StringIO(_bytes_to_string(data))
51 51
 
@@ -105,7 +105,7 @@ def simple_check(self, filename, format, alphabet, comp):
105 105
 
106 106
         rec_dict = SeqIO.index(filename, format, alphabet)
107 107
         self.check_dict_methods(rec_dict, id_list, id_list)
108  
-        rec_dict._proxy._handle.close() #TODO - Better solution
  108
+        rec_dict._proxy._handle.close()  # TODO - Better solution
109 109
         del rec_dict
110 110
 
111 111
         if not sqlite3:
@@ -137,7 +137,7 @@ def simple_check(self, filename, format, alphabet, comp):
137 137
                                   alphabet)
138 138
         self.check_dict_methods(rec_dict, id_list, id_list)
139 139
         rec_dict.close()
140  
-        rec_dict._con.close() #hack for PyPy
  140
+        rec_dict._con.close()  # hack for PyPy
141 141
         del rec_dict
142 142
 
143 143
         #Now reload it...
@@ -145,14 +145,14 @@ def simple_check(self, filename, format, alphabet, comp):
145 145
                                   alphabet)
146 146
         self.check_dict_methods(rec_dict, id_list, id_list)
147 147
         rec_dict.close()
148  
-        rec_dict._con.close() #hack for PyPy
  148
+        rec_dict._con.close()  # hack for PyPy
149 149
         del rec_dict
150 150
 
151 151
         #Now reload without passing filenames and format
152 152
         rec_dict = SeqIO.index_db(index_tmp, alphabet=alphabet)
153 153
         self.check_dict_methods(rec_dict, id_list, id_list)
154 154
         rec_dict.close()
155  
-        rec_dict._con.close() #hack for PyPy
  155
+        rec_dict._con.close()  # hack for PyPy
156 156
         del rec_dict
157 157
         os.remove(index_tmp)
158 158
 
@@ -168,7 +168,7 @@ def key_check(self, filename, format, alphabet, comp):
168 168
         key_list = [add_prefix(id) for id in id_list]
169 169
         rec_dict = SeqIO.index(filename, format, alphabet, add_prefix)
170 170
         self.check_dict_methods(rec_dict, key_list, id_list)
171  
-        rec_dict._proxy._handle.close() #TODO - Better solution
  171
+        rec_dict._proxy._handle.close()  # TODO - Better solution
172 172
         del rec_dict
173 173
 
174 174
         if not sqlite3:
@@ -196,7 +196,7 @@ def key_check(self, filename, format, alphabet, comp):
196 196
                                   add_prefix)
197 197
         self.check_dict_methods(rec_dict, key_list, id_list)
198 198
         rec_dict.close()
199  
-        rec_dict._con.close() #hack for PyPy
  199
+        rec_dict._con.close()  # hack for PyPy
200 200
         del rec_dict
201 201
 
202 202
         #Now reload it...
@@ -204,7 +204,7 @@ def key_check(self, filename, format, alphabet, comp):
204 204
                                   add_prefix)
205 205
         self.check_dict_methods(rec_dict, key_list, id_list)
206 206
         rec_dict.close()
207  
-        rec_dict._con.close() #hack for PyPy
  207
+        rec_dict._con.close()  # hack for PyPy
208 208
         del rec_dict
209 209
 
210 210
         #Now reload without passing filenames and format
@@ -212,7 +212,7 @@ def key_check(self, filename, format, alphabet, comp):
212 212
                                   key_function=add_prefix)
213 213
         self.check_dict_methods(rec_dict, key_list, id_list)
214 214
         rec_dict.close()
215  
-        rec_dict._con.close() #hack for PyPy
  215
+        rec_dict._con.close()  # hack for PyPy
216 216
         del rec_dict
217 217
         os.remove(index_tmp)
218 218
         #Done
@@ -331,7 +331,7 @@ def get_raw_check(self, filename, format, alphabet, comp):
331 331
             else:
332 332
                 rec2 = SeqIO.read(handle, format, alphabet)
333 333
             self.assertEqual(True, compare_record(rec1, rec2))
334  
-        rec_dict._proxy._handle.close() #TODO - Better solution
  334
+        rec_dict._proxy._handle.close()  # TODO - Better solution
335 335
         del rec_dict
336 336
 
337 337
     if sqlite3:
@@ -365,7 +365,7 @@ def test_duplicates_to_dict(self):
365 365
     ("EMBL/epo_prt_selection.embl", "embl", None),
366 366
     ("EMBL/U87107.embl", "embl", None),
367 367
     ("EMBL/TRBG361.embl", "embl", None),
368  
-    ("EMBL/A04195.imgt", "embl", None), #Not a proper EMBL file, an IMGT file
  368
+    ("EMBL/A04195.imgt", "embl", None),  # Not a proper EMBL file, an IMGT file
369 369
     ("EMBL/A04195.imgt", "imgt", None),
370 370
     ("GenBank/NC_000932.faa", "fasta", generic_protein),
371 371
     ("GenBank/NC_005816.faa", "fasta", generic_protein),
4  Tests/test_SeqIO_write.py
@@ -27,8 +27,8 @@
27 27
 for format in sorted(AlignIO._FormatToWriter):
28 28
     if format not in test_write_read_alignment_formats:
29 29
         test_write_read_alignment_formats.append(format)
30  
-test_write_read_alignment_formats.remove("gb") #an alias for genbank
31  
-test_write_read_alignment_formats.remove("fastq-sanger") #an alias for fastq
  30
+test_write_read_alignment_formats.remove("gb")  # an alias for genbank
  31
+test_write_read_alignment_formats.remove("fastq-sanger")  # an alias for fastq
32 32
 
33 33
 
34 34
 # This is a list of three-tuples.  Each tuple contains a
4  Tests/test_SeqRecord.py
@@ -149,7 +149,7 @@ def test_add_seq(self):
149 149
             self.assertEqual(len(rec.features), len(self.record.features))
150 150
             self.assertEqual(rec.features[0].type, "source")
151 151
             self.assertEqual(rec.features[0].location.nofuzzy_start, 0)
152  
-            self.assertEqual(rec.features[0].location.nofuzzy_end, 26) #not +3
  152
+            self.assertEqual(rec.features[0].location.nofuzzy_end, 26)  # not +3
153 153
 
154 154
     def test_add_seqrecord(self):
155 155
         """Simple left addition of SeqRecord from genbank file."""
@@ -168,7 +168,7 @@ def test_add_seqrecord(self):
168 168
                          len(self.record.features) + len(other.features))
169 169
         self.assertEqual(rec.features[0].type, "source")
170 170
         self.assertEqual(rec.features[0].location.nofuzzy_start, 0)
171  
-        self.assertEqual(rec.features[0].location.nofuzzy_end, len(self.record)) #not +3
  171
+        self.assertEqual(rec.features[0].location.nofuzzy_end, len(self.record))  # not +3
172 172
         i = len(self.record.features)
173 173
         self.assertEqual(rec.features[i].type, "source")
174 174
         self.assertEqual(rec.features[i].location.nofuzzy_start, len(self.record))
10  Tests/test_Seq_objs.py
@@ -204,7 +204,7 @@ def test_str_startswith(self):
204 204
             self.assertEqual(str(example1).startswith(subs_str),
205 205
                              example1.startswith(subs))
206 206
             self.assertEqual(str(example1).startswith(subs_str),
207  
-                             example1.startswith(subs_str)) #strings!
  207
+                             example1.startswith(subs_str))  # strings!
208 208
             self.assertEqual(str(example1).startswith(subs_str,3),
209 209
                              example1.startswith(subs,3))
210 210
             self.assertEqual(str(example1).startswith(subs_str,2,6),
@@ -232,7 +232,7 @@ def test_str_endswith(self):
232 232
             self.assertEqual(str(example1).endswith(subs_str),
233 233
                              example1.endswith(subs))
234 234
             self.assertEqual(str(example1).startswith(subs_str),
235  
-                             example1.startswith(subs_str)) #strings!
  235
+                             example1.startswith(subs_str))  # strings!
236 236
             self.assertEqual(str(example1).endswith(subs_str,3),
237 237
                              example1.endswith(subs,3))
238 238
             self.assertEqual(str(example1).endswith(subs_str,2,6),
@@ -301,7 +301,7 @@ def test_str_getitem(self):
301 301
                         if step == 0:
302 302
                             try:
303 303
                                 print example1[i:j:step]
304  
-                                self._assert(False) #Should fail!
  304
+                                self._assert(False)  # Should fail!
305 305
                             except ValueError:
306 306
                                 pass
307 307
                         else:
@@ -408,7 +408,7 @@ def test_the_transcription(self):
408 408
                     raise e
409 409
                 str1 = str(example1)
410 410
                 self.assertEqual(str1.replace("T","U").replace("t","u"), str(tran))
411  
-                self.assertEqual(tran.alphabet, generic_rna) #based on limited examples
  411
+                self.assertEqual(tran.alphabet, generic_rna)  # based on limited examples
412 412
 
413 413
     def test_the_back_transcription(self):
414 414
             """Check obj.back_transcribe() method."""
@@ -426,7 +426,7 @@ def test_the_back_transcription(self):
426 426
                     raise e
427 427
                 str1 = str(example1)
428 428
                 self.assertEqual(str1.replace("U","T").replace("u","t"), str(tran))
429  
-                self.assertEqual(tran.alphabet, generic_dna) #based on limited examples
  429
+                self.assertEqual(tran.alphabet, generic_dna)  # based on limited examples
430 430
 
431 431
     def test_the_translate(self):
432 432
             """Check obj.translate() method."""
2  Tests/test_SubsMat.py
@@ -51,7 +51,7 @@
51 51
     s += counts[key]
52 52
 f.write("Total sum %.2f should be 1.0\n" % (s))
53 53
 lo_mat_prot = \
54  
-SubsMat.make_log_odds_matrix(acc_rep_mat=acc_rep_mat,round_digit=1) #,ftab_prot
  54
+SubsMat.make_log_odds_matrix(acc_rep_mat=acc_rep_mat,round_digit=1)  # ,ftab_prot
55 55
 f.write("\nLog odds matrix\n")
56 56
 f.write("\nLog odds half matrix\n")
57 57
 # Was %.1f. Let us see if this is OK
2  Tests/test_TCoffee_tool.py