Tweak Tutorial print statement/function for Jython 2.7b1

Sadly there seems to be limitations with Jython 2.7b1 and its
support for the print function via:

from __future__ import print_function

We can avoid this by using print(variable) which is valid under
both the old print statement and the new print function.

See http://bugs.jython.org/issue2007
Largely automated print function style in the doctests.

Plus some manual tweaking to ensure the doctests still pass
(e.g. on Jython 2.7b1, see last commit).

import os
from lib2to3.main import main

for dirpath, dirnames, filenames in os.walk("."):
    if dirpath.startswith("./build/") or dirpath.startwith("./.git/"):
        continue
    print("=" * len(dirpath))
    print(dirpath)
    print("=" *len(dirpath))
    for f in filenames:
        if not f.endswith(".py"):
            continue
        filename = os.path.join(dirpath, f)
        with open(filename) as h:
            data = h.read()
            if "print " not in data:
                continue
            if "print(" in data:
                continue
        print(filename)
        e = main("lib2to3.fixes", ["-d", filename, "-f", "print", "-w", "-n"])
        if e != 0:
            os.remove(filename)
            raise RuntimeError("Error %i from 2to3 (doctests) on %s"
                               % (e, filename))
A few more modules needing print function style
Avoid using print >> sys.stderr
Print function style in comments (no code changes)
No longer needs to convert print statements via 2to3

Also by removing this fixer, any accidental print
statements should be caught via the Python 3 tests.
Use print function spacing in setup.py
Add: from __future__ import print_statement

This is currently redundant as we are carefully only
using this simple print style which is both a print
statement (with redundant brackets) under Python 2
and a print function under Python 3:

print(variable)

However, adding the __future__ import to any file using
a print should catch any accidental usage of the print
statement in the near future (even if not testing under
Python 3 where it would be spotted since we've turned
off the print fixer during the 2to3 conversion).

This was automated as follows:

<python>
MAGIC = "from __future__ import print_function"

import os
import sys

def should_mark(filename):
    handle = open(filename, "rU")
    lines = [line.strip() for line in handle if "print" in line]
    handle.close()
    if MAGIC in lines:
        #print("%s is marked" % filename)
        return False
    if "print" in lines:
        print("TODO - %s has a naked print" % filename)
        sys.exit(1)
    for line in lines:
        if "print" not in line:
            continue
        #print(line)
        line = line.strip(" #")
        if line.startswith(">>>") or line.startswith("..."):
            #doctest
            line = line[3:].strip()
        if line.startswith("print ") or line.startswith("print("):
            return True
    print("%s has no print statements" % filename)
    return False

def mark_file(filename, marker=MAGIC):
    with open(filename, "rU") as h:
        lines = list(h.readlines())
    with open(filename, "w") as h:
        while (lines[0].startswith("#") or not lines[0].strip()):
            h.write(lines.pop(0))
        if lines[0].startswith('"""') or lines[0].startswith('r"""'):
            # Module docstring
            if lines[0].strip() == '"""':
                print("Non-PEP8 module docstring in %s" % filename)
            if lines[0].rstrip().endswith('"""') and lines[0].strip() != '"""':
                # One liner
                print("One line module docstring in %s" % filename)
                h.write(lines.pop(0))
            else:
                h.write(lines.pop(0))
                while not lines[0].strip().endswith('"""'):
                    h.write(lines.pop(0))
                h.write(lines.pop(0))
        while (lines[0].startswith("#") or not lines[0].strip()):
            h.write(lines.pop(0))
        h.write(marker + "\n\n")
        h.write("".join(lines))

for dirpath, dirnames, filenames in os.walk("."):
    if dirpath.startswith("./build/"):
        continue
    for f in filenames:
        if not f.endswith(".py"):
            continue
        f = os.path.join(dirpath, f)
        if should_mark(f):
            print("Marking %s" % f)
            mark_file(f)
</python>
Use list comprehension instead of  map() for Python 3 compatibility
NEWS update - mention print functions used in docstrings too
README: note RDFlib dependency in Bio.Phylo.CDAOIO; fix a typo
Creating some (invalid) concatenated SFF files

This is to mimic a real SFF file created with the Roche software
version 2.6 (and perhaps post processed?) which concatenated
SFF files together (using different flow counts). Mimicking
this with invalid_greek_E3MFGYR02.sff (see below).

Furthermore, the expected 8 byte alignment was also broken -
the first SFF block in this example was only 4 byte aligned.
Mimicking this with invalid_paired_E3MFGYR02.sff (see below).

with open("E3MFGYR02_no_manifest.sff", "rb") as h:
    no_manifest = h.read()
with open("greek.sff", "rb") as h:
    greek = h.read()
with open("paired.sff", "rb") as h:
    paired = h.read()
assert paired[-4:] == chr(0) * 4
with open("invalid_greek_E3MFGYR02.sff", "wb") as h:
    h.write(greek + no_manifest)
with open("invalid_paired_E3MFGYR02.sff", "wb") as h:
    h.write(paired[:-4] + no_manifest + chr(0)*4)

Note that I have deliberately used the no manifest (and no index)
version of E3MFGYR02 here so we don't have to worry about if the
index offsets would be absolute or relative...

It is possible that this is a deliberate Roche design choice,
and a defacto extension to the SFF file format - we shall see.
Check for concatenated SFF files and treat as error

This is based on the following query (and test data file) from Matt:
http://www.biostars.org/p/80320/
Fix str2bool to account for integer encoding of booleans

Some Phyloxml files use 0 or 1 for true/false
Merge pull request #239 from evolvedmicrobe/master

Fix str2bool to account for integer encoding of booleans
Close #206: greytrack_font_rotation is linear only
Remove accidentally committed file

Note this checked in file had an unfortunate typo, XY vs XZ,
and for more background on random access to blocked XZ format
see my blog post here:
http://blastedbio.blogspot.co.uk/2013/04/random-access-to-blocked-xz-format-bxzf.html

See also my backport of the lzma module which this used,
https://github.com/peterjc/backports.lzma
http://pypi.python.org/pypi/backports.lzma/
Downgrade more non-null SFF padding errors to warnings (issue #219)

Based on a patch from Martin Mokrejs submitted by email.

See earlier commit, this is to allow Biopython to parse the
invalid SFF files generated by sff-dump.2.1.7 though 2.1.9
due to bug reusing a buffer resulting in non-null padding.
Downgrade remaining SFF null-padding errors, issue #219
Remove duplicated copies of motif application wrappers

The code is still identical, so we can point Bio.Motif.Applications
at the replacements in Bio.motifs.applications instead. This is
easier because I'm about to fix some property names in the XXmotif
wrapper and only want to do it once.