Permalink
Browse files

Fix spacing around inline comments (E261, E262).

  • Loading branch information...
cbrueffer committed Dec 6, 2012
1 parent f57bace commit 10a632018ed516a90162ee59c9e6c424728d7ddc
Showing with 171 additions and 171 deletions.
  1. +1 −1 Tests/run_tests.py
  2. +2 −2 Tests/seq_tests_common.py
  3. +3 −3 Tests/test_AlignIO.py
  4. +2 −2 Tests/test_CAPS.py
  5. +5 −5 Tests/test_CodonTable.py
  6. +11 −11 Tests/test_Emboss.py
  7. +1 −1 Tests/test_EmbossPhylipNew.py
  8. +15 −15 Tests/test_GenomeDiagram.py
  9. +1 −1 Tests/test_LogisticRegression.py
  10. +1 −1 Tests/test_MMCIF.py
  11. +1 −1 Tests/test_MarkovModel.py
  12. +8 −8 Tests/test_Muscle_tool.py
  13. +1 −1 Tests/test_NCBITextParser.py
  14. +8 −8 Tests/test_NCBIXML.py
  15. +1 −1 Tests/test_PAML_tools.py
  16. +1 −1 Tests/test_PDB.py
  17. +1 −1 Tests/test_PDB_KDTree.py
  18. +11 −11 Tests/test_Pathway.py
  19. +1 −1 Tests/test_PopGen_DFDist.py
  20. +1 −1 Tests/test_PopGen_FDist.py
  21. +2 −2 Tests/test_PopGen_FDist_nodepend.py
  22. +1 −1 Tests/test_PopGen_GenePop.py
  23. +2 −2 Tests/test_PopGen_GenePop_EasyController.py
  24. +1 −1 Tests/test_PopGen_GenePop_nodepend.py
  25. +1 −1 Tests/test_PopGen_SimCoal.py
  26. +3 −3 Tests/test_Prank_tool.py
  27. +1 −1 Tests/test_SVDSuperimposer.py
  28. +1 −1 Tests/test_SearchIO_index.py
  29. +25 −25 Tests/test_SeqIO.py
  30. +1 −1 Tests/test_SeqIO_FastaIO.py
  31. +1 −1 Tests/test_SeqIO_PdbIO.py
  32. +3 −3 Tests/test_SeqIO_QualityIO.py
  33. +1 −1 Tests/test_SeqIO_convert.py
  34. +9 −9 Tests/test_SeqIO_features.py
  35. +11 −11 Tests/test_SeqIO_index.py
  36. +2 −2 Tests/test_SeqIO_write.py
  37. +2 −2 Tests/test_SeqRecord.py
  38. +5 −5 Tests/test_Seq_objs.py
  39. +1 −1 Tests/test_SubsMat.py
  40. +1 −1 Tests/test_TCoffee_tool.py
  41. +10 −10 Tests/test_TogoWS.py
  42. +2 −2 Tests/test_Uniprot.py
  43. +3 −3 Tests/test_bgzf.py
  44. +6 −6 Tests/test_seq.py
