building index with HISAT2
2
1
Entering edit mode
6.6 years ago

I am newbie to linux and NGS. Whle trying to build an index with hisat2 for my project, im getting following error:

"Error: could not open 2.fa
Total time for call to driver() for forward index: 00:00:00
Error: Encountered internal HISAT2 exception (#1)
Command: hisat2-build --wrapper basic-0"

the command and output of the terminal is as follows:

./hisat2-build /data/memona/reference/1.fa,2.fa,3.fa,4.fa,5.fa,6.fa,7.fa,8.fa,9.fa,10.fa,11.fa,12.fa,13.fa hisat_index

Settings:
  Output files: "hisat_index.*.ht2"
  Line rate: 6 (line is 64 bytes)
  Lines per side: 1 (side is 64 bytes)
  Offset rate: 4 (one in 16)
  FTable chars: 10
  Strings: unpacked
  Local offset rate: 3 (one in 8)
  Local fTable chars: 6
  Local sequence length: 57344
  Local sequence overlap between two consecutive indexes: 1024
  Endianness: little
  Actual local endianness: little
  Sanity checking: disabled
  Assertions: disabled
  Random seed: 0
  Sizeofs: void*:8, int:4, long:8, size_t:8
Input files DNA, FASTA:
  /data/memona/reference/1.fa
  2.fa
  3.fa
  4.fa
  5.fa
  6.fa
  7.fa
  8.fa
  9.fa
  10.fa
  11.fa
  12.fa
  13.fa
Error: could not open 2.fa
Total time for call to driver() for forward index: 00:00:00
Error: Encountered internal HISAT2 exception (#1)
Command: hisat2-build --wrapper basic-0 /data/memona/reference/1.fa,2.fa,3.fa,4.fa,5.fa,6.fa,7.fa,8.fa,9.fa,10.fa,11.fa,12.fa,13.fa hisat_index

the hisat2-build file have all the permissions

-rwxrwxrwx 1 memona memona     2807 Mar 12  2016 hisat2-build

need kind help to resolve the issue

next-gen • 4.0k views
ADD COMMENT
3
Entering edit mode
6.6 years ago
Thibault D. ▴ 700

Hi,

You're missing one thing with your parameter expansion in bash. Try the following commnd line:

./hisat2-build /data/memona/reference/{1.fa,2.fa,3.fa,4.fa,5.fa,6.fa,7.fa,8.fa,9.fa,10.fa,11.fa,12.fa,13.fa} hisat_index

It should be better, as I think all your fasta files are in the reference directory. Have a look at this conversation in Stack

ADD COMMENT
0
Entering edit mode

thank you so much for the kind guidance. it really worked to give me the 8 index output files. but name of the output files are :

2.fa.1.ht2, 2.fa.2.ht2, v, 2.fa.3.ht2, 2.fa.4.ht2, 2.fa.5.ht2, 2.fa.6.ht2, 2.fa.7.ht2, 2.fa.8.ht2

rather to the name specified in command "hisat_index"...

is that index is OK ...???

ADD REPLY
3
Entering edit mode

I indeed made a mistake as I did not red the Hisat2 doc before answering. Hisat2 expects a comma-separated list of file, and my previous answer was a space-separated list of files. That is why the previous command produced many references.

Parameters expansion with curly brackets produces a space-separated list.

echo {1..1}.fa

Will result in:

1.fa 2.fa 3.fa

To make it comma-separated one can use translate command:

echo {1..3}.fa | tr ' ' ','

Which leads to:

1.fa,2.fa,3.fa

Would you try the following:

./hisat2-build $(echo /data/memona/reference/{1..13}.fa | tr ' ' ',') hisat_index

If anyone see a more elegant way to do it, feel free to correct me.

ADD REPLY
0
Entering edit mode

thank you sooo much it for your kind guidance and precious time. It has worked out in index output files. but now i am facing problem in alignment with HISAT2. i am using following command

[memona@farooq hisat2-2.1.0]$ ./hisat2 –p 64 --max-intronlen 10000 –x /data/memona/hisat2-2.1.0/hisat_index -1 /data/memona/SRR959590_A_1P.fq -2 /data/memona/SRR959590_A_2P.fq –S /data/memona/hisatresult/hisat_align.sam

and getting this error.:

Warning: Output file '64' was specified without -S.  This will not work in future HISAT 2 versions.  Please use -S instead.
Extra parameter(s) specified: "–x", "/data/memona/hisat2-2.1.0/hisat_index", "–S", "/data/memona/hisatresult/hisat_align.sam"
Note that if <mates> files are specified using -1/-2, a <singles> file cannot
also be specified.  Please run bowtie separately for mates and singles.
Error: Encountered internal HISAT2 exception (#1)
Command: /data/memona/hisat2-2.1.0/hisat2-align-s --wrapper basic-0 --max-intronlen 10000 -1 /data/memona/SRR959590_A_1P.fq -2 /data/memona/SRR959590_A_2P.fq –p 64 –x /data/memona/hisat2-2.1.0/hisat_index –S /data/memona/hisatresult/hisat_align.sam
(ERR): hisat2-align exited with value 1

-p 64 is not a file but number of threads im using. further i want all the output files in hisatresult directory as is spesified in command line.. kindly help me to resolve the issue..

ADD REPLY
1
Entering edit mode

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

ADD REPLY
2
Entering edit mode
6.6 years ago

You're specifying the path only for the first file:

/data/memona/reference/

Move into that directory and then run hisat2 without the path specification.

Also, as fair as I know, you have to specify as many index basenames as there are input files, the same way (comma separated).

ADD COMMENT
0
Entering edit mode

i have spesified path to each file as follows :

./hisat2-build –p 64 /data/memona/reference/1.fa,/data/memona/reference/2.fa,/data/memona/reference/3.fa,/data/memona/reference/4.fa,/data/memona/reference/5.fa,/data/memona/reference/6.fa,/data/memona/reference/7.fa,/data/memona/reference/8.fa,/data/memona/reference/9.fa,/data/memona/reference/10.fa,/data/memona/reference/11.fa,/data/memona/reference/12.fa,/data/memona/reference/13.fa hisat_index

and have encountered the error:

Error: Encountered internal HISAT2 exception (#1)
Command: hisat2-build --wrapper basic-0 –p 64 /data/memona/reference/1.fa,/data/memona/reference/2.fa,/data/memona/reference/3.fa,/data/memona/reference/4.fa,/data/memona/reference/5.fa,/data/memona/reference/6.fa,/data/memona/reference/7.fa,/data/memona/reference/8.fa,/data/memona/reference/9.fa,/data/memona/reference/10.fa,/data/memona/reference/11.fa,/data/memona/reference/12.fa,/data/memona/reference/13.fa hisat_index

can you please kindly help me out t resolve it???

ADD REPLY
0
Entering edit mode

Each reference has to have its own index. You are currently loading many references (i.e. all the fasta files you have as comma-separated) and sending them to one only reference basename (hisat_index).

If you have, say, three reference sequences named 1.fa, 2.fa and 3.fa, your command should have three basenames as well, just like:

1.fa,2.fa,3.fa 1_index,2_index,3_index

When you then run the alignment, you'll have to specify the index path. That would mean that, if you have to map on reference number 2, you'll have to specify:

-x /path/to/2_index

If you build up indexes for many references and send them to one basename only (as you did) all the indexes will overwrite each other!

Please, read this carefully and deeply and you'll find all your answers: https://ccb.jhu.edu/software/hisat2/manual.shtml#the-hisat2-build-indexer

ADD REPLY

Login before adding your answer.

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