Question: hisat2 command line fastq to bam
0
gravatar for genya35
10 months ago by
genya350
genya350 wrote:

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 • 1.2k views
ADD COMMENTlink written 10 months ago by genya350
1
gravatar for genomax
10 months ago by
genomax55k
United States
genomax55k wrote:

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 COMMENTlink written 10 months ago by genomax55k

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 REPLYlink written 10 months ago by genya350
1

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 REPLYlink modified 10 months ago • written 10 months ago by genomax55k

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 REPLYlink written 10 months ago by genya350

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 REPLYlink written 10 months ago by WouterDeCoster32k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1830 users visited in the last hour