Header Leaderboard Ad

Collapse

Merge individual vcf files

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Merge individual vcf files

    Dear SEQanswers,

    I cannot get the Perl scripts in VCFtools called "vcf-merge" to work and would like to ask for your help.

    This is my problem:
    I have 5 VCF files I would like to merge, and I have converted each one to VCFv4.0 using the perl script in VCFtools/perl called "vcf-convert".
    Then I used bgzip and tabix -p vcf as it is explained in the website.
    I also changed the PATH to where the perl scripts are, like this:
    "export PERL5LIB='/ugi/home/claudiagiambartolomei/shared/vcftools_0.1.5"

    Finally, when I type "perl vcf-merge file1.vcf.gz.tbi file2.vcf.gz.tbi file3.vcf.gz.tbi file4.vcf.gz.tbi file5.vcf.gz.tbi | gzip -c > out_merged.vcf.gz "

    First a lot of odd-looking signs and question marks come up, and then an error comes up which says:

    ], assuming VCFv4.0
    Broken VCF header, no column names?
    at /vcftools_0.1.5/perl//Vcf.pm line 169
    Vcf::throw('Vcf4_0=HASH(0x25672d8)', 'Broken VCF header, no column names?') called at /vcftools_0.1.5/perl//Vcf.pm line 808
    VcfReader::_read_column_names('Vcf4_0=HASH(0x25672d8)') called at /vcftools_0.1.5/perl//Vcf.pm line 583
    VcfReader:arse_header('Vcf4_0=HASH(0x25672d8)') called at /vcftools_0.1.5/perl/vcf-merge line 128
    main::init_cols('HASH(0x28a5b20)', 'Vcf4_0=HASH(0x2566b40)') called at /vcftools_0.1.5/perl/vcf-merge line 221
    main::merge_vcf_files('HASH(0x28a5b20)') called at /vcftools_0.1.5/perl/vcf-merge line 12

    Can you please help me figure out what I am doing wrong?

    Thank you very much for any advice you could give me,
    -f

  • #2
    It looks like you're trying to merge the tabix index files rather than the VCF files. Try something like:

    perl vcf-merge file1.vcf.gz file2.vcf.gz file3.vcf.gz file4.vcf.gz file5.vcf.gz > out_merged.vcf

    Cheers,
    Ian

    Comment


    • #3
      I can't help with vcftools, but bedtools supports vcf files if you want to give that a shot.

      Comment


      • #4
        Thank you very much to both for your replies!
        iansealy, it worked: I just needed to do run the command using the files not indexed using tabix! Although I am not sure why since it states clearly in the perl script "Merge the bgzipped and tabix indexed VCF files. (E.g. bgzip file.vcf; tabix -p vcf file.vcf.gz)\n"
        ...Anyway using only the .gz works!!

        pbluescript, I didn't know about bedtools and since I'll do much of this in the future I am sure I'll need that too so thanks for mentioning it.

        Cheers,
        -f

        Comment


        • #5
          When you index a file using tabix (or what ever tool) it creates an index which is used together withthe file itself. The .tbi files are not the indexed vcf file but extra index files (every .vcf file needs an additional .vcf.tbi file). You need to create the indexes but you need to specify the vcf (in this case gzipped vcf.gz) files. The program recognises the index files by just adding the .tbi to the file name you specified.
          That's like a general rule for the tools which need indexed files. You create the index file but you specify the normal file and the program searches for the index files itself...

          I hope this clarifies it.

          Comment


          • #6
            Dear ulz peter,

            Thank you for explaining this, it finally makes sense now!

            cheers,
            -f

            Comment

            Latest Articles

            Collapse

            • seqadmin
              How RNA-Seq is Transforming Cancer Studies
              by seqadmin



              Cancer research has been transformed through numerous molecular techniques, with RNA sequencing (RNA-seq) playing a crucial role in understanding the complexity of the disease. Maša Ivin, Ph.D., Scientific Writer at Lexogen, and Yvonne Goepel Ph.D., Product Manager at Lexogen, remarked that “The high-throughput nature of RNA-seq allows for rapid profiling and deep exploration of the transcriptome.” They emphasized its indispensable role in cancer research, aiding in biomarker...
              09-07-2023, 11:15 PM
            • seqadmin
              Methods for Investigating the Transcriptome
              by seqadmin




              Ribonucleic acid (RNA) represents a range of diverse molecules that play a crucial role in many cellular processes. From serving as a protein template to regulating genes, the complex processes involving RNA make it a focal point of study for many scientists. This article will spotlight various methods scientists have developed to investigate different RNA subtypes and the broader transcriptome.

              Whole Transcriptome RNA-seq
              Whole transcriptome sequencing...
              08-31-2023, 11:07 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Today, 06:18 AM
            0 responses
            5 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 09:17 AM
            0 responses
            8 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 09-19-2023, 09:23 AM
            0 responses
            24 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 09-19-2023, 09:14 AM
            0 responses
            7 views
            0 likes
            Last Post seqadmin  
            Working...
            X