-
Notifications
You must be signed in to change notification settings - Fork 592
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
baf fixes #7861
baf fixes #7861
Conversation
tedsharpe
commented
May 19, 2022
- Allows negative BAFs (so that we can process legacy files).
- Skips same-site vcf records so that we can glide over the redundancies in the dbsnp sites vcf.
Codecov Report
@@ Coverage Diff @@
## master #7861 +/- ##
===============================================
+ Coverage 86.930% 86.992% +0.062%
- Complexity 36954 36960 +6
===============================================
Files 2221 2221
Lines 173829 173904 +75
Branches 18779 18784 +5
===============================================
+ Hits 151110 151283 +173
+ Misses 16087 15982 -105
- Partials 6632 6639 +7
|
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.
Thank you, looks good! It just occurred to me that we're missing some testing for BAF collection. Otherwise, minor comments.
Arrays.sort(vals); | ||
final int midIdx = nBafs / 2; | ||
final double median = | ||
(nBafs & 1) != 0 ? vals[midIdx] : (vals[midIdx] + vals[midIdx - 1])/2.; |
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.
Just out of curiosity, what's the & 1
for?
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 & 1) is the way that 133t h4x0r d00dz such as myself test for odd integers. will change to (i % 2).
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 I see it now
Utils.validateArg(value >= 0. || value == MISSING_VALUE, | ||
"value must be non-negative or missing"); |
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.
Can you add tests for values 0 and <0?
@@ -591,7 +591,7 @@ public AlleleCounter( final SAMSequenceDictionary dict, | |||
final FeatureDataSource<VariantContext> snpSource = | |||
new FeatureDataSource<>(inputPath.toPath().toString()); | |||
dict.assertSameDictionary(snpSource.getSequenceDictionary()); | |||
this.snpSourceItr = snpSource.iterator(); | |||
this.snpSourceItr = new BAFSiteIterator(snpSource.iterator()); |
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.
It looks like we're missing tests for BAF, can you add unit/integration tests?
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 BAFEvidence unit test also tests the codecs by making round trips. I could add an integration test for each codec. Would that suffice?
Actually, a second thing just popped into my head. The name Is there another name we could use? I think |
|
Regarding finding a new name for LocusDepth: I'm fine with SiteDepth, but it seems to me that what really makes this class different from DepthEvidence, for example, is that it measures the read depth for each possible call. Should it be AlleleDepth? |
I believe the most recent commit addresses all review comments except for "missing tests for BAF". |
Github actions tests reported job failures from actions build 2448670766
|
I think that makes sense too but could be confusing mainly because AlleleDepth is already a haplotypecaller VCF field |
I think this is ready to go. Differences of opinion welcomed. |
The coverage issues were, I believe, due to failing tests. |
I believe this is ready now. Added a couple of unit tests on the AlleleCounter. @mwalker174: Can I get another quick look from you? |
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.
Looks good! A couple of tiny comments and then good to merge
summary = "Convert LocusDepth to BafEvidence", | ||
oneLineSummary = "Convert LocusDepth to BafEvidence", | ||
summary = "Convert SiteDepth to BafEvidence", | ||
oneLineSummary = "Convert SiteDepth to BafEvidence", | ||
programGroup = StructuralVariantDiscoveryProgramGroup.class | ||
) | ||
@ExperimentalFeature |
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.
@ExperimentalFeature | |
@ExperimentalFeature | |
@DocumentedFeature |
/** Codec to handle SiteDepths in BlockCompressedInterval files */ | ||
public class SiteDepthBCICodec extends AbstractBCICodec<SiteDepth> { | ||
private boolean versionChecked = false; | ||
private static final String LD_BCI_FILE_EXTENSION = ".sd.bci"; |
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.
private static final String LD_BCI_FILE_EXTENSION = ".sd.bci"; | |
private static final String SD_BCI_FILE_EXTENSION = ".sd.bci"; |
public class LocusDepthtoBAFIntegrationTest extends CommandLineProgramTest { | ||
public static final String ld2bafTestDir = toolsTestDir + "walkers/sv/LocusDepthtoBAF/"; | ||
public class SiteDepthtoBAFIntegrationTest extends CommandLineProgramTest { | ||
public static final String ld2bafTestDir = toolsTestDir + "walkers/sv/SiteDepthToBAF/"; |
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.
public static final String ld2bafTestDir = toolsTestDir + "walkers/sv/SiteDepthToBAF/"; | |
public static final String sd2bafTestDir = toolsTestDir + "walkers/sv/SiteDepthToBAF/"; |