Skip to content

Commit

Permalink
slightly better clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
bwlang committed Dec 7, 2017
1 parent 7f3df2c commit ecfcf3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bwameth.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ def convert_reads(fq1s, fq2s, out=sys.stdout):
sys.stderr.write("converting reads in %s,%s\n" % (fq1, fq2))
fq1 = nopen(fq1)

#examines first five lines to detect if this is an interleaved fastq file
first_five = list(islice(fq1, 5))
fq1.seek(0)

r1_header = first_five[0]
r2_header = first_five[-1]

Expand All @@ -82,6 +84,8 @@ def convert_reads(fq1s, fq2s, out=sys.stdout):
else:
already_interleaved = False

q1_iter = izip(*[fq1] * 4)

if fq2 != "NA":
fq2 = nopen(fq2)
q2_iter = izip(*[fq2] * 4)
Expand All @@ -92,8 +96,6 @@ def convert_reads(fq1s, fq2s, out=sys.stdout):
sys.stderr.write("WARNING: running bwameth in single-end mode\n")
q2_iter = repeat((None, None, None, None))

q1_iter = izip(*[fq1] * 4)

lt80 = 0

if already_interleaved:
Expand Down

0 comments on commit ecfcf3c

Please sign in to comment.