You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
Spend a minute looking at this function to understand what it's doing.
# then we reverse-sort them by score, and return the n highest# scoring alignments (this needs to be updated so we only# ever keep track of the n highest scoring alignments)best_hits=sorted(hits, key=lambdae: e[1], reverse=True)[:n]
The comment says the code 'needs to be updated to keep track of the highest scoring alignments', but it appears this is already accomplished by slicing the list with[:n]. Is this an old comment that can be removed or is the goal to replace the hits list with something like a heap such that only the n highest scoring elements are kept in memory at any one time?
option 1: remove the comment
option 2: replace the list with a heap
option n: ???
Assuming option 2, the following should restrict memory usage to the top n results:
The following is a snippet from 2.2.4 A complete homology search function:
The comment says the code 'needs to be updated to keep track of the highest scoring alignments', but it appears this is already accomplished by slicing the list with
[:n]
. Is this an old comment that can be removed or is the goal to replace the hits list with something like a heap such that only then
highest scoring elements are kept in memory at any one time?Assuming option 2, the following should restrict memory usage to the top n results:
If option 2 looks good I will submit a pull request.
https://github.com/caporaso-lab/An-Introduction-To-Applied-Bioinformatics/blob/e1e4beb1750b5be179470ee37fd42c55bce9f889/iab/algorithms/__init__.py#L633-L636
The text was updated successfully, but these errors were encountered: