hisat2 error index out of range
0
0
Entering edit mode
4.1 years ago
evelyn ▴ 230

Hello,

I am using hisat2 to create bam files from paired end fastq files:

hisat2-build genome.fa hisat
hisat2 -x hisat -1 R1_paired.fastq.gz -2 R2_paired.fastq.gz -S out.sam
samtools view -bS out.sam > out.bam

The .sam and .bam files are made. But the log file shows:

Traceback (most recent call last):
  File "/apps/hisat2/2.2.0/bin/hisat2_read_statistics.py", line 210, in <module>
    reads_stat(args.read_file, args.read_count)
  File "/apps/hisat2/2.2.0/bin/hisat2_read_statistics.py", line 168, in reads_stat
    for id, seq in fstream:
  File "/apps/hisat2/2.2.0/bin/hisat2_read_statistics.py", line 44, in parser_FQ
    if line[0] == '@':
IndexError: index out of range
12398067 reads; of these:
  12398067 (100.00%) were paired; of these:
    995937 (8.03%) aligned concordantly 0 times
    10948198 (88.31%) aligned concordantly exactly 1 time
    453932 (3.66%) aligned concordantly >1 times
    ----
    995937 pairs aligned concordantly 0 times; of these:
      126076 (12.66%) aligned discordantly 1 time
    ----
    869861 pairs aligned 0 times concordantly or discordantly; of these:
      1739722 mates make up the pairs; of these:
        1100705 (63.27%) aligned 0 times
        614508 (35.32%) aligned exactly 1 time
        24509 (1.41%) aligned >1 times
95.56% overall alignment rate
[bam_sort_core] merging from 12 files and 1 in-memory blocks...

How to address the error in index message here? Thank you for the help!

RNA-Seq • 2.7k views
ADD COMMENT
1
Entering edit mode

Hi :)

You can open /apps/hisat2/2.2.0/bin/hisat2_read_statistics.py check line 44 and see part of the script that is giving you the error.

 if line[0] == '@':

IndexError: index out of range

It means that there's no line[0], so I assume there's an empty line in your one of your fastq files. which probably won't cause any problems.

ADD REPLY
0
Entering edit mode

Thank you! I am using Trimmomatic output fastq files. Can Trimmomatic result in an empty line.

ADD REPLY
1
Entering edit mode

Not sure, but you can use sed -n '/^$/=' file to find the empty lines.

ADD REPLY

Login before adding your answer.

Traffic: 1508 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