Question: How To Use Tablet To Visualization Bam File?
1
gravatar for Haiping
7.9 years ago by
Haiping110
Haiping110 wrote:

Hello. I want to use Tablet to visualise the aligned reuslt(bam format).All the data were download to my laptop before run tablet. When I input the files(.bam and fasta reference)into Tablet. It shows that a index file needed for it. So I used "samtools index .bam" to create a index file and download it into the samefolder in my laptop. When input it again. it shows that one of the files cannot be understand by tablet? What can I do to make it works?

• 5.6k views
ADD COMMENTlink written 7.9 years ago by Haiping110
7
gravatar for Jeremy Leipzig
7.9 years ago by
Philadelphia, PA
Jeremy Leipzig18k wrote:

make sure you are following the standard recipe:

samtools view -b -S myalignment.sam -t myref.fa > myalignment.bam
samtools sort myalignment.bam myalignment.sorted
samtools index myalignment.sorted.bam

Tablet needs to see:

myalignment.sorted.bam
myalignment.sorted.bam.bai
myref.fa
ADD COMMENTlink written 7.9 years ago by Jeremy Leipzig18k

Thanks for your reply! THe command I used were: samtools view -bS csort.sam | samtools sort – csort.bam samtools index csort.bam And it's ture that I got csort.bam, csort.bam.bai and myref.fa before I used the tablet. The only differnece was that I did't use -t ref.fa when I run the samtools view. Is this the main reason I can't use tablet the open my bam file?

ADD REPLYlink written 7.9 years ago by Haiping110

yes, most likely

ADD REPLYlink written 7.9 years ago by Jeremy Leipzig18k

I used the novoalign to align my read to the reference. Since there is a @sq at the begining of the sam file, it's why I don't using the reference during format conversion. Since the sam file is more than 40 G,it's realy cost times during format conversion. Thanks for your suggestion. I will try to do it this night if I can't get any another suggestion.

ADD REPLYlink written 7.9 years ago by Haiping110

just take the first 1000 lines or so of your SAM file and make sure that works using the aforementioned recipe

ADD REPLYlink written 7.9 years ago by Jeremy Leipzig18k

It's a good idea. But How I can only convert the first 1000 lines?

ADD REPLYlink written 7.9 years ago by Haiping110

head -n 1000 myalignment.sam > myalignment.subset.sam ...repeat recipe...

ADD REPLYlink written 7.9 years ago by Jeremy Leipzig18k

Haha! It turn out to be a mistake in reference. And the Tablet worked when I change the reference. And I also confirmed that the recipe you mentioned here worked well and the -t ref.fa doesn't affect the final visualization in Tablet. Thanks a lot for you kindly help.

ADD REPLYlink written 7.9 years ago by Haiping110
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: 921 users visited in the last hour