View
@@ -139,7 +139,7 @@ def is_numpy():
DOCTEST_MODULES.remove("Bio.SearchIO._model.hit")
DOCTEST_MODULES.remove("Bio.SearchIO._model.hsp")
-system_lang = os.environ.get('LANG', 'C') #Cache this
+system_lang = os.environ.get('LANG', 'C') # Cache this
def main(argv):
@@ -209,8 +209,8 @@ def compare_sequence(old, new):
assert expected == new[i]
#Test slices
- indices.append(ln) #check copes with overflows
- indices.append(ln+1000) #check copes with overflows
+ indices.append(ln) # check copes with overflows
+ indices.append(ln + 1000) # check copes with overflows
for i in indices:
for j in indices:
expected = s[i:j]
View
@@ -30,10 +30,10 @@
("clustal", 7, 1, 'Clustalw/opuntia.aln'),
("clustal", 5, 1, 'Clustalw/hedgehog.aln'),
("clustal", 2, 1, 'Clustalw/odd_consensus.aln'),
- ("clustal",20, 1, 'Clustalw/protein.aln'), #Used in the tutorial
- ("clustal",20, 1, 'Clustalw/promals3d.aln'), #Nonstandard header
+ ("clustal",20, 1, 'Clustalw/protein.aln'), # Used in the tutorial
+ ("clustal",20, 1, 'Clustalw/promals3d.aln'), # Nonstandard header
#Following examples are also used in test_GFF.py
- ("fasta", 3, 1, 'GFF/multi.fna'), #Trivial nucleotide alignment
+ ("fasta", 3, 1, 'GFF/multi.fna'), # Trivial nucleotide alignment
#Following example is also used in test_Nexus.py
("nexus", 9, 1, 'Nexus/test_Nexus_input.nex'),
("nexus", 2, 1, 'Nexus/codonposset.nex'),
View
@@ -80,11 +80,11 @@ def testNoCAPS(self):
def test_uneven(self):
alignment = ["aaaaaaaaaaaaaa",
- "aaaaaaaaaaaaaa", #we'll change this below
+ "aaaaaaaaaaaaaa", # we'll change this below
"aaaaaaaaaaaaaa",
]
align = createAlignment(alignment, Alphabet.generic_nucleotide)
- align[1].seq = align[1].seq[:8] #evil
+ align[1].seq = align[1].seq[:8] # evil
self.assertRaises(CAPS.AlignmentHasDifferentLengthsError,
CAPS.CAPSMap,
align)
View
@@ -22,11 +22,11 @@
assert ambiguous_rna_by_id[n].forward_table["GUU"] == "V"
assert ambiguous_rna_by_id[n].forward_table["GUN"] == "V"
if n != 23 :
- assert ambiguous_rna_by_id[n].forward_table["UUN"] == "X" #F or L
+ assert ambiguous_rna_by_id[n].forward_table["UUN"] == "X" # F or L
assert ambiguous_dna_by_id[n].forward_table["GTT"] == "V"
if n != 23 :
- assert ambiguous_dna_by_id[n].forward_table["TTN"] == "X" #F or L
+ assert ambiguous_dna_by_id[n].forward_table["TTN"] == "X" # F or L
assert ambiguous_dna_by_id[n].forward_table["GTN"] == "V"
if n != 23 :
@@ -35,14 +35,14 @@
assert ambiguous_generic_by_id[n].forward_table["GUU"] == "V"
assert ambiguous_generic_by_id[n].forward_table["GUN"] == "V"
if n != 23 :
- assert ambiguous_generic_by_id[n].forward_table["UUN"] == "X" #F or L
+ assert ambiguous_generic_by_id[n].forward_table["UUN"] == "X" # F or L
assert ambiguous_generic_by_id[n].forward_table["GTT"] == "V"
if n != 23 :
- assert ambiguous_generic_by_id[n].forward_table["TTN"] == "X" #F or L
+ assert ambiguous_generic_by_id[n].forward_table["TTN"] == "X" # F or L
assert ambiguous_generic_by_id[n].forward_table["GTN"] == "V"
#And finally something evil, an RNA-DNA mixture:
if n != 23 :
- assert ambiguous_generic_by_id[n].forward_table["UTN"] == "X" #F or L
+ assert ambiguous_generic_by_id[n].forward_table["UTN"] == "X" # F or L
assert ambiguous_generic_by_id[n].forward_table["UTU"] == "F"
#R = A or G, so URR = UAA or UGA / TRA = TAA or TGA = stop codons
View
@@ -27,7 +27,7 @@
exes_wanted = ["water", "needle", "seqret", "transeq", "seqmatchall",
"embossversion"]
-exes = dict() #Dictionary mapping from names to exe locations
+exes = dict() # Dictionary mapping from names to exe locations
if "EMBOSS_ROOT" in os.environ:
#Windows default installation path is C:\mEMBOSS which contains the exes.
@@ -63,9 +63,9 @@ def get_emboss_version():
universal_newlines=True,
shell=(sys.platform!="win32"))
stdout, stderr = child.communicate()
- child.stdout.close() #This is both stdout and stderr
+ child.stdout.close() # This is both stdout and stderr
del child
- assert stderr is None #Send to stdout instead
+ assert stderr is None # Send to stdout instead
for line in stdout.split("\n"):
if line.strip()=="Reports the current EMBOSS version number":
pass
@@ -102,7 +102,7 @@ def emboss_convert(filename, old_format, new_format):
sequence = filename,
sformat = old_format,
osformat = new_format,
- auto = True, #no prompting
+ auto = True, # no prompting
stdout = True)
#Run the tool,
child = subprocess.Popen(str(cline),
@@ -124,7 +124,7 @@ def emboss_piped_SeqIO_convert(records, old_format, new_format):
cline = SeqretCommandline(exes["seqret"],
sformat = old_format,
osformat = new_format,
- auto = True, #no prompting
+ auto = True, # no prompting
filter = True)
#Run the tool,
child = subprocess.Popen(str(cline),
@@ -151,7 +151,7 @@ def emboss_piped_AlignIO_convert(alignments, old_format, new_format):
cline = SeqretCommandline(exes["seqret"],
sformat = old_format,
osformat = new_format,
- auto = True, #no prompting
+ auto = True, # no prompting
filter = True)
#Run the tool,
child = subprocess.Popen(str(cline),
@@ -410,7 +410,7 @@ def test_align_clustalw(self):
self.check_AlignIO_with_EMBOSS("Clustalw/hedgehog.aln", "clustal")
self.check_AlignIO_with_EMBOSS("Clustalw/opuntia.aln", "clustal")
self.check_AlignIO_with_EMBOSS("Clustalw/odd_consensus.aln", "clustal",
- skip_formats=["nexus"]) #TODO - why not nexus?
+ skip_formats=["nexus"]) # TODO - why not nexus?
self.check_AlignIO_with_EMBOSS("Clustalw/protein.aln", "clustal")
self.check_AlignIO_with_EMBOSS("Clustalw/promals3d.aln", "clustal")
@@ -676,8 +676,8 @@ def test_needle_piped2(self):
cline = exes["needle"]
cline += " -asequence asis:" + query
cline += " -bsequence Fasta/f002"
- cline += " -auto" #no prompting
- cline += " -filter" #use stdout
+ cline += " -auto" # no prompting
+ cline += " -filter" # use stdout
#Run the tool,
child = subprocess.Popen(str(cline),
stdin=subprocess.PIPE,
@@ -776,8 +776,8 @@ def emboss_translate(sequence, table=None, frame=None):
SeqIO.write(SeqRecord(sequence, id="Test"), filename, "fasta")
cline += " -sequence %s" % filename
- cline += " -auto" #no prompting
- cline += " -filter" #use stdout
+ cline += " -auto" # no prompting
+ cline += " -filter" # use stdout
if table is not None:
cline += " -table %s" % str(table)
if frame is not None:
@@ -22,7 +22,7 @@
exes_wanted = ['fdnadist', 'fneighbor', 'fprotdist','fprotpars','fconsense',
'fseqboot', 'ftreedist', 'fdnapars']
-exes = dict() #Dictionary mapping from names to exe locations
+exes = dict() # Dictionary mapping from names to exe locations
if "EMBOSS_ROOT" in os.environ:
#Windows default installation path is C:\mEMBOSS which contains the exes.
@@ -163,7 +163,7 @@ def calc_gc_skew(sequence):
g = sequence.count('G') + sequence.count('g')
c = sequence.count('C') + sequence.count('c')
if g+c == 0:
- return 0.0 #TODO - return NaN or None here?
+ return 0.0 # TODO - return NaN or None here?
else:
return (g-c)/float(g+c)
@@ -178,7 +178,7 @@ def calc_at_skew(sequence):
a = sequence.count('A') + sequence.count('a')
t = sequence.count('T') + sequence.count('t')
if a+t == 0:
- return 0.0 #TODO - return NaN or None here?
+ return 0.0 # TODO - return NaN or None here?
else:
return (a-t)/float(a+t)
@@ -257,7 +257,7 @@ def test_limits(self):
#Circular diagram
gdd.draw(tracklines=False,
pagesize=(15*cm,15*cm),
- circular=True, #Data designed to be periodic
+ circular=True, # Data designed to be periodic
start=0, end=points, circle_core=0.5)
gdd.write(os.path.join('Graphics', "line_graph_c.pdf"), "pdf")
@@ -454,7 +454,7 @@ def test_arrow_heads(self):
self.add_track_with_sigils(sigil="ARROW", color="orange",
arrowhead_length=1)
self.add_track_with_sigils(sigil="ARROW", color="red",
- arrowhead_length=10000) #Triangles
+ arrowhead_length=10000) # Triangles
self.assertEqual(len(self.gdd.tracks), 4)
self.finish("GD_sigil_arrows")
@@ -570,7 +570,7 @@ def setUp(self):
def test_write_arguments(self):
"""Check how the write methods respond to output format arguments."""
gdd = Diagram('Test Diagram')
- gdd.drawing = None #Hack - need the ReportLab drawing object to be created.
+ gdd.drawing = None # Hack - need the ReportLab drawing object to be created.
filename = os.path.join("Graphics","error.txt")
#We (now) allow valid formats in any case.
for output in ["XXX","xxx",None,123,5.9]:
@@ -631,7 +631,7 @@ def test_partial_diagram(self):
#Note that I am using strings for color names, instead
#of passing in color objects. This should also work!
if len(gds_features) % 2 == 0:
- color = "white" #for testing the automatic black border!
+ color = "white" # for testing the automatic black border!
else:
color = "red"
#Checking it can cope with the old UK spelling colour.
@@ -877,10 +877,10 @@ def test_diagram_via_object_pdf(self):
#gdfs1.set_all_features('color', colors.red)
gdfs2.set_all_features('color', colors.blue)
- gdt1.add_set(gdfsA) #Before CDS so under them!
+ gdt1.add_set(gdfsA) # Before CDS so under them!
gdt1.add_set(gdfs1)
- gdt2.add_set(gdfsB) #Before genes so under them!
+ gdt2.add_set(gdfsB) # Before genes so under them!
gdt2.add_set(gdfs2)
gdt3 = Track('misc features and repeats', greytrack=1,
@@ -924,7 +924,7 @@ def test_diagram_via_object_pdf(self):
gdt5.add_set(gdgs2)
gdgs3 = GraphSet('Di-nucleotide count')
- step = len(genbank_entry)//400 #smaller step
+ step = len(genbank_entry) // 400 # smaller step
gdgs3.new_graph(apply_to_window(genbank_entry.seq, step, calc_dinucleotide_counts, step),
'Di-nucleotide count', style='heat',
color=colors.red, altcolor=colors.orange)
@@ -933,12 +933,12 @@ def test_diagram_via_object_pdf(self):
#Add the tracks (from both features and graphs)
#Leave some white space in the middle/bottom
- gdd.add_track(gdt4, 3) # GC skew
- gdd.add_track(gdt5, 4) # GC and AT content
- gdd.add_track(gdt1, 5) # CDS features
- gdd.add_track(gdt2, 6) # Gene features
- gdd.add_track(gdt3, 7) # Misc features and repeat feature
- gdd.add_track(gdt6, 8) # Feature depth
+ gdd.add_track(gdt4, 3) # GC skew
+ gdd.add_track(gdt5, 4) # GC and AT content
+ gdd.add_track(gdt1, 5) # CDS features
+ gdd.add_track(gdt2, 6) # Gene features
+ gdd.add_track(gdt3, 7) # Misc features and repeat feature
+ gdd.add_track(gdt6, 8) # Feature depth
#Finally draw it in both formats, and full view and partial
gdd.draw(format='circular', orientation='landscape',
@@ -8,7 +8,7 @@
try:
import numpy
- from numpy import linalg #missing in PyPy's micronumpy
+ from numpy import linalg # missing in PyPy's micronumpy
except ImportError:
from Bio import MissingExternalDependencyError
raise MissingExternalDependencyError(
View
@@ -16,7 +16,7 @@
try:
import numpy
- from numpy import dot #Missing on PyPy's micronumpy
+ from numpy import dot # Missing on PyPy's micronumpy
del dot
except ImportError:
from Bio import MissingPythonDependencyError
@@ -4,7 +4,7 @@
try:
from numpy import array
- from numpy import random #missing in PyPy's micronumpy
+ from numpy import random # missing in PyPy's micronumpy
except ImportError:
from Bio import MissingPythonDependencyError
raise MissingPythonDependencyError(
View
@@ -29,7 +29,7 @@
#a Muscle directory with the muscle.exe file plus a readme etc,
#which the user could put anywhere. We'll try a few sensible
#locations under Program Files... and then the full path.
- likely_dirs = ["", #Current dir
+ likely_dirs = ["", # Current dir
prog_files,
os.path.join(prog_files,"Muscle3.6"),
os.path.join(prog_files,"Muscle3.7"),
@@ -65,7 +65,7 @@ def setUp(self):
self.infile1 = "Fasta/f002"
self.infile2 = "Fasta/fa01"
self.infile3 = "Fasta/f001"
- self.outfile1 = "Fasta/temp align out1.fa" #with spaces!
+ self.outfile1 = "Fasta/temp align out1.fa" # with spaces!
self.outfile2 = "Fasta/temp_align_out2.fa"
self.outfile3 = "Fasta/temp_align_out3.fa"
self.outfile4 = "Fasta/temp_align_out4.fa"
@@ -95,7 +95,7 @@ def test_Muscle_simple(self):
def test_Muscle_with_options(self):
"""Round-trip through app with a switch and valued option"""
cmdline = MuscleCommandline(muscle_exe)
- cmdline.set_parameter("input", self.infile1) #"input" is alias for "in"
+ cmdline.set_parameter("input", self.infile1) # "input" is alias for "in"
cmdline.set_parameter("out", self.outfile2)
#Use property:
cmdline.objscore = "sp"
@@ -196,7 +196,7 @@ def test_simple_clustal(self):
shell=(sys.platform!="win32"))
#Didn't use -quiet so there should be progress reports on stderr,
align = AlignIO.read(child.stdout, "clustal")
- align.sort() #by record.id
+ align.sort() # by record.id
self.assertTrue(child.stderr.read().strip().startswith("MUSCLE"))
return_code = child.wait()
self.assertEqual(return_code, 0)
@@ -218,7 +218,7 @@ def test_simple_clustal_strict(self):
cmdline = MuscleCommandline(muscle_exe)
cmdline.set_parameter("in", input_file)
#Use clustal output (with a CLUSTAL header)
- cmdline.set_parameter("clwstrict", True) #Default None treated as False!
+ cmdline.set_parameter("clwstrict", True) # Default None treated as False!
self.assertEqual(str(cmdline).rstrip(), muscle_exe +
" -in Fasta/f002 -clwstrict")
self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
@@ -252,13 +252,13 @@ def test_long(self):
cmdline.set_parameter("in", temp_large_fasta_file)
#Use fast options
cmdline.set_parameter("maxiters", 1)
- cmdline.set_parameter("diags", True) #Default None treated as False!
+ cmdline.set_parameter("diags", True) # Default None treated as False!
#Use clustal output
- cmdline.set_parameter("clwstrict", True) #Default None treated as False!
+ cmdline.set_parameter("clwstrict", True) # Default None treated as False!
#Shoudn't need this, but just to make sure it is accepted
cmdline.set_parameter("maxhours", 0.1)
#No progress reports to stderr
- cmdline.set_parameter("quiet", True) #Default None treated as False!
+ cmdline.set_parameter("quiet", True) # Default None treated as False!
self.assertEqual(str(cmdline).rstrip(), muscle_exe +
" -in temp_cw_prot.fasta -diags -maxhours 0.1" +
" -maxiters 1 -clwstrict -quiet")
@@ -14192,7 +14192,7 @@ def test_text_2215L_blastx_001(self):
self.assertEqual(record.application, "BLASTX")
self.assertEqual(record.version, '2.2.15')
self.assertEqual(record.date, "Oct-15-2006")
- self.assertEqual(record.query, "66118") #Odd name for a query sequence, but valid!
+ self.assertEqual(record.query, "66118") # Odd name for a query sequence, but valid!
self.assertEqual(record.query_letters, 662)
self.assertEqual(record.database, "Leigo")
self.assertEqual(record.database_sequences, 4535438)
Oops, something went wrong.

0 comments on commit 10a6320

Please sign in to comment.