Skip to content

Commit

Permalink
Merge pull request #455 from CGATOxford/{IS}_py38_errors
Browse files Browse the repository at this point in the history
Errors picked up by python 3.8's syntax checker
  • Loading branch information
IanSudbery authored Feb 5, 2021
2 parents a14dea7 + f2e0040 commit c3ead07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion umi_tools/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def validateExtractOptions(options):
options.pattern, options.pattern2))
elif options.extract_method == "regex":
raise ValueError("barcode regex(es) do not include any umi groups "
"(starting with 'umi_') %s, %s" (
"(starting with 'umi_') %s, %s" % (
options.pattern, options.pattern2))

return(extract_cell, extract_umi)
Expand Down
12 changes: 6 additions & 6 deletions umi_tools/extract_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,21 +507,21 @@ def __init__(self,
raise ValueError("barcode pattern (%s) should only contain "
"N/X/C characters" % pattern)
self.pattern_length = len(pattern)
self.umi_bases = [x for x in range(len(pattern)) if pattern[x] is "N"]
self.bc_bases = [x for x in range(len(pattern)) if pattern[x] is "X"]
self.cell_bases = [x for x in range(len(pattern)) if pattern[x] is "C"]
self.umi_bases = [x for x in range(len(pattern)) if pattern[x] == "N"]
self.bc_bases = [x for x in range(len(pattern)) if pattern[x] == "X"]
self.cell_bases = [x for x in range(len(pattern)) if pattern[x] == "C"]

if pattern2:
if len(pattern2.replace("N", "").replace("X", "").replace("C", "")) > 0:
raise ValueError("barcode pattern2 (%s) should only contain "
"N/X/C characters" % pattern2)
self.pattern_length2 = len(pattern2)
self.umi_bases2 = [x for x in range(len(pattern2))
if pattern2[x] is "N"]
if pattern2[x] == "N"]
self.bc_bases2 = [x for x in range(len(pattern2))
if pattern2[x] is "X"]
if pattern2[x] == "X"]
self.cell_bases2 = [x for x in range(len(pattern2))
if pattern2[x] is "C"]
if pattern2[x] == "C"]

self.getCellBarcode = self._getCellBarcodeString
self.getBarcodes = self._getBarcodesString
Expand Down
2 changes: 1 addition & 1 deletion umi_tools/whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def main(argv=None):
options.pattern, options.pattern2))
elif options.extract_method == "regex":
U.error("barcode regex(es) do not include any cell groups "
"(starting with 'cell_') %s, %s" (
"(starting with 'cell_') %s, %s" % (
options.pattern, options.pattern2))

read1s = umi_methods.fastqIterate(options.stdin)
Expand Down

0 comments on commit c3ead07

Please sign in to comment.