Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/787 #830

Merged
merged 6 commits into from
Feb 25, 2015
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2015-02-23 Aditi Gupta <agupta@msu.edu>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two spaces between the date and your name and just two spaces between your name and your email address.


* sandbox/{collect-reads.py, correct-errors.py,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph should be indented by one more column to match the formatting of the rest of the ChangeLog entries.

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-23 Kevin Murray <spam@kdmurray.id.au>

* khmer/load_pe.py: Remove unused/undocumented module. See #784
4 changes: 2 additions & 2 deletions sandbox/collect-reads.py
Original file line number Diff line number Diff line change
@@ -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)

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

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

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

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

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