Skip to content

Commit

Permalink
changed mutect1 filter so sample order is rearranged in the correct way
Browse files Browse the repository at this point in the history
  • Loading branch information
rnaidu committed Aug 16, 2024
1 parent cfbbcdf commit eb4c6b0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions postprocessing_variant_calls/mutect/mutect_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,23 @@ def _write_to_vcf(outDir, vcf_out, vcf_reader, allsamples, tsampleName, keepDict
record.add_info("set", "MuTect")

# If the caller reported the normal genotype column before the tumor, swap those around

if allsamples[1] == tsampleName:
vcf_writer.samples[0] = allsamples[1]
vcf_writer.samples[1] = allsamples[0]


if record.FILTER == "PASS":
tum = record.samples[0]
nrm = record.samples[1]

record.samples[0] = tum
record.samples[1] = nrm
vcf_writer.write_record(record)
# Change the failure reason to PASS, for mutations for which we want to override MuTect's assessment
else:
record.FILTER = "PASS"
tum = record.samples[0]
nrm = record.samples[1]

record.samples[0] = tum
record.samples[1] = nrm
vcf_writer.write_record(record)
else:
continue
Expand Down

0 comments on commit eb4c6b0

Please sign in to comment.