Skip to content

Commit

Permalink
Merge branch 'refs/heads/master-priv' into master-pub
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermann Romanek committed Nov 10, 2024
2 parents f28e380 + 6a773b2 commit f21b8ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/sniffles/genotyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def calculate(self):

a, b = gt1
svcall.genotypes[0] = (a, b, genotype_quality, coverage - support, support, self.phase)
svcall.set_info("AF", af)
svcall.set_info("VAF", af)


class InsertionGenotyper(Genotyper):
Expand Down
8 changes: 4 additions & 4 deletions src/sniffles/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def qc_support_const(svcall, config):


def qc_sv(svcall: SVCall, config: SnifflesConfig):
af = svcall.get_info("AF")
af = svcall.get_info("VAF")
af = af if af is not None else 0
sv_is_mosaic = af <= config.mosaic_af_max

Expand Down Expand Up @@ -368,7 +368,7 @@ def qc_sv(svcall: SVCall, config: SnifflesConfig):


def qc_sv_post_annotate(svcall: SVCall, config: SnifflesConfig):
af = svcall.get_info("AF")
af = svcall.get_info("VAF")
af = af if af is not None else 0
sv_is_mosaic = af <= config.mosaic_af_max

Expand All @@ -389,10 +389,10 @@ def qc_sv_post_annotate(svcall: SVCall, config: SnifflesConfig):

if config.mosaic:
if sv_is_mosaic and (af < config.mosaic_af_min or af > config.mosaic_af_max):
svcall.filter = "MOSAIC_AF"
svcall.filter = "MOSAIC_VAF"
return False
elif not sv_is_mosaic and not config.mosaic_include_germline:
svcall.filter = "NOT_MOSAIC_AF"
svcall.filter = "NOT_MOSAIC_VAF"
return False

return True
Expand Down
8 changes: 4 additions & 4 deletions src/sniffles/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def write_header(self, contigs_lengths):
self.write_header_line('FILTER=<ID=COV_CHANGE_FRAC_SC,Description="Coverage fractional change filter: start-center">')
self.write_header_line('FILTER=<ID=COV_CHANGE_FRAC_CE,Description="Coverage fractional change filter: center-end">')
self.write_header_line('FILTER=<ID=COV_CHANGE_FRAC_ED,Description="Coverage fractional change filter: end-downstream">')
self.write_header_line('FILTER=<ID=MOSAIC_AF,Description="Mosaic variant allele frequency filter">')
self.write_header_line('FILTER=<ID=NOT_MOSAIC_AF,Description="Variant allele frequency filter for non-mosaic">')
self.write_header_line('FILTER=<ID=MOSAIC_VAF,Description="Mosaic variant allele fraction filter">')
self.write_header_line('FILTER=<ID=NOT_MOSAIC_VAF,Description="Variant allele fraction filter for non-mosaic">')
self.write_header_line('FILTER=<ID=ALN_NM,Description="Length adjusted mismatch filter">')
self.write_header_line('FILTER=<ID=STRAND_BND,Description="Strand support filter for BNDs">')
self.write_header_line('FILTER=<ID=STRAND,Description="Strand support filter for germline SVs">')
Expand All @@ -171,7 +171,7 @@ def write_header(self, contigs_lengths):
self.write_header_line('INFO=<ID=SUPP_VEC,Number=1,Type=String,Description="List of read support for all samples">')
self.write_header_line('INFO=<ID=CONSENSUS_SUPPORT,Number=1,Type=Integer,Description="Number of reads that support the generated insertion (INS) consensus sequence">')
self.write_header_line('INFO=<ID=RNAMES,Number=.,Type=String,Description="Names of supporting reads (if enabled with --output-rnames)">')
self.write_header_line('INFO=<ID=AF,Number=1,Type=Float,Description="Allele Frequency">')
self.write_header_line('INFO=<ID=VAF,Number=1,Type=Float,Description="Variant Allele Fraction">')
self.write_header_line('INFO=<ID=NM,Number=.,Type=Float,Description="Mean number of query alignment length adjusted mismatches of supporting reads">')
self.write_header_line('INFO=<ID=PHASE,Number=.,Type=String,Description="Phasing information derived from supporting reads, represented as list of: HAPLOTYPE,PHASESET,HAPLOTYPE_SUPPORT,PHASESET_SUPPORT,HAPLOTYPE_FILTER,PHASESET_FILTER">')

Expand Down Expand Up @@ -249,7 +249,7 @@ def write_call(self, call):
infos["END"] = end - 1

infos_ordered = ["PRECISE" if call.precise else "IMPRECISE"]
af = call.get_info("AF")
af = call.get_info("VAF")
af = af if af is not None else 0
sv_is_mosaic = af <= self.config.mosaic_af_max
if sv_is_mosaic and self.config.mosaic:
Expand Down

0 comments on commit f21b8ef

Please sign in to comment.