Changes between Version 7 and Version 8 of VCFAggregateScriptManual


Ignore:
Timestamp:
2014-09-17T14:30:22+02:00 (10 years ago)
Author:
jvelde
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VCFAggregateScriptManual

    v7 v8  
    2727= Aggregation procedure =
    2828
    29 == 1. Merge sample VCFs into one batch VCF ==
     29== 1. Sort, filter, bgzip and index ==
     30
     31VCFtools will not work on uncompressed, unindexed VCF files so we must sort, filter on 'PASS', bgzip and index with tabix.
    3032
    3133{{{
    32 vcf-merge CAR_*/*.vcf.sorted.filtered.gz | bgzip -c > merged.vcf.gz
     34for item in $(ls mydirectory/*.vcf); \
     35do echo "Processing $item..."; \
     36vcf-sort $item | vcf-annotate -H > $item\.sorted\.filtered; \
     37bgzip $item\.sorted\.filtered; \
     38tabix -p vcf $item\.sorted\.filtered\.gz; \
     39done
    3340}}}
    3441
    35 == 2. Create a summary VCF per batch ==
     42
     43== 2. Merge sample VCFs into one batch VCF ==
     44
     45{{{
     46vcf-merge mydirectory/*.vcf.sorted.filtered.gz | bgzip -c > merged.vcf.gz
     47}}}
     48
     49== 3. Create a summary VCF per batch ==
    3650
    3751{{{
     
    3953}}}
    4054
    41 ''The option -ss  is crucial here: it removed all sample details.''
     55'''The option -ss  is crucial here: it removed all sample details.'''
    4256
    4357Afterwards, be sure to inspect the log file for warnings!
     
    4761}}}
    4862
    49 Man page:
     63
     64
     65
     66== Troubleshooting ==
     67
     68Q: My VCF files are not completely valid format!
     69A: The are some built-in options to help with this. For example:
     70
     71Fix missing '>' at the end of contig meta-data lines.
     72
     73{{{
     74perl -pi -e 's/(contig=<ID=[^>\n]+)$/$1>/' mydirectory/*.vcf
     75}}}
     76
     77Q: What are the script options?
     78A: Man page:
    5079
    5180{{{
     
    6291#
    6392}}}
    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_106Samples
    72 
    73 {{{
    74 cd /Volumes/CardioKitVCFs/OriginalVCFs/CAR_Batch1_106Samples
    75 }}}
    76 
    77 Fix missing '>' at the end of contig meta-data lines.
    78 
    79 {{{
    80 perl -pi -e 's/(contig=<ID=[^>\n]+)$/$1>/' CAR_*/*.vcf
    81 }}}
    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 done
    92 }}}