Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kcibul committed Mar 9, 2021
1 parent f7fdda6 commit 20bbff4
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ private void createVariantsFromUngroupedTableResult(final GATKAvroReader avroRea

sortingCollection.printTempFileStats();

// KCIBUL: I think in order to solve the "overlapping deletions that overlap variants/ref(?) this should be turned into
// some kind of hashmap instead with a rule about conflicts. It'll slow down the code but I think it's necessary
// final List<GenericRecord> currentPositionRecords = new ArrayList<>(sampleNames.size() * 2);
final Map<String, GenericRecord> currentPositionRecords = new HashMap<>(sampleNames.size() * 2);

long currentLocation = -1;
Expand Down Expand Up @@ -298,10 +295,7 @@ private GenericRecord mergeSampleRecord(GenericRecord r1, GenericRecord r2) {
final String r2State = r2.get(SchemaUtils.STATE_FIELD_NAME).toString();

// Valid states are m, 1-6 (ref), v, *

// KCIBUL: thinking out loud... is precedence v, reference, *, missing?

// TODO: for now, just handle cases where '*' should be dropped in favor anything besides missing...
// For now, just handle cases where '*' should be dropped in favor anything besides missing...
if (r1State.equals("*") && !r2State.equals("m")) {
return r2;
} else if (r2State.equals("*") && !r1State.equals("m")) {
Expand Down Expand Up @@ -445,7 +439,6 @@ private void processSampleRecordsForLocation(final long location, final Iterable

// same qualapprox check as Gnarly
final boolean isIndel = !hasSnpAllele;
System.out.println("KCIBUL -- in the qualapprox w/ " + totalAsQualApprox + " for isIndel " + isIndel + " and SNP:" + SNP_QUAL_THRESHOLD + " and INDEL:" + INDEL_QUAL_THRESHOLD);
if((isIndel && totalAsQualApprox < INDEL_QUAL_THRESHOLD) || (!isIndel && totalAsQualApprox < SNP_QUAL_THRESHOLD)) {
if ( printDebugInformation ) {
logger.info(contig + ":" + currentPosition + ": dropped for low QualApprox of " + totalAsQualApprox);
Expand Down Expand Up @@ -485,12 +478,13 @@ private void finalizeCurrentVariant(final List<VariantContext> unmergedCalls, fi
false,
true);

// need to insert QUALapprox into the variant context
final VariantContextBuilder builder = new VariantContextBuilder(mergedVC);
builder.getAttributes().put("QUALapprox", Integer.toString((int) qualApprox));
final VariantContext mergedVC2 = builder.make();
final VariantContext qualapproxVC = builder.make();


final VariantContext genotypedVC = disableGnarlyGenotyper ? mergedVC2 : gnarlyGenotyper.finalizeGenotype(mergedVC2);
final VariantContext genotypedVC = disableGnarlyGenotyper ? qualapproxVC : gnarlyGenotyper.finalizeGenotype(qualapproxVC);
final VariantContext finalVC = noFilteringRequested || mode.equals(CommonCode.ModeEnum.ARRAYS) ? genotypedVC : filterVariants(genotypedVC, vqsLodMap, yngMap);

if ( finalVC != null ) {
Expand Down

0 comments on commit 20bbff4

Please sign in to comment.