hisat2 command line fastq to bam
1
0
Entering edit mode
5.4 years ago
genya35 ▴ 40

Hello,

Could someone please suggest Linux command line for RNA HISAT2 alignment of single fastq with to ucsc hg19 fasta already saved and indexed? I would like to generate a bam file. I've tried it on Galaxy and now would like to reproduce on the command line, but the syntax is not clear. Do I need to process the reference file with HISAT2, or do I use it as it is?

Thank you

RNA-Seq • 12k views
1
Entering edit mode
5.4 years ago
GenoMax 127k

ucsc hg19 fasta already saved and indexed

If that is the case then you do not need to

Do I need to process the reference file with HISAT2

Examples of command lines are included in HISAT2 manual.

0
Entering edit mode

I indexed hg19 with Samtools and but with HISAT2, therefore, i need to index it, correct? I find the Manual very confusing. From what I can understand the following command input should produce and index for hg19 file, with hg19_indexed as the output that can be used in next alignment step, correct?

hisat2-build /data/hg19.fasta hg19_indexed


Thanks

1
Entering edit mode

I indexed hg19 with Samtools

that indexing is different. Not useful for alignments with HISAT2.

You would need to index for HISAT2 using the command used above (a generic representation is hisat2-build [options]* <reference_in> <ht2_base>). This will produce multiple files with a base_name (part before the .extensions in file names) hg19_indexed (to use your example above). All these files need to need to stay together.

So when you finally align, your command would look something like following (I am assuming you know how to use full/relative file paths):

hisat2 -f -x hg19_indexed -U reads_1.fq -S eg1.sam # for SE reads



Then you would follow this up by converting to BAM.

samtools view -bS eg2.sam > eg2.bam

0
Entering edit mode

Yes, thank you for your help. I did not include any [options*] since I'm indexing the entire hg19 file. I hope that was correct.

0
Entering edit mode

What happens if you:

hisat2 -f -x hg19_indexed -1 reads_R1.fq -2 reads_R2.fq | samtools view -bSh > eg2.bam


Just wondering if you could save space by skipping the storage of sam files

0
Entering edit mode

You're going to read a lot of manuals when doing bioinformatics, and this one is not so bad. Take your time to try some things, don't think it's too hard for you to understand. And for getting specific help there is biostars, just avoid questions like "what's the command for...", we also rarely know that by heart ;-)