def parse_unifrac(unifracFN):
with open(unifracFN, "<STR_LIT>") as uF:<EOL><INDENT>first = uF.next().split("<STR_LIT:\t>")<EOL>lines = [line.strip() for line in uF]<EOL><DEDENT>unifrac = {"<STR_LIT>": OrderedDict(), "<STR_LIT>": [], "<STR_LIT>": []}<EOL>if first[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>return parse_unifrac_v1_8(unifrac, lines)<EOL><DEDENT>elif first[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>return parse_unifrac_v1_9(unifrac, lines)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>
Parses the unifrac results file into a dictionary

:type unifracFN: str
:param unifracFN: The path to the unifrac results file

:rtype: dict
:return: A dictionary with keys: 'pcd' (principle coordinates data) which is a
         dictionary of the data keyed by sample ID, 'eigvals' (eigenvalues), and
         'varexp' (variation explained)