Skip to content

Commit

Permalink
Issue #228 | now mask bad genotype sites as het
Browse files Browse the repository at this point in the history
  • Loading branch information
tseemann committed Aug 28, 2018
1 parent 52f656e commit a450ee4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Character | Meaning
`-` | Zero coverage in this sample **or** a deletion relative to the reference
`N` | Low coverage in this sample (based on `--mincov`)
`X` | Masked region of reference (from `--mask`)
`n` | Heterozygous site in this sample (has `GT=0/1` in `snps.raw.vcf`)
`n` | Heterozygous or poor quality genotype (has `GT=0/1` or `QUAL<--minqual` in `snps.raw.vcf`)

You can remove all the "weird" characters and replace them with `N` using the included
`snippy-clean_full_aln`. This is useful when you need to pass it to a tree-building
Expand Down
5 changes: 3 additions & 2 deletions bin/snippy
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,14 @@ while (<$depth_fh>) {
close $depth_fh;

# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# go back and patch in 'n' at all heterozygous sites
# go back and patch in 'n' at all heterozygous sites and low QUAL sites
# these could be 0/1, or 1/2 even, so we select any "het" site
# https://samtools.github.io/bcftools/bcftools-man.html#expressions
# QUAL issue: https://github.com/tseemann/snippy/issues/228

my $het_bp = 0;
open my $het_fh, '-|',
qq{bcftools query -i 'GT="het"' -f '%CHROM\\t%POS\\t%REF\\n' $prefix.raw.vcf};
qq{bcftools query -i 'GT="het" || QUAL<$minqual' -f '%CHROM\\t%POS\\t%REF\\n' $prefix.raw.vcf};
while (<$het_fh>) {
chomp;
my($chr,$pos,$ref) = split m/\t/;
Expand Down
2 changes: 1 addition & 1 deletion perl5/Snippy/Version.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use base Exporter;
@EXPORT_OK = qw(version);
%EXPORT_TAGS = ( 'all' => [ @EXPORT_OK ] );

our $VERSION = "4.0.7";
our $VERSION = "4.1.0";

use strict;
use File::Basename;
Expand Down

0 comments on commit a450ee4

Please sign in to comment.