Skip to content

Commit

Permalink
Fixed sandbox files to use 'quality' instead of 'accuracy', fixes iss…
Browse files Browse the repository at this point in the history
…ue 787
  • Loading branch information
aditi9783 committed Feb 23, 2015
1 parent 9fbe32e commit 257cb3d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions sandbox/collect-reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
14 changes: 7 additions & 7 deletions sandbox/correct-errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions sandbox/normalize-by-median-pct.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions sandbox/slice-reads-by-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,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)

Expand Down
4 changes: 2 additions & 2 deletions sandbox/sweep-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions sandbox/sweep-reads3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions sandbox/to-casava-1.8-fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
)

Expand Down

0 comments on commit 257cb3d

Please sign in to comment.