diff --git a/ChangeLog b/ChangeLog index 1b7c52600f..fa8761eba8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-02-25 Aditi Gupta + + * sandbox/{collect-reads.py, correct-errors.py, + normalize-by-median-pct.py, slice-reads-by-coverage.py, + sweep-files.py, sweep-reads3.py, to-casava-1.8-fastq.py}: + Replaced 'accuracy' with 'quality'. Fixes #787. + 2015-02-25 Tamer A. Mansour * scripts/normalize-by-median.py: change to the default behavior to diff --git a/sandbox/collect-reads.py b/sandbox/collect-reads.py index 49268cda84..e6484e7482 100755 --- a/sandbox/collect-reads.py +++ b/sandbox/collect-reads.py @@ -26,8 +26,8 @@ def output_single(read): - if hasattr(read, 'accuracy'): - return "@%s\n%s\n+\n%s\n" % (read.name, read.sequence, read.accuracy) + if hasattr(read, 'quality'): + return "@%s\n%s\n+\n%s\n" % (read.name, read.sequence, read.quality) else: return ">%s\n%s\n" % (read.name, read.sequence) diff --git a/sandbox/correct-errors.py b/sandbox/correct-errors.py index 1f9031bf33..29ad6c7ff6 100755 --- a/sandbox/correct-errors.py +++ b/sandbox/correct-errors.py @@ -38,17 +38,17 @@ def output_single(read, new_sequence): name = read.name sequence = new_sequence - accuracy = None - if hasattr(read, 'accuracy'): - accuracy = read.accuracy[:len(sequence)] + quality = None + if hasattr(read, 'quality'): + quality = read.quality[:len(sequence)] # in cases where sequence _lengthened_, need to truncate it to # match the quality score length. - sequence = sequence[:len(accuracy)] + sequence = sequence[:len(quality)] - if accuracy: - assert len(sequence) == len(accuracy), (sequence, accuracy) - return "@%s\n%s\n+\n%s\n" % (name, sequence, accuracy) + if quality: + assert len(sequence) == len(quality), (sequence, quality) + return "@%s\n%s\n+\n%s\n" % (name, sequence, quality) else: return ">%s\n%s\n" % (name, sequence) diff --git a/sandbox/normalize-by-median-pct.py b/sandbox/normalize-by-median-pct.py index 26594b561e..cdacc0a8b2 100755 --- a/sandbox/normalize-by-median-pct.py +++ b/sandbox/normalize-by-median-pct.py @@ -139,10 +139,10 @@ def main(): # Emit records if any passed if passed_length and passed_filter: for record in batch: - if hasattr(record, 'accuracy'): + if hasattr(record, 'quality'): outfp.write('@%s\n%s\n+\n%s\n' % (record.name, record.sequence, - record.accuracy)) + record.quality)) else: outfp.write('>%s\n%s\n' % (record.name, record.sequence)) diff --git a/sandbox/slice-reads-by-coverage.py b/sandbox/slice-reads-by-coverage.py index e1103c4e39..594a68756b 100755 --- a/sandbox/slice-reads-by-coverage.py +++ b/sandbox/slice-reads-by-coverage.py @@ -11,8 +11,8 @@ def output_single(read): - if hasattr(read, 'accuracy'): - return "@%s\n%s\n+\n%s\n" % (read.name, read.sequence, read.accuracy) + if hasattr(read, 'quality'): + return "@%s\n%s\n+\n%s\n" % (read.name, read.sequence, read.quality) else: return ">%s\n%s\n" % (read.name, read.sequence) diff --git a/sandbox/sweep-files.py b/sandbox/sweep-files.py index 89215c3aad..662ee9f5f6 100755 --- a/sandbox/sweep-files.py +++ b/sandbox/sweep-files.py @@ -69,8 +69,8 @@ def get_parser(): def output_single(r): - if hasattr(r, 'accuracy'): - return "@%s\n%s\n+\n%s\n" % (r.name, r.sequence, r.accuracy) + if hasattr(r, 'quality'): + return "@%s\n%s\n+\n%s\n" % (r.name, r.sequence, r.quality) else: return ">%s\n%s\n" % (r.name, r.sequence) diff --git a/sandbox/sweep-reads3.py b/sandbox/sweep-reads3.py index c56d640d15..45f1492f71 100755 --- a/sandbox/sweep-reads3.py +++ b/sandbox/sweep-reads3.py @@ -23,8 +23,8 @@ def output_single(r): - if hasattr(r, 'accuracy'): - return "@%s\n%s\n+\n%s\n" % (r.name, r.sequence, r.accuracy) + if hasattr(r, 'quality'): + return "@%s\n%s\n+\n%s\n" % (r.name, r.sequence, r.quality) else: return ">%s\n%s\n" % (r.name, r.sequence) diff --git a/sandbox/to-casava-1.8-fastq.py b/sandbox/to-casava-1.8-fastq.py index d7b0750c73..b4b5e6db07 100755 --- a/sandbox/to-casava-1.8-fastq.py +++ b/sandbox/to-casava-1.8-fastq.py @@ -47,10 +47,10 @@ def main(): new_name = resub_read_2(new_name) output_file.write( - "@{name}\n{sequence}\n+\n{accuracy}\n".format( + "@{name}\n{sequence}\n+\n{quality}\n".format( name=new_name, sequence=read.sequence, - accuracy=read.accuracy, + quality=read.quality, ) )