Created
June 17, 2015 20:42
-
-
Save asalt/9141838a74588dc0ef93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for key in d.keys(): | |
acc = '' | |
gi = 0 | |
taxonfaa=None | |
homolo = None | |
for sublst in d[key]: | |
if 'NP' in sublst[3]: | |
if sublst[2] > gi: | |
acc = sublst[3] | |
gi = sublst[2] | |
taxonfaa = sublst[0] | |
homolo = sublst[1] | |
if acc=='': | |
for sublst in d[key]: | |
if 'XP' in sublst[3]: | |
if sublst[2] > gi: | |
acc = sublst[3] | |
gi = sublst[2] | |
taxonfaa = sublst[0] | |
homolo = sublst[1] | |
outfile.write(str(taxonfaa) + '\t' + str(homolo) + str(gi) + '\t' + key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment