X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/efd131427759f5a2663dea04a402054e361b7c90..e5ab4ce19d5ace5e6dd5cd32c23f50b35d20c8ef:/crunch_scripts/split-fastq.py diff --git a/crunch_scripts/split-fastq.py b/crunch_scripts/split-fastq.py index 8b80adf635..253dd22ea8 100755 --- a/crunch_scripts/split-fastq.py +++ b/crunch_scripts/split-fastq.py @@ -94,7 +94,7 @@ prog = re.compile(r'(.*?)(_[12])?\.fastq(\.gz)?$') for s in inp.all_streams(): for f in s.all_files(): name_pieces = prog.match(f.name()) - if name_pieces != None: + if name_pieces is not None: if s.name() != ".": # The downstream tool (run-command) only iterates over the top # level of directories so if there are fastq files in @@ -104,7 +104,8 @@ for s in inp.all_streams(): print >>sys.stderr, "fastq must be at the root of the collection" sys.exit(1) - if name_pieces.group(2) != None: + p = None + if name_pieces.group(2) is not None: if name_pieces.group(2) == "_1": p = [{}, {}] p[0]["reader"] = s.files()[name_pieces.group(0)] @@ -113,13 +114,14 @@ for s in inp.all_streams(): p = [{}] p[0]["reader"] = s.files()[name_pieces.group(0)] - if chunking: - splitfastq(p) - else: - for i in xrange(0, len(p)): - m = p[i]["reader"].as_manifest()[1:] - manifest_list.append(["./_" + str(piece), m[:-1]]) - piece += 1 + if p is not None: + if chunking: + splitfastq(p) + else: + for i in xrange(0, len(p)): + m = p[i]["reader"].as_manifest()[1:] + manifest_list.append(["./_" + str(piece), m[:-1]]) + piece += 1 manifest_text = "\n".join(" ".join(m) for m in manifest_list)