diff scripts/fastq_positional_quality_trimming.py @ 3:0cbed1c0a762 draft default tip

planemo upload commit 15239f1674081ab51ab8dd75a9a40cf1bfaa93e8
author cstrittmatter
date Tue, 28 Jan 2020 10:42:31 -0500
parents 965517909457
children
line wrap: on
line diff
--- a/scripts/fastq_positional_quality_trimming.py	Wed Jan 22 09:10:12 2020 -0500
+++ b/scripts/fastq_positional_quality_trimming.py	Tue Jan 28 10:42:31 2020 -0500
@@ -90,18 +90,18 @@
     log = open(options.logfile, 'w')
     try:
         while True:
-            headL = forward.next().rstrip()
-            sequL = forward.next().rstrip()
-            commL = forward.next().rstrip()
-            sangL = forward.next().rstrip()
+            headL = next(forward).rstrip()
+            sequL = next(forward).rstrip()
+            commL = next(forward).rstrip()
+            sangL = next(forward).rstrip()
             qualL = sanger2phred(sangL)
             trimmed_sequL, trimmed_qualL = trimming(sequL, qualL, maxlengthtrim, lefttrim, righttrim, minqualtrim, avgqualtrim)
             if paired:
                 try:
-                    headR = reverse.next().rstrip()
-                    sequR = reverse.next().rstrip()
-                    commR = reverse.next().rstrip()
-                    sangR = reverse.next().rstrip()
+                    headR = next(reverse).rstrip()
+                    sequR = next(reverse).rstrip()
+                    commR = next(reverse).rstrip()
+                    sangR = next(reverse).rstrip()
                 except StopIteration:
                     sys.exit('Reverse FASTQ file contain less reads than forward FASTQ file.')
                 qualR = sanger2phred(sangR)
@@ -130,7 +130,7 @@
     except StopIteration:
         if paired:
             try:
-                reverse.next()
+                next(reverse)
             except StopIteration:
                 log.write("Total paired reads     : %d\n" % total_reads)
                 log.write("Passing paired reads   : %d\n" % passing_paired_reads)