Skip to content

Commit

Permalink
resolve bamtools #68
Browse files Browse the repository at this point in the history
Check that the quality string is fully comprised of "*", rather than if
the first character is "*".
  • Loading branch information
ekg committed Dec 7, 2012
1 parent 9273506 commit 33add63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/internal/bam/BamWriter_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void BamWriterPrivate::WriteAlignment(const BamAlignment& al) {

// write the base qualities
char* pBaseQualities = new char[queryLength]();
if ( al.Qualities.empty() || al.Qualities[0] == '*' || al.Qualities[0] == (char)0xFF )
if ( al.Qualities.empty() || ( al.Qualities.size() == 1 && al.Qualities[0] == '*' ) || al.Qualities[0] == (char)0xFF )
memset(pBaseQualities, 0xFF, queryLength); // if missing or '*', fill with invalid qual
else {
for ( size_t i = 0; i < queryLength; ++i )
Expand Down

0 comments on commit 33add63

Please sign in to comment.