Skip to content

Instantly share code, notes, and snippets.

@asalt
Created June 17, 2015 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asalt/9141838a74588dc0ef93 to your computer and use it in GitHub Desktop.
Save asalt/9141838a74588dc0ef93 to your computer and use it in GitHub Desktop.
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