-
Notifications
You must be signed in to change notification settings - Fork 311
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
Bugfix for BQSR: Offset into qualityScore list was wrong #60
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...re/src/test/scala/edu/berkeley/cs/amplab/adam/rdd/recalibration/ReadCovariatesSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woohoo! More tests! |
||
* Copyright (c) 2014. Mount Sinai School of Medicine | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package edu.berkeley.cs.amplab.adam.rdd.recalibration | ||
|
||
import edu.berkeley.cs.amplab.adam.util.SparkFunSuite | ||
import edu.berkeley.cs.amplab.adam.avro.ADAMRecord | ||
import edu.berkeley.cs.amplab.adam.models.SnpTable | ||
|
||
class ReadCovariatesSuite extends SparkFunSuite { | ||
|
||
test("Test Quality Offset"){ | ||
|
||
val read = ADAMRecord.newBuilder() | ||
.setRecordGroupId(0) | ||
.setReadMapped(true).setStart(10000) | ||
.setReferenceName("1") | ||
.setCigar("10M") | ||
.setMismatchingPositions("5C4") | ||
.setSequence("CTACCCTAAC") | ||
.setQual("##LKLPPQ##") | ||
.build() | ||
var readCovar = ReadCovariates( read, new QualByRG(), List(new BaseContext(2)), SnpTable() ) | ||
val firstBaseCovar = readCovar.next() | ||
assert(firstBaseCovar.qual === 43 ) | ||
readCovar.foreach(bc => assert(bc.qual === bc.qualByRG) ) | ||
|
||
readCovar = ReadCovariates( read, new QualByRG(), List(new BaseContext(2)), SnpTable() ) | ||
val bases = readCovar.drop(3) | ||
val mismatchedBase = bases.next() | ||
assert(mismatchedBase.qual === 47) | ||
assert(mismatchedBase.isMismatch === true) | ||
|
||
} | ||
|
||
test("Test ReadCovar on SoftClipped Read"){ | ||
|
||
val read = ADAMRecord.newBuilder() | ||
.setRecordGroupId(0) | ||
.setReadMapped(true).setStart(10000) | ||
.setReferenceName("1") | ||
.setCigar("2S6M2S") | ||
.setMismatchingPositions("3C2") | ||
.setSequence("CTACCCTAAC") | ||
.setQual("##LKLPPQ##") | ||
.build() | ||
var readCovar = ReadCovariates( read, new QualByRG(), List(new BaseContext(2)), SnpTable() ) | ||
val firstBaseCovar = readCovar.next() | ||
assert(firstBaseCovar.qual === 43 ) | ||
readCovar.foreach(bc => assert(bc.qual === bc.qualByRG) ) | ||
|
||
readCovar = ReadCovariates( read, new QualByRG(), List(new BaseContext(2)), SnpTable() ) | ||
val bases = readCovar.drop(3) | ||
val mismatchedBase = bases.next() | ||
assert(mismatchedBase.qual === 47) | ||
assert(mismatchedBase.isMismatch === true) | ||
|
||
} | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about the min quality value here. Is it arbitrary or a commonly used filter value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't know the significance of using 2. This was another reason I was getting different read counts vs GATK as their default min base quality is 6. At least this way its parameterizable, but if there is a more justified default we should probably change it to that. Or add a command line argument for it.
On that note, the argument options for Transform are growing large - is the goal to keep all of the operations in there (and all their various configurations) or to start splitting them out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phred 2 is P=0.5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Phred 2 is P=0.63
https://www.google.com/search?q=10+%5E+(-2%2F10)&oq=10+%5E+(-2%2F10)&aqs=chrome..69i57j0j69i64l2.7131j0j7&sourceid=chrome&espv=210&es_sm=119&ie=UTF-8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah—you're right—Phred 3 is P=0.5... My apologies for the mistake!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q2 is a legacy value; it's effectively Illumina's garbage value; they tend
to be bad bases even after recalibration. Q2 is what the machine produces
when it's read through a nucleotide repeat and has no real idea what the
bases are. See below: all the faint bases are Q2.
[image: Inline image 1]
On Mon, Jan 27, 2014 at 1:54 PM, Matt Massie notifications@github.comwrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also one of the primary targets for aligners that clip
low-quality tails.
On Mon, Jan 27, 2014 at 2:01 PM, christopherlhartl@gmail.com <
christopherlhartl@gmail.com> wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'transform' commandline growing large is ok for now. We want all the transformations to be part of a single job (to minimize i/o, improve pipelining, etc). In the future, we'll probably need to use a configuration file instead which defined the exact pipeline of operations and options the user wants.