def writeFasta(inProtFN, orthoT, strainHeader, genesO, seqD):
    """Writes a fasta block. seqs are specified in orthoT, and obtained
from seqD. If strainHeader is True, then we put strain whitespace gene
number in header. (In this case, the tree will end up with strain name
on its tips). Otherwise, only gene number.

    """
    with open(inProtFN, 'w') as f:
        for geneNum in orthoT:
            if strainHeader:
                strainName = genesO.numToStrainName(geneNum)
                f.write('>' + strainName + ' ' + str(geneNum) + '\n')
            else:
                f.write('>' + str(geneNum) + '\n')
            f.write(seqD[geneNum] + '\n')
            f.write('\n')
