-
Notifications
You must be signed in to change notification settings - Fork 594
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
SNVQ recalibration for flow based reads #8697
Changes from 9 commits
0ce6afe
bf5d2d8
876a4e6
86d3ae4
c5e2ad8
fcbbd3c
ba29b3c
ac66953
8d9782f
a032030
626a458
b4d8341
2d69e85
92aab19
c564dc6
51ebdb5
a7947b9
5e6da62
fcb1f83
8f17ea5
8634c11
9ba77d3
44b6763
2f478de
13aa6ee
5850557
d6707d2
d0e4a0f
f79da59
b2337dd
78818b4
f081cb5
1a8b734
1461c82
1170d4b
7da3aa6
2b25b21
3cb409c
94d4fe7
4afc042
4f8320e
9c17210
5577f79
ef7ea5e
eacc100
a2b7f54
06284b0
4ee1255
bc0ff83
ff06e36
403bd29
a6afd8e
516c152
4ee5b6d
d9c090b
0c73917
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,6 @@ | ||||||
package org.broadinstitute.hellbender.tools.walkers.featuremapping; | ||||||
|
||||||
import org.broadinstitute.barclay.argparser.Advanced; | ||||||
import org.broadinstitute.barclay.argparser.Argument; | ||||||
import org.broadinstitute.barclay.argparser.Hidden; | ||||||
|
||||||
|
@@ -11,6 +12,13 @@ | |||||
*/ | ||||||
public class AddFlowSNVQualityArgumentCollection implements Serializable{ | ||||||
private static final long serialVersionUID = 1L; | ||||||
public static final String MAX_PHRED_SCORE_FULL_NAME = "max-phred-score"; | ||||||
public static final String KEEP_SUPPLEMENTARY_ALIGNMENTS_FULL_NAME = "keep-supplementary-alignments"; | ||||||
public static final String INCLUDE_QC_FAILED_READ_FULL_NAME = "include-qc-failed-read"; | ||||||
public static final String SNVQ_MODE_FULL_NAME = "snvq-mode"; | ||||||
public static final String OUTPUT_QUALITY_ATTRIBUTE_FULL_NAME = "output-quality-attribute"; | ||||||
public static final String DEBUG_READ_NAME_FULL_NAME = "debug-read-name"; | ||||||
public static final String DEBUG_COLLECT_STATS_INTO_FULL_NAME = "debug-collect-stats-into"; | ||||||
|
||||||
public enum SnvqModeEnum { | ||||||
Legacy, | ||||||
|
@@ -23,25 +31,40 @@ public enum SnvqModeEnum { | |||||
* maximum value for | ||||||
* delta in score | ||||||
**/ | ||||||
@Argument(fullName = "limit-phred-score", doc = "Limit value for phred scores", optional = true) | ||||||
public double limitPhredScore = Double.NaN; | ||||||
@Argument(fullName = MAX_PHRED_SCORE_FULL_NAME, doc = "Limit value for phred scores", optional = true) | ||||||
public double maxPhredScore = Double.NaN; | ||||||
|
||||||
/** | ||||||
* keep supplementary alignments? | ||||||
**/ | ||||||
@Argument(fullName = "keep-supplementary-alignments", doc = "keep supplementary alignments ?", optional = true) | ||||||
@Argument(fullName = KEEP_SUPPLEMENTARY_ALIGNMENTS_FULL_NAME, doc = "keep supplementary alignments ?", optional = true) | ||||||
public boolean keepSupplementaryAlignments = true; | ||||||
|
||||||
@Advanced | ||||||
@Argument(fullName= INCLUDE_QC_FAILED_READ_FULL_NAME, doc = "include reads with QC failed flag", optional = true) | ||||||
public boolean includeQcFailedReads = true; | ||||||
|
||||||
/** | ||||||
* snvq computation mode | ||||||
*/ | ||||||
@Argument(fullName = "snvq-mode", doc = "ksnvq computation mode", optional = true) | ||||||
@Argument(fullName = SNVQ_MODE_FULL_NAME, doc = "snvq calculation mode.", optional = true) | ||||||
public SnvqModeEnum snvMode = SnvqModeEnum.Geometric; | ||||||
|
||||||
/** | ||||||
* alternate quality attribute to set instead of the usual quality string | ||||||
*/ | ||||||
@Argument(fullName = OUTPUT_QUALITY_ATTRIBUTE_FULL_NAME, doc = "alternate quality attribute to set instead of the usual quality string.", optional = true) | ||||||
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.
Suggested change
|
||||||
public String outputQualityAttribute = null; | ||||||
|
||||||
/** | ||||||
* debug read names? | ||||||
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. I think more comments on all of these arguments would be useful. For example, this doc should be more like:
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. Done. Thank you for the texts |
||||||
**/ | ||||||
@Hidden | ||||||
@Argument(fullName = "debug-read-name", doc = "debug specific reads?", optional = true) | ||||||
@Argument(fullName = DEBUG_READ_NAME_FULL_NAME, doc = "Read names of reads to output details of as part of debugging. ", optional = true) | ||||||
public List<String> debugReadName = null; | ||||||
|
||||||
@Advanced | ||||||
@Hidden | ||||||
@Argument(fullName= DEBUG_COLLECT_STATS_INTO_FULL_NAME, doc = "Statistics about the reads will be output to given filename.", optional = true) | ||||||
public String debugCollectStatsInto = null; | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.broadinstitute.hellbender.tools.walkers.featuremapping; | ||
|
||
import org.broadinstitute.hellbender.testutils.BaseTest; | ||
import org.testng.Assert; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
public class AddFlowSNVQualityUnitTest extends BaseTest { | ||
|
||
@DataProvider(name = "sliceIsValidDataProvider") | ||
Object[][] sliceIsValidDataProvider() { | ||
return new Object[][] { | ||
{ new int[] {0, 0, 0, 0, 0, 0}, 4, false }, | ||
{ new int[] {0, 0, 1, 0, 0, 1}, 4, true }, | ||
{ new int[] {1, 0, 0, 0, 1, 1}, 4, false }, | ||
}; | ||
} | ||
|
||
@Test(dataProvider = "sliceIsValidDataProvider") | ||
void testSliceIsValid(final int[] slice, final int flowOrderLength, final boolean isValid) { | ||
Assert.assertEquals(AddFlowSNVQuality.sliceIsValidForConsideration(slice, flowOrderLength), isValid); | ||
} | ||
|
||
@DataProvider(name = "getSnvqDataProvider") | ||
Object[][] getSnvqDataProvider() { | ||
return new Object[][] { | ||
{ 0.5, 0.2, 0.3, AddFlowSNVQualityArgumentCollection.SnvqModeEnum.Legacy, 0.5 }, | ||
{ 0.5, 0.2, 0.3, AddFlowSNVQualityArgumentCollection.SnvqModeEnum.Optimistic, 0.06 }, | ||
{ 0.5, 0.2, 0.3, AddFlowSNVQualityArgumentCollection.SnvqModeEnum.Pessimistic, 0.44 }, | ||
{ 0.5, 0.2, 0.3, AddFlowSNVQualityArgumentCollection.SnvqModeEnum.Geometric, Math.sqrt(0.06 * 0.44) }, | ||
}; | ||
} | ||
|
||
@Test(dataProvider = "getSnvqDataProvider") | ||
void testGetSnvq(final double sliceP, final double p1, final double p2, AddFlowSNVQualityArgumentCollection.SnvqModeEnum snvMode, final double expected) { | ||
Assert.assertEquals(AddFlowSNVQuality.getSnvq(sliceP, p1, p2, snvMode), expected, 0.0001); | ||
} | ||
|
||
} |
|
This file was deleted.
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.