This is a test version of Biostars. For the public version, visit https://www.biostars.org.
hisat2

I'm trying to run hisat2 on a fastq file following the given syntax but it is giving me errors:

$ hisat2 -x S_lycopersicum_chromosomes.3.00_ch04.fa  -U SRR404331_ch4.fastq -S test.sam

Error:

Could not locate a HISAT2 index corresponding to basename "S_lycopersicum_chromosomes.3.00_ch04.fa"
Error: Encountered internal HISAT2 exception (#1)
Command: /usr/local/bin/hisat2-align-s --wrapper basic-0 -x S_lycopersicum_chromosomes.3.00_ch04.fasta -S test.sam -U SRR404331_ch4.fastq 
(ERR): hisat2-align exited with value 1

Even tho the files are present in the same directory I'm running the terminal from. I am a newbie so please explain what is wrong here.

Also upon running other .fastq files from the same directory some of them gives me errors of "could not open read file "file.fastq" for reading : skipping. Does it has something to do with my fastq files?

ngs hisat2

Command is incorrect. In stead of supplying the directory name you are furnishing reference fa. First build index for the said chromosome, in a directory as indexing creates multiple files. Furnish the directory with indices for -x option.

you mean $ hisat2 -x 'index_files' .....?

hisat2-build reference.fa (index-name)

$ hisat2-build  -p 4 S_lycopersicum_chromosomes.3.00_ch04.fa sly_chr4_index
$ hisat2-inspect  sly_chr4_index
$ $ hisat2 -x  sly_chr4_index -U SRR404331_ch4.fastq -S test.sam

change -p as per CPUs (and corresponding threads) on your machine.

Thank you for your help. Actually I am a studying BS-Biotechnology but Bioinformatics had my attention so I'm trying to learn some BI on my own. Self-learning is quite difficult tbh.

I have another question if you don't mind asking. How can I further utilize .sam file ? such as how many reads are there in test.sam file? Also the multiple file that was created using hisat2-build, are these separate chromosomes present in the input.fa file?

How can I further utilize .sam file ? 

Depends on the end goal of your analysis.

such as how many reads are there in test.sam file?

Read samtools manual. Functions like idxstats, flagstat, index , quickcheck view depth will help understanding about your alignment (file)

Also the multiple file that was created using hisat2-build, are these separate chromosomes present in the input.fa file?

No. Hisat2 generates multiple indices (index files) using reference sequence (fasta file) to be used in alignment. The multiple files what you see are indices of reference file (in this case chromosome 4 fasta fie).

1 answer

Have u build the index file for the reference first?

Well, I was provided with a shell script and an 'index_files.zip' after running the shell script i got this file: 'S_lycopersicum_chromosomes.3.00_ch04.fa'. along with other files. but It was mentioned in the notes to use 'S_lycopersicum_chromosomes.3.00_ch04.fa' as a reference file.

Log in to answer this question.