Skip to content

Commit

Permalink
Whitespace removal
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlees committed Aug 6, 2024
1 parent 8a93037 commit d53dbf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions PopPUNK/assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def assign_query_hdf5(dbFuncs,
from .utils import readPickle
from .utils import update_distance_matrices
from .utils import createOverallLineage

failed_assembly_qc = {}
failed_assembly_samples = frozenset()
if qc_dict["run_qc"]:
Expand All @@ -378,7 +378,7 @@ def assign_query_hdf5(dbFuncs,
if len(failed_assembly_qc) > 0:
sys.stderr.write(f"{len(failed_assembly_qc)} samples failed:\n"
f"{','.join(failed_assembly_samples)}\n")

qNames = [x for x in qNames if x in pass_assembly_qc]
if len(qNames) == 0:
write_qc_failure_report(failed_assembly_samples, [failed_assembly_qc], output)
Expand Down Expand Up @@ -492,13 +492,13 @@ def assign_query_hdf5(dbFuncs,
# QC distance matrix
if qc_dict['run_qc']:
sys.stderr.write("Running QC on distance matrix\n")
seq_names_passing, failed_distmatrix_qc = qcDistMat(qrDistMat, rNames, qNames, ref_db, qc_dict)
seq_names_passing, failed_distmatrix_qc = qcDistMat(qrDistMat, rNames, qNames, ref_db, qc_dict)
failed_distmatrix_samples = frozenset(qNames) - frozenset(seq_names_passing)
if len(failed_distmatrix_samples) > 0:
sys.stderr.write(f"{len(failed_distmatrix_samples)} samples failed:\n"
f"{','.join(failed_distmatrix_samples)}\n")
write_qc_failure_report(failed_distmatrix_samples | failed_assembly_samples, [failed_distmatrix_qc, failed_assembly_qc], output)

if len(failed_distmatrix_samples) == len(qNames):
sys.exit(1)
else:
Expand Down
2 changes: 1 addition & 1 deletion PopPUNK/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def printClusters(G, rlist, outPrefix=None, oldClusterFile=None,
oldClusters = oldAllClusters[list(oldAllClusters.keys())[0]]
# parse all previously used clusters, including those that are merged
parsed_oldClusters = set([int(item) for sublist in (x.split('_') for x in oldClusters) for item in sublist])

new_id = max(parsed_oldClusters) + 1 # 1-indexed
while new_id in parsed_oldClusters:
new_id += 1 # in case clusters have been merged
Expand Down

0 comments on commit d53dbf8

Please sign in to comment.