How To Create A Venn Diagram Of Sample1.Vcf, Sample2.Vcf And Sample1&2(Union).Vcf Files
2
5
Entering edit mode
12.8 years ago
Deniz ▴ 50

How to create a Venn diagram to compare 3 vcf files?

I know that vcftools vcf-compare can give the overlap of variants between 2 vcf files

vcf-compare sample1.flt.vcf.gz sample2.flt.vcf.gz > venn.out

Is there any possibility to compare vcf files ( 1, 2 and their union vcf files) from mpileup?

I really appreciate any help

vcftools mpileup • 17k views
ADD COMMENT
0
Entering edit mode

-m is not work in vcf-compare option, see below:

vcf-compare -m *.vcf.gz

Missing argument in sprintf at /usr/local/bin/vcf-compare line 142.
Invalid conversion in sprintf: "%\232" at /usr/local/bin/vcf-compare line 142.
Missing argument in sprintf at /usr/local/bin/vcf-compare line 142.
Invalid conversion in sprintf: "%\362" at /usr/local/bin/vcf-compare line 142.
Missing argument in sprintf at /usr/local/bin/vcf-compare line 142.
Invalid conversion in sprintf: "%\026" at /usr/local/bin/vcf-compare line 142.
Expected 1 column names, found [�BC�(�}{o�Ȗ�ߙOA�`0    Fq��,V��n@��m��R���-�6o˒V����|�=��EI��$
                                                                                                  �}qc��T<<�:�z��<���q:�'���_�#���CO�EpBm�l�&@����08��gn���5z����G���ç˫����    q)��c0&������#�4{��p�t2������?�E8��ͧ�`�x=��/�d�������Ŭ��/���d� M�/G����i���h2�%��藘�pq��`
<������_������!���V�u�\N�S0o��p���'����.O���Qpd�#k������wvw[����ܚM�����l:_#+�h�:���h����S����5�����0�>��(���|W`�������}N�o%�?���a��B�����3��w���5}���I`E�/�q[���s`~�f8��y`��q���^-�N��Bo��T��
                                            ��Xh    ]�Cl=�H���z�p<�<�2��%nK}����{�^{��DJ;S�MVg<Ɓu;��I۲���r�8�0jY���5hY��MA��a�r��s����:��-�a
                                                                                                                                                          �>�#�jw:].
 at /usr/local/bin/vcf-compare line 32.
    main::error('Expected 1 column names, found [\x{1f}\x{8b}\x{8}\x{4}\x{0}\x{0}\x{0}\x{0}\x{0}\x{ff}\x{6}\x{0}BC\x{2}\x{0}\x{f5}(\x{ed}}{o\x{db}\x{c8}\x{96}\x{e7}\x{df}\x{99}O...') called at /usr/local/bin/vcf-compare line 142
    main::read_mappings_list('clinvar.vcf.gz', 'ARRAY(0xac0ee0)') called at /usr/local/bin/vcf-compare line 163
    main::compare_vcfs('HASH(0xac0b50)') called at /usr/local/bin/vcf-compare line 22
ADD REPLY
5
Entering edit mode
12.1 years ago
jackuser1979 ▴ 890

If you get the three VCF file, you can get the three files separtely containing the list of chromosome or contigs by simple awk script

awk '{print $1}' sample1(2,3).filt.vcf >output1(2,3).txt

You can paste these variants into this online venn-diagrame generator to get union & intersect of variants: http://bioinfogp.cnb.csic.es/tools/venny/index.html

ADD COMMENT
3
Entering edit mode
10.0 years ago

vcf-compare is able to deal with two or more vcf files. the -p option is also able to print out the resulting comparisons.

you can also use the faster htslib implementation of bcftools instead of vcftools, using bcftools stats and plot-vcfstats.

ADD COMMENT
0
Entering edit mode

Dear Jorge,

Can you kindly provide an example of that?

The reason I ask is because I have used bcftools stats with 3 vcf files. I wanted to create a venn diagram of their intersections and complements. However, the output was empty. There must have been something with the command but I am not sure what it is.

My command was as follows:

bcftools stats -S  File1.vcf.gz File2.vcf.gz File31.vcf.gz >bcftools_isec.out 1>>bcftools_isec.log 2>>bcftools_isec.stderr

I would really appreciate your input on this one.

ADD REPLY
0
Entering edit mode

unless you're comparing 3 multi-sample vcf files, there's no need to use the -S option. the -S option allows you to specify a sample list, and as you're not including any samples at the input then the output should contain nothing. since you're redirecting all the output, you should see these errors in those files. test the raw command

bcftools stats File1.vcf.gz File2.vcf.gz File31.vcf.gz

to see if it simply works (files may not be properly bgzipped,...), and then redirect its output if you need it.

ADD REPLY
0
Entering edit mode

I tried it, but bcftools works only for two vcf files. If I use three files, I will receive list of options for bcftools...

ADD REPLY
0
Entering edit mode

Did anyone figured it out for three vcf files???

ADD REPLY

Login before adding your answer.

Traffic: 1153 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6