Changes between Version 1 and Version 2 of SOPs/vcf_manipulation


Ignore:
Timestamp:
10/16/13 10:18:05 (11 years ago)
Author:
gbell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/vcf_manipulation

    v1 v2  
    11= Manipulating VCF files =
     2
     3Create a VCF ([http://en.wikipedia.org/wiki/Variant_Call_Format variant call format]) file [with about any program that identifies variants], such as
     4* samtools' mpileup+bcftools:
     5{{{
     6samtools mpileup -uf indexed_genome My_mapped_reads.bam | bcftools view -bvcg - >| My_mapped_reads.raw.bcf
     7samtools mpileup -uf indexed_genome *.bam | bcftools view -bvcg - >| Multiple_samples.raw.bcf
     8}}}
     9
     10Convert from BCF (binary version of VCF) to VCF:
     11{{{
     12bcftools view My_mapped_reads.raw.bcf > My_mapped_reads.raw.vcf
     13}}}
     14
     15Convert from VCF to BCF:
     16{{{
     17bcftools view -bS -D chr_list.txt My_mapped_reads.raw.vcf > My_mapped_reads.raw.bcf
     18}}}
     19
     20Merge multiple VCF files -- works on raw VCF files but apparently not with those processed by vcf-annotate
     21
     22{{{
     23# For each VCF file:
     24bgzip Variants_sample_A.raw.vcf
     25tabix -p vcf Variants_sample_A.raw.vcf.gz
     26}}}
     27Merge multiple bgzipped, tabixed files:
     28{{{
     29vcf-merge *.raw.vcf.gz >| Variants_all_samples.raw.vcf
     30}}}
     31
     32Annotate a VCF file (applying all filters with default values):
     33{{{
     34cat Variants_all_samples.raw.vcf | vcf-annotate -f + > Variants_all_samples.withTags.vcf
     35}}}
     36