Entering edit mode
                    5.6 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!
Hi :)
You can open
/apps/hisat2/2.2.0/bin/hisat2_read_statistics.pycheck line 44 and see part of the script that is giving you the error.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.
Thank you! I am using Trimmomatic output fastq files. Can Trimmomatic result in an empty line.
Not sure, but you can use
sed -n '/^$/=' fileto find the empty lines.