Skip to content

Commit

Permalink
Merge pull request #33 from broadinstitute/ct-barcode-graceful-fail
Browse files Browse the repository at this point in the history
allow guess_barcodes_for_sample() to fail gracefully
  • Loading branch information
tomkinsc authored Jun 23, 2020
2 parents 424a116 + 1829bf9 commit fa37a9f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions util/illumina_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,8 @@ def guess_barcodes_for_sample(self, sample_name):

out_dict = OrderedDict()
out_dict["sample_name"] = sample_name

out_dict["match_type"] = "not_found"

barcodes_seen_novel = copy.deepcopy(self.barcodes_seen)

# From barcodes seen in data, collect barcode pairs not expected based on sample sheet
Expand Down Expand Up @@ -1803,7 +1804,14 @@ def guess_barcodes_for_sample(self, sample_name):
out_dict["match_type"] = "high_count_novel_pair"
break

if putative_match[0]!=None:
out_dict["guessed_barcode_1"] = "unknown"
out_dict["guessed_barcode_1_name"] = "unknown"
if is_dual_index and (putative_match is not None and putative_match[1] != None):
out_dict["guessed_barcode_2"] = "unknown"
out_dict["guessed_barcode_2_name"] = "unknown"
out_dict["guessed_barcodes_read_count"] = "0"

if putative_match is not None and putative_match[0]!=None:
out_dict["guessed_barcode_1"] = putative_match[0]
out_dict["guessed_barcode_1_name"] = self.barcode_name_map[putative_match[0]]
if is_dual_index and putative_match[1] != None:
Expand Down

0 comments on commit fa37a9f

Please sign in to comment.