Changes between Version 5 and Version 6 of SOPs/vcf_manipulation
- Timestamp:
- 06/05/14 09:47:41 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SOPs/vcf_manipulation
v5 v6 32 32 }}} 33 33 34 Annotate a VCF file (applying all filters with default values):34 Annotate a VCF file using [http://vcftools.sourceforge.net/perl_module.html#vcf-annotate vcf-annotate] 35 35 {{{ 36 cat Variants_all_samples.raw.vcf | vcf-annotate -f + > Variants_all_samples.withTags.vcf 36 # Apply all filters with default values: 37 vcf-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): 39 vcf-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": 41 vcf-annotate -f My_filters.txt Variants_all_samples.raw.vcf > Variants_all_samples.withTags.vcf 37 42 }}} 43 44 For 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]] 45 For 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 38 63 39 64 Sort by chromosome and then coordinates