@staticmethod
def parseSolutionFileByHandle(f):
    """ read the MFM solution file given as a file object (must be open)

        Returns:
        (fbaSolution, minmax) tuple with

        fbaSolution -- MetabolicFlux object with flux distribution, and lb, ub
        minmax      -- dict { reaction : flux minimum, flux maximum }
        """
    metabolites = set()
    mfmDict = {}
    line_no = 0
    for line in f:
        line_no += 1
        if line.lstrip().upper().startswith('NAME'
            ) or line == '' or line.isspace():
            continue
        try:
            met, values_str = list(map(str.rstrip, line.split(':')))
        except ValueError:
            raise SyntaxError(
                """Syntax error in line %u:
Line must contain exactly one colon (':')."""
                 % line_no)
        if met in metabolites:
            raise SyntaxError(
                'Syntax error in line %u: Duplicate reaction.' % line_no)
        metabolites.add(met)
        try:
            value = float(values_str.strip())
        except ValueError:
            raise SyntaxError(
                'Syntax error in line %u: Invalid floating point value.' %
                line_no)
        mfmDict[met] = value
    return mfmDict
