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/