Permalink
Browse files

Prank: PEP8 whitespace cleanup.

  • Loading branch information...
cbrueffer authored and peterjc committed Dec 19, 2012
1 parent 0e2fef0 commit b6e413dd56e81e8c39bf38a460ed96031d4760a2
Showing with 12 additions and 12 deletions.
  1. +3 −3 Bio/Align/Applications/_Prank.py
  2. +9 −9 Tests/test_Prank_tool.py
@@ -46,7 +46,7 @@ class PrankCommandline(AbstractCommandline):
Last checked against version: 081202
"""
def __init__(self, cmd="prank", **kwargs):
- OUTPUT_FORMAT_VALUES = list(range(1,18))
+ OUTPUT_FORMAT_VALUES = list(range(1, 18))
self.parameters = [
################## input/output parameters: ##################
#-d=sequence_file
@@ -55,7 +55,7 @@ def __init__(self, cmd="prank", **kwargs):
filename=True,
is_required=True),
#-t=tree_file [default: no tree, generate approximate NJ tree]
- _Option(["-t", "t"],"Input guide tree filename",
+ _Option(["-t", "t"], "Input guide tree filename",
filename=True),
#-tree="tree_string" [tree in newick format; in double quotes]
_Option(["-tree", "tree"],
@@ -193,7 +193,7 @@ def __init__(self, cmd="prank", **kwargs):
_Switch(["-convert", "convert"],
"Convert input alignment to new format. Do "
"not perform alignment")
- ]
+ ]
AbstractCommandline.__init__(self, cmd, **kwargs)
View
@@ -19,7 +19,7 @@
os.environ['LANG'] = 'C'
prank_exe = None
-if sys.platform=="win32":
+if sys.platform == "win32":
try:
#This can vary depending on the Windows language.
prog_files = os.environ["PROGRAMFILES"]
@@ -30,7 +30,7 @@
#sensible locations under Program Files... and then the full path.
likely_dirs = ["", # Current dir
prog_files,
- os.path.join(prog_files,"Prank")] + sys.path
+ os.path.join(prog_files, "Prank")] + sys.path
for folder in likely_dirs:
if os.path.isdir(folder):
if os.path.isfile(os.path.join(folder, "prank.exe")):
@@ -90,12 +90,12 @@ def test_Prank_simple_with_NEXUS_output(self):
"""Simple round-trip through app with infile, output in NEXUS
output.?.??? files written to cwd - no way to redirect
"""
- records = list(SeqIO.parse(self.infile1,"fasta"))
+ records = list(SeqIO.parse(self.infile1, "fasta"))
#Try using keyword argument,
cmdline = PrankCommandline(prank_exe, d=self.infile1, noxml=True)
#Try using a property,
cmdline.d = self.infile1
- cmdline.f = 17 # NEXUS format
+ cmdline.f = 17 # NEXUS format
cmdline.set_parameter("notree", True)
self.assertEqual(str(cmdline), prank_exe +
" -d=Fasta/fa01 -f=17 -noxml -notree")
@@ -107,10 +107,10 @@ def test_Prank_simple_with_NEXUS_output(self):
align = AlignIO.read("output.2.nex", "nexus")
for old, new in zip(records, align):
#Old versions of Prank reduced name to 9 chars
- self.assertTrue(old.id==new.id or old.id[:9]==new.id)
+ self.assertTrue(old.id == new.id or old.id[:9] == new.id)
#infile1 has alignment gaps in it
- self.assertEqual(str(new.seq).replace("-",""),
- str(old.seq).replace("-",""))
+ self.assertEqual(str(new.seq).replace("-", ""),
+ str(old.seq).replace("-", ""))
except NexusError:
#See bug 3119,
#Bio.Nexus can't parse output from prank v100701 (1 July 2010)
@@ -165,7 +165,7 @@ def conversion(self, prank_number, prank_ext, format):
self.assertTrue(os.path.isfile(filename))
old = AlignIO.read(self.input, "fasta")
#Hack...
- if format=="phylip":
+ if format == "phylip":
for record in old:
record.id = record.id[:10]
new = AlignIO.read(filename, format)
@@ -197,5 +197,5 @@ def test_convert_to_phylip(self):
if __name__ == "__main__":
- runner = unittest.TextTestRunner(verbosity = 2)
+ runner = unittest.TextTestRunner(verbosity=2)
unittest.main(testRunner=runner)

0 comments on commit b6e413d

Please sign in to comment.