Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jianfeng.mao
    Member
    • Dec 2010
    • 12

    failed when merging the example VCF files using VCFtools

    Dear SEQanswers,

    I am learning VCFtools by executing VCFtools commands on VCF files in Examples folder of the VCFtools installation path. Please help me to fix the three problems followed and give me some tips or directions to merging VCF files.

    tabix has been in my path.

    (1). When I want to merge the three example VCF files, I failed.

    commands:
    merge-vcf merge-test-a.vcf merge-test-b.vcf merge-test-c.vcf > merg.vcf

    results:
    [main] fail to load the index file.
    The command "tabix -l merge-test-a.vcf" exited with an error. Is the
    file tabix indexed?

    at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 167
    Vcf::throw('Vcf4_0=HASH(0x10082df18)', 'The command "tabix -l
    merge-test-a.vcf" exited with an error....') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 1687
    VcfReader::get_chromosomes('Vcf4_0=HASH(0x10082df18)') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 139
    main::init_cols('HASH(0x10082a3d0)', 'Vcf4_0=HASH(0x10082e110)')
    called at /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf
    line 219
    main::merge_vcf_files('HASH(0x10082a3d0)') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 12

    (2). Then I tried to compressed them. After I compressed and indexed
    the VCF files, I still failed to merge them.

    bgzip merge-test-a.vcf
    bgzip merge-test-b.vcf
    bgzip merge-test-c.vcf

    tabix -p vcf merge-test-a.vcf.gz
    tabix -p vcf merge-test-b.vcf.gz
    tabix -p vcf merge-test-c.vcf.gz

    ###############################################
    merge Command:
    merge-vcf merge-test-a.vcf.gz merge-test-b.vcf.gz merge-test-c.vcf.gz
    | bgzip -c > merg.vcf.gz

    results:
    zcat: merge-test-a.vcf.gz.Z: No such file or directory
    Error reading VCF file.

    at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 167
    Vcf::throw('Vcf=HASH(0x1008f32a8)', 'Error reading VCF file.\x{a}')
    called at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line
    280
    Vcf::next_line('Vcf=HASH(0x1008f32a8)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 219
    Vcf::_open('Vcf=HASH(0x1008f32a8)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 161
    Vcf::new('Vcf', 'file', 'merge-test-a.vcf.gz') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 125
    main::init_cols('HASH(0x10082a3d0)', 'Vcf4_0=HASH(0x10082e110)')
    called at /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf
    line 219
    main::merge_vcf_files('HASH(0x10082a3d0)') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 12
    ###############################################
    merge Command:
    merge-vcf merge-test-a.vcf.gz merge-test-b.vcf.gz merge-test-c.vcf.gz
    > merg.vcf.gz

    results:
    zcat: merge-test-a.vcf.gz.Z: No such file or directory
    Error reading VCF file.

    at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 167
    Vcf::throw('Vcf=HASH(0x1008f32a8)', 'Error reading VCF file.\x{a}')
    called at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line
    280
    Vcf::next_line('Vcf=HASH(0x1008f32a8)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 219
    Vcf::_open('Vcf=HASH(0x1008f32a8)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 161
    Vcf::new('Vcf', 'file', 'merge-test-a.vcf.gz') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 125
    main::init_cols('HASH(0x10082a3d0)', 'Vcf4_0=HASH(0x10082e110)')
    called at /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf
    line 219
    main::merge_vcf_files('HASH(0x10082a3d0)') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/merge-vcf line 12

    (3). vcf-stats and vcf-validator can work on all the three
    uncompressed VCF files: merge-test-a.vcf, merge-test-b.vcf,
    merge-test-c.vcf. But can not on the compressed files.

    Command:
    vcf-validator merge-test-a.vcf.gz

    Results:
    zcat: merge-test-c.vcf.gz.Z: No such file or directory
    Error reading VCF file.

    at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 167
    Vcf::throw('Vcf=HASH(0x10082a0d0)', 'Error reading VCF file.\x{a}')
    called at /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line
    280
    Vcf::next_line('Vcf=HASH(0x10082a0d0)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 219
    Vcf::_open('Vcf=HASH(0x10082a0d0)') called at
    /Users/jianfengmao/programe_files/VCFtools/lib/Vcf.pm line 161
    Vcf::new('Vcf', 'file', 'merge-test-c.vcf.gz') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/vcf-validator line 53
    main::do_validation('HASH(0x100804ed0)') called at
    /Users/jianfengmao/programe_files/VCFtools/bin/vcf-validator line 14
  • Michael.James.Clark
    Senior Member
    • Apr 2009
    • 207

    #2
    Some of the VCFtools seem to only work with uncompressed or compressed files. Another example I found is the --remove-filtered <string> and --keep-filtered <string>, which were only working with uncompressed files for me.

    As for your ZCAT problem, Mac OS X's version of ZCAT demands that the file end in .Z. I was under the impression the latest VCFtools fixed this issue but if not, you can just move the files and append a .Z on the end for the sake of merging I think.
    Mendelian Disorder: A blogshare of random useful information for general public consumption. [Blog]
    Breakway: A Program to Identify Structural Variations in Genomic Data [Website] [Forum Post]
    Projects: U87MG whole genome sequence [Website] [Paper]

    Comment

    Latest Articles

    Collapse

    • SEQadmin2
      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
      by SEQadmin2


      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.

      Probing...
      Today, 11:10 AM
    • SEQadmin2
      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
      by SEQadmin2



      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
      Yesterday, 05:17 AM
    • GATTACAT
      Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
      by GATTACAT
      Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
      07-01-2026, 11:43 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, Today, 10:04 AM
    0 responses
    7 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, Yesterday, 10:08 AM
    0 responses
    6 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 07-07-2026, 11:05 AM
    0 responses
    9 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 07-02-2026, 11:08 AM
    0 responses
    31 views
    0 reactions
    Last Post SEQadmin2  
    Working...