HISAT2 error: Use of uninitialized value l 0 0 Entering edit mode 4 months ago Hi everyone. I am having a problem with HISAT2 (version 2.1.0). I try to map against Arabidopsis genome (indexed with hisat2-build) and then transform the SAM files from the alignment to BAM. For every sample, after the alignment summary there are always a few lines reporting Use of uninitialized valuel..., which sounds like a Perl error, but my knowledge of Perl is very basic. This is my code:

#!/bin/bash

SAMPLEDIR=/path/to/sample
IDXPATH=/path/to/hisat2_idx
OUTPUTPATH=/path/to/output

for sample in $(ls${SAMPLEDIR}/*_R*.fastq.gz | cut -d "_" -f1 | cut -d "/" -f11 | uniq | sort)
do

FWD=${SAMPLEDIR}/${sample}_R1.fastq.gz
REV=${SAMPLEDIR}/${sample}_R2.fastq.gz

hisat2 -x $IDXPATH -1$FWD -2 $REV -S${OUTPUTPATH}/Aligned/{sample}_aligned.sam --un-conc-gz{OUTPUTPATH}/Unaligned/{sample}_R%_unaligned.fastq.gz --threads 10 samtools view -@ 10 -b -o{OUTPUTPATH}/Aligned/{sample}_aligned.bam{OUTPUTPATH}/Aligned/{sample}_aligned.sam done  And this is an example of an alignment report: 26358706 reads; of these: 26358706 (100.00%) were paired; of these: 11025678 (41.83%) aligned concordantly 0 times 11275478 (42.78%) aligned concordantly exactly 1 time 4057550 (15.39%) aligned concordantly >1 times ---- 11025678 pairs aligned concordantly 0 times; of these: 183224 (1.66%) aligned discordantly 1 time ---- 10842454 pairs aligned 0 times concordantly or discordantly; of these: 21684908 mates make up the pairs; of these: 20532333 (94.68%) aligned 0 times 896731 (4.14%) aligned exactly 1 time 255844 (1.18%) aligned >1 times 61.05% overall alignment rate Use of uninitialized valuel in scalar chomp at /usr/bin/hisat2 line 536, <HT> line 61661602.
Use of uninitialized value $l in substitution (s///) at /usr/bin/hisat2 line 537, <HT> line 61661602. [bam_sort_core] merging from 10 files and 10 in-memory blocks...  For some samples there are sometimes other lines like Use of uninitialized value$l in print. However, it looks like there is no problem in the SAM to BAM conversion, so I'm not sure of how important this is. The problem comes from a while loop in an if-statement inside hisat2 file, were it opens the HT file:

if(defined($cap_out)) { # Open HISAT2 pipe open(HT, "$cmd |") || Fail("Could not open HISAT2 pipe: '\$cmd |'\n");


Inside this statement, the errors are always in a while loop that is initialized with while(<HT>). My knowledge of Perl is very rusty and I can't seem to find a possible solution. Could this be a version problem?

Here is my output for hisat2 --version:

/usr/bin/hisat2-align-s version 2.1.0
64-bit
Built on Debian unstable
Mon Sep  4 12:49:40 UTC 2017
Compiler: gcc version 7.2.0 (Ubuntu 7.2.0-12ubuntu1)
Options: -O3   -funroll-loops -g3 -Wdate-time -D_FORTIFY_SOURCE=2 -DPOPCNT_CAPABILITY
Sizeof {int, long, long long, void*, size_t, off_t}: {4, 8, 8, 8, 8, 8}


and for perl --version

This is perl 5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the


What do you think it's causing this? Thank you!

HISAT2 Perl • 205 views
0
Entering edit mode

Does this warning go away if you do not use --un-conc-gz? From a brief look at the hisat2 perl script (without any perl knowledge myself) it seems that this has to do with redirecting reads to user-defined files if this flag is set. That would be something the developers could probably answer but there are so many unanswered issues at Github...you can try though.

0
Entering edit mode

Thank you for your answer! It's strange, I was testing what you suggested by running single samples with and without --un-conc-gc, and now it seems to work just fine, no warning message in any case. For the rest the code is the same, except for this time being outside of the for loop. Could it be related to the loop? Does it actually make sense? I'll try running the exact same code as above but breaking the loop...