-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
bug: the logic for the PileupBuilder includeMapPositionsOutsideFrInsert
filter is wrong
#980
Comments
I confirm:
Check out #981. I can't assign you as a reviewer, but would like your 👀 on it. |
The history of the filter started 5 years ago in the context of somatic variant filtration: fgbio/src/main/scala/com/fulcrumgenomics/vcf/filtration/FilterSomaticVcf.scala Lines 140 to 166 in ff43d10
It was then refactored into the PileupBuilder and swapped from a negative filter ( The filter still behaves correctly:
Because of this semantic change, the
And its default set to |
What do you think of renaming |
@jrm5100 I don't think we want to exclude records in a pair where a mate maps to a different reference sequence. Although these pairs would not be proper, they should still count towards coverage when requesting a pile up of reads overlapping either of the reads in the pair. But if you do not want to include pairs with reads mapped to different reference sequences, you can add a custom filter like: PileupBuilder(source).withReadFilter(rec => rec.refName == rec.mateRefName) |
I think the main sticking point here is the intention of the filter. Anything not
Reads that are
and being So is the filter meant to:
The distinction is where It seems like the second is the intended usage. In that case I think the current filter name and functionality is fine, but the internal function just needs to be renamed and used slightly differently:
In this case the
Yeah, after reading through the code more I realized that and settled on
Which is slightly more strict, but works for my purposes. |
Yes, this was the original intent of the filter:
So I need to revert the change I just made and update the documentation to be more clear. The original |
positionIsOutsideFrInsert
is actuallypositionIsInsideFrInsert
fgbio/src/main/scala/com/fulcrumgenomics/bam/pileup/PileupBuilder.scala
Lines 123 to 128 in 3a74fd2
The filter is used in a way that is reversed so that the current tests still work as designed.
fgbio/src/main/scala/com/fulcrumgenomics/bam/pileup/PileupBuilder.scala
Lines 203 to 205 in 3a74fd2
Additionally there is a redundant
rec.isFrPair
call (this is done inside the method).I came across this because I was tracking down some aberrant alleles in a pileup. Should reads mapped to separate chromosomes be rejected by this filter, or should that be a separate filter (likely in
quickAcceptRecord
)? Currently these are accepted even ifincludeMapPositionsOutsideFrInsert
isfalse
, which i think may be misleading.The text was updated successfully, but these errors were encountered: