Changes between Version 5 and Version 6 of SOPs/vcf_manipulation


Ignore:
Timestamp:
06/05/14 09:47:41 (11 years ago)
Author:
gbell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/vcf_manipulation

    v5 v6  
    3232}}}
    3333
    34 Annotate a VCF file (applying all filters with default values):
     34Annotate a VCF file using [http://vcftools.sourceforge.net/perl_module.html#vcf-annotate vcf-annotate]
    3535{{{
    36 cat Variants_all_samples.raw.vcf | vcf-annotate -f + > Variants_all_samples.withTags.vcf
     36# Apply all filters with default values:
     37vcf-annotate -f + Variants_all_samples.raw.vcf > Variants_all_samples.withTags.vcf
     38# Apply all filters with default values except for specified ones (MinAB(a) = 10; MinDP(b) = 20):
     39vcf-annotate -f +/a=10/d=20 Variants_all_samples.raw.vcf > Variants_all_samples.withTags.vcf
     40# Add custom filter(s) as described in file "My_filters.txt":
     41vcf-annotate -f My_filters.txt Variants_all_samples.raw.vcf > Variants_all_samples.withTags.vcf
    3742}}}
     43
     44For the last command, My_filters.txt contains a filter (such as an example one that calculates PLdiff values for 1/1 - 0/0 and 1/1 - 0/1, making sure that each difference is greater than 20).  In this case, the filter is designed for selection, rather than filtering out. [[BR]]
     45For more examples, go to [http://vcftools.sourceforge.net/perl_module.html#vcf-annotate vcf-annotate] and click on "Read even more".
     46{{{
     47{
     48    tag      => 'FORMAT/PL',
     49    name     => 'GoodPLdiff',
     50    desc     => 'Homozygote alternate and PLdiff greater than 20',
     51    apply_to => 'all',
     52    test     => sub {
     53            for my $pl (@$MATCH)
     54            {
     55                my @pls = split(/,/,$pl);
     56                if ( ($pls[2]-$pls[0])>20 && ($pls[1]-$pls[0])>20 ) { return $FAIL; }
     57            }
     58        return $PASS;
     59    },
     60},
     61}}}
     62
    3863
    3964Sort by chromosome and then coordinates