By wuzhenzhen, 31 December, 2025

# 报错详细信息

A USER ERROR has occurred: An index is required but was not found for file drivingVariantFile:/home/Raw_data_20250821/Rmolle_callsnp_work/Rmolle_all_results/8snp_index_filter/SNP.raw.chr14.401.vcf.gz. Support for unindexed block-compressed files has been temporarily disabled. Try running IndexFeatureFile on the input.

# 解决

  • 该错误表明正在处理的 .vcf.gz压缩VCF文件缺少索引文件(通常为 .tbi或 .csi),而GATK要求必须提供索引才能读取压缩的块文件(block-compressed files)。
  • 首先,确定是否未将索引文件一起复制到工作目录中,如果是该情况,复制后则解决。
  • 如果不生效或者没有索引文件,则按照以下步骤重新生成:

    # 1.确认文件压缩格式
       首先确保 .vcf.gz是用 bgzip压缩的(而非普通 gzip),因为 bgzip支持随机访问(普通 gzip不支持索引)。
       file /home/Raw_data_20250821/Rmolle_callsnp_work/Rmolle_all_results/8snp_index_filter/SNP.raw.chr14.401.vcf.gz
       ## 应输出SNP.raw.chr14.401.vcf.gz: BGZF compressed data, block size 65536
       ## 如果是gzip压缩,则输出SNP.raw.chr14.401.vcf.gz: gzip compressed data, from Unix
       
    # 2. 如果为普通gzip压缩,先转换为bgzip
    	## 安装htslib(含bgzip和tabix)
    	conda install -c bioconda htslib  # 或 apt-get install tabix
    
    	## 解压普通gzip文件并重新用bgzip压缩
    	gunzip SNP.raw.chr14.401.vcf.gz  # 得到 SNP.raw.chr14.401.vcf
    	bgzip SNP.raw.chr14.401.vcf      # 重新压缩为 SNP.raw.chr14.401.vcf.gz(bgzip格式)
    	
    # 3. 创建索引文件(.tbi)
    	tabix -p vcf /home/Raw_data_20250821/Rmolle_callsnp_work/Rmolle_all_results/8snp_index_filter/SNP.raw.chr14.401.vcf.gz