How To Use Tablet To Visualization Bam File?
1
1
Entering edit mode
12.9 years ago
Haiping ▴ 110

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?

• 8.8k views
ADD COMMENT
8
Entering edit mode
12.9 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

yes, most likely

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

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