Skip to content
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

FlowFeatureMapper: X_FILTERED_COUNT semantics adjusted and documented more accurately #8894

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public VCFHeader makeVCFHeader(final SAMSequenceDictionary sequenceDictionary, f
headerInfo.add(new VCFInfoHeaderLine(VCF_MAPQ, 1, VCFHeaderLineType.Integer, "Read mapqe"));
headerInfo.add(new VCFInfoHeaderLine(VCF_CIGAR, 1, VCFHeaderLineType.String, "Read CIGAR"));
headerInfo.add(new VCFInfoHeaderLine(VCF_READ_COUNT, 1, VCFHeaderLineType.Integer, "Number of reads containing this location"));
headerInfo.add(new VCFInfoHeaderLine(VCF_FILTERED_COUNT, 1, VCFHeaderLineType.Integer, "Number of reads containing this location that agree with reference according to fitler"));
headerInfo.add(new VCFInfoHeaderLine(VCF_FILTERED_COUNT, 1, VCFHeaderLineType.Integer, "Number of reads containing this location that pass the adjacent base filter"));
headerInfo.add(new VCFInfoHeaderLine(VCF_FC1, 1, VCFHeaderLineType.Integer, "Number of M bases different on read from references"));
headerInfo.add(new VCFInfoHeaderLine(VCF_FC2, 1, VCFHeaderLineType.Integer, "Number of features before score threshold filter"));
headerInfo.add(new VCFInfoHeaderLine(VCF_LENGTH, 1, VCFHeaderLineType.Integer, "Read length"));
Expand Down Expand Up @@ -475,7 +475,8 @@ private void enrichFeature(final MappedFeature fr) {
for ( ReadContext rc : readQueue ) {
if ( rc.read.contains(loc) ) {
fr.readCount++;
if ( mapper.noFeatureButFilterAt(rc.read, rc.referenceContext, fr.start) == FeatureMapper.FilterStatus.Filtered ) {
FeatureMapper.FilterStatus fs = mapper.noFeatureButFilterAt(rc.read, rc.referenceContext, fr.start);
if ( (fs == FeatureMapper.FilterStatus.Filtered) || (fs == FeatureMapper.FilterStatus.NoFeatureAndFiltered) ) {
fr.filteredCount++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,40 +277,37 @@ public FilterStatus noFeatureButFilterAt(GATKRead read, ReferenceContext referen
readOfs += delta;
refOfs += delta;

if ( bases[readOfs] == ref[refOfs] ) {

// check that this is really a SNV (must be surrounded by identical ref)
boolean surrounded = true;
for ( int i = 0 ; i < surroundBefore && surrounded ; i++ ) {
final int bIndex = readOfs-1-i;
final int rIndex = refOfs-1-i;
if ( bIndex < 0 || bIndex >= bases.length || rIndex < 0 || rIndex >= ref.length ) {
surrounded = false;
continue;
}
if ( bases[bIndex] != ref[rIndex] ) {
surrounded = false;
}
final boolean noFeature = bases[readOfs] == ref[refOfs];

// check that this is really a SNV (must be surrounded by identical ref)
boolean surrounded = true;
for ( int i = 0 ; i < surroundBefore && surrounded ; i++ ) {
final int bIndex = readOfs-1-i;
final int rIndex = refOfs-1-i;
if ( bIndex < 0 || bIndex >= bases.length || rIndex < 0 || rIndex >= ref.length ) {
surrounded = false;
continue;
}
for (int i = 0; i < surroundAfter && surrounded ; i++ ) {
final int bIndex = readOfs+1+i;
final int rIndex = refOfs+1+i;
if ( bIndex < 0 || bIndex >= bases.length || rIndex < 0 || rIndex >= ref.length ) {
surrounded = false;
continue;
}
if ( bases[bIndex] != ref[rIndex] ) {
surrounded = false;
}
if ( bases[bIndex] != ref[rIndex] ) {
surrounded = false;
}
if ( !surrounded ) {
}
for (int i = 0; i < surroundAfter && surrounded ; i++ ) {
final int bIndex = readOfs+1+i;
final int rIndex = refOfs+1+i;
if ( bIndex < 0 || bIndex >= bases.length || rIndex < 0 || rIndex >= ref.length ) {
surrounded = false;
continue;
}
if ( bases[bIndex] != ref[rIndex] ) {
surrounded = false;
}
}
if ( !surrounded ) {
continue;
}

// this is it! no feature but filtered in
return FilterStatus.NoFeatureAndFiltered;
} else
return FilterStatus.Filtered;
return noFeature ? FilterStatus.NoFeatureAndFiltered : FilterStatus.Filtered;

} else {

Expand Down
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Loading