Skip to content

Commit

Permalink
Remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Jul 16, 2020
1 parent ecbdbe9 commit 17a3f0e
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions PopPUNK/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,44 +161,6 @@ def iterDistRows(refSeqs, querySeqs, self=True):
for ref in refSeqs:
yield(ref, query)

def old_listDistInts(refSeqs, querySeqs, self=True):
"""Gets the ref and query ID for each row of the distance matrix
Returns an iterable with ref and query ID pairs by row.
Args:
refSeqs (list)
List of reference sequence names.
querySeqs (list)
List of query sequence names.
self (bool)
Whether a self-comparison, used when constructing a database.
Requires refSeqs == querySeqs
Default is True
Returns:
ref, query (str, str)
Iterable of tuples with ref and query names for each distMat row.
"""
n = 0
num_ref = len(refSeqs)
num_query = len(querySeqs)
if self:
comparisons = [(0,0)] * int((num_ref * (num_ref-1)) * 0.5)
if refSeqs != querySeqs:
raise RuntimeError('refSeqs must equal querySeqs for db building (self = true)')
for i in range(num_ref):
for j in range(i + 1, num_ref):
comparisons[n] = (j, i)
n = n + 1
else:
comparisons = [(0,0)] * (len(refSeqs) * len(querySeqs))
for i in range(num_query):
for j in range(num_ref):
comparisons[n] = (j, i)
n = n + 1

return comparisons

def listDistInts(refSeqs, querySeqs, self=True):
"""Gets the ref and query ID for each row of the distance matrix
Expand Down

0 comments on commit 17a3f0e

Please sign in to comment.