def deseqOutputSizeFactors(outfile):
    '''output size factors - requires cds object.'''
    size_factors = R('''sizeFactors( cds )''')
    samples = R('''names(sizeFactors(cds))''')
    with IOTools.openFile(outfile, "w") as outf:
        outf.write("sample\tfactor\n")
        for name, x in zip(samples, size_factors):
            outf.write("%s\t%s\n" % (name, str(x)))
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Expression.py/deseqOutputSizeFactors/original