Skip to content

Commit 125f2af

Browse files
committed
add mode check
1 parent d10e461 commit 125f2af

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

bin/extract_map_reads.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def write_fq(fq_dict, fname, mode):
163163
"""
164164
Write to fastq file
165165
INPUT:
166-
- fq_dict(dict) dictionary with unmapped read names as keys, seq and quality as values
167-
in a list
166+
- fq_dict(dict) dictionary with unmapped read names as keys,
167+
unmapped/mapped (u|m), seq, and quality as values in a list
168168
- fname(string) Path to output fastq file
169169
- mode(string) strip (remove read) or replace (replace read sequence) by Ns
170170
"""
@@ -218,6 +218,11 @@ def write_fq(fq_dict, fname, mode):
218218
f.write(f"{i}\n")
219219

220220

221+
def check_strip_mode(mode):
222+
if mode.lower() not in ['replace', 'strip']:
223+
print(f"Mode must be {' or '.join(mode)}")
224+
225+
221226
if __name__ == "__main__":
222227
BAM, IN_FWD, IN_REV, OUT_FWD, OUT_REV, MODE, PROC = _get_args()
223228

0 commit comments

Comments
 (0)