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

Removes unnecessary and buggy validation check #8580

Merged
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 @@ -340,7 +340,7 @@ private AlleleLikelihoods<GATKRead, Allele> getAlleleLikelihoodMatrix(final Alle
.forEach(alleleHaplotypeMap.get(notAllele)::add);

final AlleleLikelihoods<GATKRead, Allele> alleleLikelihoods = readLikelihoods.marginalize(alleleHaplotypeMap);
logger.debug(() -> String.format("GALM: %s %d %d", allele.toString(), alleleHaplotypeMap.get(allele).size(), alleleHaplotypeMap.get(notAllele).size()));
logger.debug(() -> String.format("GALM: %s %d %d", allele, alleleHaplotypeMap.get(allele.altAllele()).size(), alleleHaplotypeMap.get(notAllele).size()));
return alleleLikelihoods;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class FlowBasedRead extends SAMRecordToGATKReadAdapter implements GATKRea
public static final int MAX_CLASS = 12; //note - this is a historical value to support files with max class is not defined in the header, it is expected that mc tag exists in the CRAM
public static final String DEFAULT_FLOW_ORDER = "TGCA";
private static final long serialVersionUID = 42L;
private final Logger logger = LogManager.getLogger(this.getClass());
private static final Logger logger = LogManager.getLogger(FlowBasedRead.class);
private static final OneShotLogger vestigialOneShotLogger = new OneShotLogger(FlowBasedRead.class);

// constants
Expand Down Expand Up @@ -117,7 +117,7 @@ public class FlowBasedRead extends SAMRecordToGATKReadAdapter implements GATKRea
* The validity status of the key. Certain operations may produce undefined/errornous results. This is signaled by
* the read being marked with a validKey == false
*/
private boolean validKey;
private boolean validKey = true;

/**
* The direction of this read. After being red, the direction will also swing to be REFERENCE
Expand Down Expand Up @@ -248,7 +248,6 @@ public FlowBasedRead(final SAMRecord samRecord, final String flowOrder, final in
logger.debug(" key: " + FlowBasedKeyCodec.keyAsString(key));
}

validateSequence();
}

//since the last unclipped flow is uncertain (we give high probabilities to
Expand Down Expand Up @@ -428,16 +427,6 @@ private int[] getAttributeAsIntArray(final String attributeName, final boolean i
}
}


private void validateSequence(){
for (final int b : key) {
if (b > maxHmer - 1) {
validKey = false;
}
}
validKey = true;
}

public boolean isValid() {
return validKey;
}
Expand Down Expand Up @@ -584,6 +573,7 @@ public void applyBaseClipping(final int clipLeftBase, final int clipRightBase, b
} else {
applyClipping(clipLeft, leftHmerClip, clipRight, rightHmerClip, spread);
baseClipped = true;
validKey = true;
trimLeftBase = clipLeftBase;
trimRightBase = clipRightBase;
}
Expand Down Expand Up @@ -1109,7 +1099,6 @@ private void readVestigialFlowMatrixFromKR(final String _flowOrder) {
final double [] kdProbs = phredToProb(kd);
fillFlowMatrix( kh, kf, kdProbs);
applyFilteringFlowMatrix();
validateSequence();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
hmersLeft--;
}

int hmerSize = 1;
int hmerSize = 1;

Check warning on line 306 in src/main/java/org/broadinstitute/hellbender/utils/read/FlowBasedReadUtils.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/utils/read/FlowBasedReadUtils.java#L306

Added line #L306 was not covered by tests
for ( ; hmerSize < bases.length ; hmerSize++ )
if (bases[hmerSize] != hmerBase) {
if ( --hmersLeft <= 0 )
Expand Down
Loading