From 64eab6ef26d382df660a8ab20c7fc5f3fc89edee Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Fri, 20 Mar 2015 14:45:29 -0700 Subject: [PATCH] Use max on the iterator to find the last key --- htsworkflow/pipelines/genome_mapper.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htsworkflow/pipelines/genome_mapper.py b/htsworkflow/pipelines/genome_mapper.py index 4f57bbb..62619e2 100644 --- a/htsworkflow/pipelines/genome_mapper.py +++ b/htsworkflow/pipelines/genome_mapper.py @@ -88,11 +88,10 @@ class constructMapperDict(object): builds = self.genome_dict[elements[0]] # sort build names the way humans would - keys = builds.keys() - keys.sort(key=natural_sort_key) + last_key = max(builds, key=natural_sort_key) # return the path from the 'last' build name - return builds[keys[-1]] + return builds[last_key] elif len(elements) == 2: # we have species, and build name -- 2.30.2