hisat2 command line fastq to bam
1
0
Entering edit mode
7.1 years ago
genya35 ▴ 50

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 • 15k views
ADD COMMENT
1
Entering edit mode
7.1 years ago
GenoMax 147k

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.

ADD COMMENT
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

ADD REPLY
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

hisat2 -f -x hg19_indexed -1 reads_R1.fq -2 reads_R2.fq -S eg2.sam # for paired-end reads

Then you would follow this up by converting to BAM.

samtools view -bS eg2.sam > eg2.bam
ADD REPLY
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.

ADD REPLY
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

ADD REPLY
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 ;-)

ADD REPLY

Login before adding your answer.

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