Changes between Version 7 and Version 8 of VCFAggregateScriptManual
- Timestamp:
- 2014-09-17T14:30:22+02:00 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VCFAggregateScriptManual
v7 v8 27 27 = Aggregation procedure = 28 28 29 == 1. Merge sample VCFs into one batch VCF == 29 == 1. Sort, filter, bgzip and index == 30 31 VCFtools will not work on uncompressed, unindexed VCF files so we must sort, filter on 'PASS', bgzip and index with tabix. 30 32 31 33 {{{ 32 vcf-merge CAR_*/*.vcf.sorted.filtered.gz | bgzip -c > merged.vcf.gz 34 for item in $(ls mydirectory/*.vcf); \ 35 do echo "Processing $item..."; \ 36 vcf-sort $item | vcf-annotate -H > $item\.sorted\.filtered; \ 37 bgzip $item\.sorted\.filtered; \ 38 tabix -p vcf $item\.sorted\.filtered\.gz; \ 39 done 33 40 }}} 34 41 35 == 2. Create a summary VCF per batch == 42 43 == 2. Merge sample VCFs into one batch VCF == 44 45 {{{ 46 vcf-merge mydirectory/*.vcf.sorted.filtered.gz | bgzip -c > merged.vcf.gz 47 }}} 48 49 == 3. Create a summary VCF per batch == 36 50 37 51 {{{ … … 39 53 }}} 40 54 41 '' The option -ss is crucial here: it removed all sample details.''55 '''The option -ss is crucial here: it removed all sample details.''' 42 56 43 57 Afterwards, be sure to inspect the log file for warnings! … … 47 61 }}} 48 62 49 Man page: 63 64 65 66 == Troubleshooting == 67 68 Q: My VCF files are not completely valid format! 69 A: The are some built-in options to help with this. For example: 70 71 Fix missing '>' at the end of contig meta-data lines. 72 73 {{{ 74 perl -pi -e 's/(contig=<ID=[^>\n]+)$/$1>/' mydirectory/*.vcf 75 }}} 76 77 Q: What are the script options? 78 A: Man page: 50 79 51 80 {{{ … … 62 91 # 63 92 }}} 64 65 66 == Troubleshooting ==67 68 Q: My VCF files are not completely valid format!69 A: The are some built-in options to help with this. For example:70 71 Prepare sample VCFs for one batch; e.g. CAR_Batch1_106Samples72 73 {{{74 cd /Volumes/CardioKitVCFs/OriginalVCFs/CAR_Batch1_106Samples75 }}}76 77 Fix missing '>' at the end of contig meta-data lines.78 79 {{{80 perl -pi -e 's/(contig=<ID=[^>\n]+)$/$1>/' CAR_*/*.vcf81 }}}82 83 Sort, filter on 'PASS', bgzip and index with tabix (vcftools will not work on uncompressed, unindexed VCF files.)84 85 {{{86 for item in $(ls CAR_*/*.vcf); \87 do echo "Processing $item..."; \88 vcf-sort $item | vcf-annotate -H > $item\.sorted\.filtered; \89 bgzip $item\.sorted\.filtered; \90 tabix -p vcf $item\.sorted\.filtered\.gz; \91 done92 }}}