STAR构建基因索引,GTF文件报错

大家好。我尝试使用STAR构建基因index,fasta用的是https://ftp.ensembl.org/pub/release-109/fasta/mus_musculus/dna/,GTF用的是https://ftp.ensembl.org/pub/release-109/gtf/mus_musculus/
但是在运行时GTF文件报错,说第三列没有exon。然而我用的GTF第三列确实有exon信息。
请大家帮忙解答

img


STAR --runMode genomeGenerate --genomeDir ~/reference_genome/index/star/mm39 --genomeFastaFiles Mus_musculus.GRCm39.dna.primary_assembly.fa --sjdbGTFfile Mus_musculus.GRCm39.109.chr.gtf.gz --sjdbOverhang 150 --runThreadN 5 --readFilesCommand zcat
    STAR version: 2.7.10b   compiled: 2022-11-01T09:53:26-04:00 :/home/dobin/data/STAR/STARcode/STAR.master/source
Jul 07 18:24:08 ..... started STAR run
Jul 07 18:24:08 ... starting to generate Genome files
Jul 07 18:24:47 ..... processing annotations GTF

Fatal INPUT FILE error, no exon lines in the GTF file: Mus_musculus.GRCm39.109.chr.gtf.gz
Solution: check the formatting of the GTF file, it must contain some lines with exon in the 3rd column.
          Make sure the GTF file is unzipped.
          If exons are marked with a different word, use --sjdbGTFfeatureExon .

Jul 07 18:24:47 ...... FATAL ERROR, exiting

根据报错信息,STAR在处理GTF文件时没有找到第三列为"exon"的行,这通常是GTF文件格式错误或者未解压导致的。
你可以检查几个方面:

  1. 用less、zless等工具检查GTF文件的格式,确认文件是否正确解压,并包含exon行。
  2. 尝试用gunzip解压GTF文件,然后直接传入未压缩的GTF文件。
  3. 检查GTF的第三列名称,某些GTF可能使用不同的名称如"CDS"等,这时需要用--sjdbGTFfeatureExon参数指定第三列真正表示外显子的名称。
  4. 尝试用另一个GTF文件,确认问题是否出在当前的GTF文件本身。
  5. 可以先用grep或awk提取包含"exon"的行,查看GTF文件是否真的不包含exon行。
    一般来说,确认GTF文件解压并格式正确后,就可以被STAR正常处理了。如果问题持续,也可以考虑降低STAR版本,有些最新版本对GTF解析更为严格。